Examples of BaseComponent


Examples of org.apache.servicemix.common.BaseComponent

    protected void tearDown() throws Exception {
       
    }
   
    public void testDeployWithProperties() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean", getServiceUnitPath("xbean"));
        assertNotNull(su);
        assertEquals(1, su.getEndpoints().size());
        XBeanEndpoint ep = (XBeanEndpoint) su.getEndpoints().iterator().next();
        assertEquals("value", ep.getProp());
View Full Code Here

Examples of org.apache.servicemix.common.BaseComponent

        XBeanEndpoint ep = (XBeanEndpoint) su.getEndpoints().iterator().next();
        assertEquals("value", ep.getProp());
    }
   
    public void testDeployWithClasspathXml() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean-cp", getServiceUnitPath("xbean-cp"));
        assertNotNull(su);
        ClassLoader cl = su.getConfigurationClassLoader();
        assertNotNull(cl);
        assertTrue(cl instanceof JarFileClassLoader);
View Full Code Here

Examples of org.apache.servicemix.common.BaseComponent

        assertEquals(2, ((JarFileClassLoader) cl).getURLs().length);
        assertNotNull(cl.getResource("test.xml"));
    }
   
    public void testDeployWithInlineClasspath() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean-inline", getServiceUnitPath("xbean-inline"));
        assertNotNull(su);
        ClassLoader cl = su.getConfigurationClassLoader();
        assertNotNull(cl);
        assertTrue(cl instanceof JarFileClassLoader);
View Full Code Here

Examples of org.apache.servicemix.common.BaseComponent

        assertEquals(2, ((JarFileClassLoader) cl).getURLs().length);
        assertNotNull(cl.getResource("test.xml"));
    }
   
    public void testDeployWithDefaultClasspath() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean-lib", getServiceUnitPath("xbean-lib"));
        assertNotNull(su);
        ClassLoader cl = su.getConfigurationClassLoader();
        assertNotNull(cl);
        assertTrue(cl instanceof JarFileClassLoader);
View Full Code Here

Examples of org.apache.servicemix.common.BaseComponent

    protected void tearDown() throws Exception {
       
    }
   
    public void testDeployWithProperties() throws Exception {
        MyXBeanDeployer deployer = new MyXBeanDeployer(new BaseComponent() { });
        ServiceUnit su = deployer.deploy("xbean", getServiceUnitPath("xbean"));
        assertNotNull(su);
        assertEquals(1, su.getEndpoints().size());
        XBeanEndpoint ep = (XBeanEndpoint) su.getEndpoints().iterator().next();
        assertEquals("value", ep.getProp());
View Full Code Here

Examples of org.rhq.modules.plugins.jbossas7.BaseComponent

    /**
     * Test the real API code for uploading - case 1: just upload to /deployment
     * @throws Exception if anything goes wrong.
     */
    public void testUploadViaCreateChild1() throws Exception {
        BaseComponent bc = new BaseComponent();
        bc.setPath("");
        ResourceType rt = new ResourceType();
        rt.setName("Deployment");
        Resource resource = new Resource("deployment=" + TEST_WAR_FILE_NAME, TEST_WAR_FILE_NAME, rt); // TODO resource key?
        resource.setUuid(UUID.randomUUID().toString());
        StandaloneASComponent parentComponent = new StandaloneASComponent();
        parentComponent.setConnection(getDomainControllerASConnection());
        ResourceContext context = new ResourceContext(resource, parentComponent, null, null, null, null, null, null,
            null, null, null, null, null, null);
        bc.start(context);

        String bytes_value = uploadToAs(TEST_WAR_PATH);

        ResourcePackageDetails details = new ResourcePackageDetails(new PackageDetailsKey(TEST_WAR_FILE_NAME, "1.0",
            "deployment", "all"));
        CreateResourceReport report = new CreateResourceReport(TEST_WAR_FILE_NAME, rt, new Configuration(),
            new Configuration(), details);
        try {
            report = bc.runDeploymentMagicOnServer(report, TEST_WAR_FILE_NAME, TEST_WAR_FILE_NAME, bytes_value);
            assert report != null;
            assert report.getErrorMessage() == null : "Report contained an unexpected error: "
                + report.getErrorMessage();
            assert report.getStatus() != null : "Report did not contain a status";
            assert report.getStatus() == CreateResourceStatus.SUCCESS : "Status was no success";
View Full Code Here

Examples of org.rhq.modules.plugins.jbossas7.BaseComponent

    /**
     * Test the real API code for uploading - case 2: upload to /deployment and a server group
     * @throws Exception if anything goes wrong.
     */
    public void testUploadViaCreateChild2() throws Exception {
        BaseComponent bc = new BaseComponent();
        bc.setPath("server-group=main-server-group");
        ResourceType rt = new ResourceType();
        rt.setName("Deployment");
        Resource resource = new Resource("server-group=main-server-group", TEST_WAR_FILE_NAME, rt);
        resource.setUuid(UUID.randomUUID().toString());
        StandaloneASComponent parentComponent = new StandaloneASComponent();
        parentComponent.setConnection(getDomainControllerASConnection());
        ResourceContext context = new ResourceContext(resource, parentComponent, null, null, null, null, null, null,
            null, null, null, null, null, null);
        bc.start(context);

        String bytes_value = uploadToAs(TEST_WAR_PATH);

        ResourcePackageDetails details = new ResourcePackageDetails(new PackageDetailsKey(TEST_WAR_FILE_NAME, "1.0",
            "deployment", "all"));
        CreateResourceReport report = new CreateResourceReport(TEST_WAR_FILE_NAME, rt, new Configuration(),
            new Configuration(), details);
        try {
            report = bc.runDeploymentMagicOnServer(report, TEST_WAR_FILE_NAME, TEST_WAR_FILE_NAME, bytes_value);
            assert report != null;
            assert report.getErrorMessage() == null : "Report contained an unexpected error: "
                + report.getErrorMessage();
            assert report.getStatus() != null : "Report did not contain a status";
            assert report.getStatus() == CreateResourceStatus.SUCCESS : "Status was no success";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.