Package org.apache.geronimo.deployment.xbeans

Examples of org.apache.geronimo.deployment.xbeans.ConfigurationDocument


*/
public class ConfigPlanTest extends TestCase {
    private URL plan1;

    public void testParser() throws Exception {
        ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
        ConfigurationType configuration = doc.getConfiguration();
        assertEquals("test/plan1", configuration.getConfigId());

        DependencyType[] dependencies = configuration.getDependencyArray();
        assertEquals(1, dependencies.length);
        assertEquals("geronimo", dependencies[0].getGroupId());
View Full Code Here


        //this is kind of cheating, we rely on the builder to iterate through existing members of the collection.
        referenceCollection.add(javaBeanXmlAttributeBuilder);
        new ServiceConfigBuilder(parentIdArray, null, referenceCollection, null, null);
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        URL plan1 = cl.getResource("services/plan1.xml");
        ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
        ConfigurationType plan = doc.getConfiguration();
        File outFile = File.createTempFile("foo", "bar");
        outFile.delete();
        if (!outFile.mkdirs()) {
            fail("could not create temp dir");
        }
View Full Code Here

                    return null;
                }
            } finally {
                cursor.dispose();
            }
            ConfigurationDocument configurationDoc;
            if (xmlObject instanceof ConfigurationDocument) {
                configurationDoc = (ConfigurationDocument) xmlObject;
            } else {
                configurationDoc = (ConfigurationDocument) xmlObject.changeType(ConfigurationDocument.type);
            }
            Collection errors = new ArrayList();
            if (!configurationDoc.validate(XmlBeansUtil.createXmlOptions(errors))) {
                throw new DeploymentException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + configurationDoc.toString());
            }
            return configurationDoc.getConfiguration();
        } catch (XmlException e) {
            throw new DeploymentException("Could not parse xml in plan", e);
        } catch (IOException e) {
            throw new DeploymentException("no plan at " + planFile, e);
        }
View Full Code Here

*/
public class ConfigPlanTest extends TestCase {
    private URL plan1;

    public void testParser() throws Exception {
        ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
        ConfigurationType configuration = doc.getConfiguration();
        assertEquals("test/plan1", configuration.getConfigId());

        DependencyType[] dependencies = configuration.getDependencyArray();
        assertEquals(1, dependencies.length);
        assertEquals("geronimo", dependencies[0].getGroupId());
View Full Code Here

            return null;
        }

        // todo tell the difference between an invalid plan and one that's not for me
        try {
            ConfigurationDocument configurationDoc = ConfigurationDocument.Factory.parse(planFile);
            return configurationDoc.getConfiguration();
        } catch (XmlException e) {
            return null;
        } catch (Exception e) {
            throw new DeploymentException(e);
        }
View Full Code Here

*/
public class ConfigPlanTest extends TestCase {
    private URL plan1;

    public void testParser() throws Exception {
        ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
        ConfigurationType configuration = doc.getConfiguration();
        assertEquals("test/plan1", configuration.getConfigId());

        DependencyType[] dependencies = configuration.getDependencyArray();
        assertEquals(1, dependencies.length);
        assertEquals("geronimo", dependencies[0].getGroupId());
View Full Code Here

*/
public class ConfigPlanTest extends TestCase {
    private URL plan1;

    public void testParser() throws Exception {
        ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
        ConfigurationType configuration = doc.getConfiguration();
        assertEquals("test/plan1", configuration.getConfigId());

        DependencyType[] dependencies = configuration.getDependencyArray();
        assertEquals(4, dependencies.length);
        assertEquals("geronimo", dependencies[0].getGroupId());
View Full Code Here

        //this is kind of cheating, we rely on the builder to iterate through existing members of the collection.
        referenceCollection.add(javaBeanXmlAttributeBuilder);
        new ServiceConfigBuilder(parentIdArray, null, referenceCollection, null, null);
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        final URL plan1 = cl.getResource("services/plan1.xml");
        ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
        ConfigurationType plan = doc.getConfiguration();
        File outFile = File.createTempFile("foo", "bar");
        outFile.delete();
        if (!outFile.mkdirs()) {
            fail("could not create temp dir");
        }
View Full Code Here

                    return null;
                }
            } finally {
                cursor.dispose();
            }
            ConfigurationDocument configurationDoc;
            if (xmlObject instanceof ConfigurationDocument) {
                configurationDoc = (ConfigurationDocument) xmlObject;
            } else {
                configurationDoc = (ConfigurationDocument) xmlObject.changeType(ConfigurationDocument.type);
            }
            Collection errors = new ArrayList();
            if (!configurationDoc.validate(XmlBeansUtil.createXmlOptions(errors))) {
                throw new DeploymentException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + configurationDoc.toString());
            }
            return configurationDoc.getConfiguration();
        } catch (XmlException e) {
            throw new DeploymentException("Could not parse xml in plan", e);
        } catch (IOException e) {
            throw new DeploymentException("no plan at " + planFile, e);
        }
View Full Code Here

        }
    }

    private XmlObject actionGeneratePlan(PortletRequest request, RealmData data) {
        normalize(data);
        ConfigurationDocument doc = ConfigurationDocument.Factory.newInstance();
        ConfigurationType root = doc.addNewConfiguration();
        root.setConfigId("SecurityRealm-"+data.getName());
        // Use a parentId of null to pick up the default
        // Dependencies
        if(data.getJar() != null) {
            DependencyType jar = root.addNewDependency();
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.xbeans.ConfigurationDocument

Copyright © 2018 www.massapicom. 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.