Examples of DDBeanRoot


Examples of javax.enterprise.deploy.model.DDBeanRoot

        resultSet.add("META-INF/MANIFEST.MF");
        resultSet.add("META-INF/LICENSE.txt");
        resultSet.add("META-INF/ra.xml");
        resultSet.add("tranql-connector-1.0.jar");
        assertEquals(resultSet, entrySet);
        DDBeanRoot root = deployable.getDDBeanRoot();
        assertNotNull(root);
        assertEquals(ModuleType.RAR, root.getType());
        assertEquals(deployable, root.getDeployableObject());
        // Create the DConfigBeanRoot
        Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root);
        assertNotNull(dcbRoot.getXpaths());
        assertEquals(1, dcbRoot.getXpaths().length);
        assertEquals("connector", dcbRoot.getXpaths()[0]);
        // Try the /connector element
        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
        assertNull(connector.getEnvironment());
        EnvironmentData environment = new EnvironmentData();
        connector.setEnvironment(environment);
        Artifact configId = new Artifact();
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

        // Create and test the DDBeanRoot
        URL resource = classLoader.getResource("database.rar");
        assertNotNull(resource);
        ConnectorDeployable deployable = new ConnectorDeployable(resource);
        assertEquals(ModuleType.RAR, deployable.getType());
        DDBeanRoot root = deployable.getDDBeanRoot();
        assertNotNull(root);
        assertEquals(ModuleType.RAR, root.getType());
        assertEquals(deployable, root.getDeployableObject());
        // Create the DConfigBeanRoot
        Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root);
        RARConfiguration configuration = new RARConfiguration(deployable, dcbRoot);
        configuration.restore(in);
        // Try the /connector element
        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
        // Try the /connector/resourceadapter element
        assertNotNull(connector.getResourceAdapter());
        assertEquals(1, connector.getResourceAdapter().length);
        ResourceAdapter adapter = connector.getResourceAdapter()[0];
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

        ConnectorDeployable deployable = new ConnectorDeployable(resource);
        assertEquals(ModuleType.RAR, deployable.getType());
        Set entrySet = new HashSet(Collections.list(deployable.entries()));
        assertTrue(entrySet.contains("META-INF/ra.xml"));
        assertTrue(entrySet.contains("activemq-ra-3.2.1.jar"));
        DDBeanRoot root = deployable.getDDBeanRoot();
        assertNotNull(root);
        assertEquals(ModuleType.RAR, root.getType());
        assertEquals(deployable, root.getDeployableObject());
        // Create the DConfigBeanRoot
        Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root);
        assertNotNull(dcbRoot.getXpaths());
        assertEquals(1, dcbRoot.getXpaths().length);
        assertEquals("connector", dcbRoot.getXpaths()[0]);
        // Try the /connector element
        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
//        assertNull(connector.getConfigID());
//        assertNull(connector.getInverseClassLoading());
//        assertNull(connector.getParentID());
//        assertNull(connector.getSuppressDefaultParentID());
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

        ConnectorDeployable deployable = new ConnectorDeployable(resource);
        assertEquals(ModuleType.RAR, deployable.getType());
        Set entrySet = new HashSet(Collections.list(deployable.entries()));
        assertTrue(entrySet.contains("META-INF/ra.xml"));
        assertTrue(entrySet.contains("activemq-ra-3.2.1.jar"));
        DDBeanRoot root = deployable.getDDBeanRoot();
        assertNotNull(root);
        assertEquals(ModuleType.RAR, root.getType());
        assertEquals(deployable, root.getDeployableObject());
        // Create the DConfigBeanRoot
        Connector15DCBRoot dcbRoot = new Connector15DCBRoot(root);
        RARConfiguration configuration = new RARConfiguration(deployable, dcbRoot);
        configuration.restore(in);
        // Try the /connector element
        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
        // Try the /connector/resourceadapter element
        assertNotNull(connector.getResourceAdapter());
        assertEquals(1, connector.getResourceAdapter().length);
        ResourceAdapter adapter = connector.getResourceAdapter()[0];
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

            DeploymentManager mgr = ManagementHelper.getManagementHelper(request).getDeploymentManager();
            try {
                File rarFile = PortletManager.getRepositoryEntry(request, data.getRarURI());
                ConnectorDeployable deployable = new ConnectorDeployable(rarFile.toURL());
                DeploymentConfiguration config = mgr.createConfiguration(deployable);
                final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);

                EnvironmentData environment = new EnvironmentData();
                connector.setEnvironment(environment);
                org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                environment.setConfigId(configId);
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

    private ResourceAdapterParams loadConfigPropertiesByPath(PortletRequest request, String rarPath) {
        DeploymentManager mgr = ManagementHelper.getManagementHelper(request).getDeploymentManager();
        try {
            URL url = getRAR(request, rarPath).toURL();
            ConnectorDeployable deployable = new ConnectorDeployable(url);
            final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
            String adapterName = null, adapterDesc = null;
            String[] test = ddBeanRoot.getText("connector/display-name");
            if (test != null && test.length > 0) {
                adapterName = test[0];
            }
            test = ddBeanRoot.getText("connector/description");
            if (test != null && test.length > 0) {
                adapterDesc = test[0];
            }
            DDBean[] definitions = ddBeanRoot.getChildBean(
                    "connector/resourceadapter/outbound-resourceadapter/connection-definition");
            List<ConfigParam> configs = new ArrayList<ConfigParam>();
            if (definitions != null) {
                for (DDBean definition : definitions) {
                    String iface = definition.getText("connectionfactory-interface")[0];
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

            DeploymentManager mgr = ManagementHelper.getManagementHelper(request).getDeploymentManager();
            try {
                File rarFile = getRAR(request, data.getRarPath());
                ConnectorDeployable deployable = new ConnectorDeployable(rarFile.toURL());
                DeploymentConfiguration config = mgr.createConfiguration(deployable);
                final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(
                        ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);

                EnvironmentData environment = new EnvironmentData();
                connector.setEnvironment(environment);
                org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                environment.setConfigId(configId);
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

        assertNotNull(entry);
        entry.close();
        Class main = deployable.getClassFromScope("Main");
        assertEquals("Main", main.getName());

        DDBeanRoot root = deployable.getDDBeanRoot();
        assertNotNull(root);
        assertEquals(ModuleType.CAR, root.getType());
        assertEquals(deployable, root.getDeployableObject());
    }
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

    public void testNothing() {}

    public void XtestDConfigBeans() throws Exception {
        MockRARDeployable deployable = new MockRARDeployable(j2eeDD);
        DDBeanRoot ddroot = deployable.getDDBeanRoot();
        DeploymentConfiguration rarConfiguration = new RARConfigurer().createConfiguration(deployable);
        DConfigBeanRoot root = rarConfiguration.getDConfigBeanRoot(ddroot);
        assertNotNull(root);

        //outbound
        DDBean[] connectionDefinitiondds = ddroot.getChildBean(root.getXpaths()[0]);
        assertEquals(1, connectionDefinitiondds.length);
        ConnectionDefinitionDConfigBean connectionDefinitionDConfigBean = (ConnectionDefinitionDConfigBean)root.getDConfigBean(connectionDefinitiondds[0]);
        assertNotNull(connectionDefinitionDConfigBean);
        ConnectionDefinitionInstance connectionDefinitionInstance1 = new ConnectionDefinitionInstance();
        connectionDefinitionDConfigBean.setConnectionDefinitionInstance(new ConnectionDefinitionInstance[] {connectionDefinitionInstance1});
View Full Code Here

Examples of javax.enterprise.deploy.model.DDBeanRoot

    private ResourceAdapterParams loadConfigPropertiesByPath(PortletRequest request, String rarPath) {
        DeploymentManager mgr = PortletManager.getDeploymentManager(request);
        try {
            URL url = getRAR(request, rarPath).toURL();
            ConnectorDeployable deployable = new ConnectorDeployable(url);
            final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
            String adapterName = null, adapterDesc = null;
            String[] test = ddBeanRoot.getText("connector/display-name");
            if(test != null && test.length > 0) {
                adapterName = test[0];
            }
            test = ddBeanRoot.getText("connector/description");
            if(test != null && test.length > 0) {
                adapterDesc = test[0];
            }
            DDBean[] definitions = ddBeanRoot.getChildBean("connector/resourceadapter/outbound-resourceadapter/connection-definition");
            List configs = new ArrayList();
            if(definitions != null) {
                for (int i = 0; i < definitions.length; i++) {
                    DDBean definition = definitions[i];
                    String iface = definition.getText("connectionfactory-interface")[0];
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.