Package org.apache.hivemind.parse

Examples of org.apache.hivemind.parse.ModuleDescriptor


        assertEquals(1, em.getAttributeModels().size());
    }

    public void testRules() throws Exception
    {
        ModuleDescriptor md = parse("GenericModule.xml");
        List l = md.getConfigurationPoints();
        assertEquals(1, l.size());
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) l.get(0);
        Schema schema = cpd.getContributionsSchema();

        l = schema.getElementModel();
View Full Code Here


        assertEquals("addElement", rule4.getMethodName());
    }

    public void testParametersSchema() throws Exception
    {
        ModuleDescriptor md = parse("GenericModule.xml");
        List l = md.getServicePoints();
        assertEquals(2, l.size());
        ServicePointDescriptor spd = (ServicePointDescriptor) l.get(1);
        Schema schema = spd.getParametersSchema();

        assertNotNull(schema);
View Full Code Here

                + "seperated by periods\\.");
    }

    public void testSchemaDescription() throws Exception
    {
        ModuleDescriptor md = parse("SchemaDescription.sdl");

        List points = md.getConfigurationPoints();

        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);

        assertEquals("PointWithDescription", cpd.getId());
    }
View Full Code Here

        assertEquals("PointWithDescription", cpd.getId());
    }

    public void testEmbeddedConfigSchema() throws Exception
    {
        ModuleDescriptor md = parse("EmbeddedConfigSchema.sdl");

        List points = md.getConfigurationPoints();
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);
        Schema s = cpd.getContributionsSchema();

        List l = s.getElementModel();
View Full Code Here

        assertEquals("foo", em.getElementName());
    }

    public void testEmbeddedParametersSchema() throws Exception
    {
        ModuleDescriptor md = parse("EmbeddedParametersSchema.sdl");

        List points = md.getServicePoints();
        ServicePointDescriptor spd = (ServicePointDescriptor) points.get(0);
        Schema s = spd.getParametersSchema();

        List l = s.getElementModel();
View Full Code Here

        assertEquals("foo", em.getElementName());
    }

    public void testSetPropertyRule() throws Exception
    {
        ModuleDescriptor md = parse("SetPropertyRule.sdl");

        List points = md.getConfigurationPoints();
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);
        Schema s = cpd.getContributionsSchema();
        List l = s.getElementModel();

        ElementModel em = (ElementModel) l.get(0);
View Full Code Here

        assertEquals("bar", rule.getValue());
    }

    public void testPushAttributeRule() throws Exception
    {
        ModuleDescriptor md = parse("PushAttributeRule.sdl");

        List points = md.getConfigurationPoints();
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);
        Schema s = cpd.getContributionsSchema();
        List l = s.getElementModel();

        ElementModel em = (ElementModel) l.get(0);
View Full Code Here

*/
public class TestModuleDescriptor extends HiveMindTestCase
{
    public void testAddDupeSchema() throws Exception
    {
        ModuleDescriptor md = new ModuleDescriptor(getClassResolver(), new DefaultErrorHandler());
        md.setModuleId("foo");

        Resource r = new ClasspathResource(getClassResolver(), "/foo/bar");
        Location l1 = new LocationImpl(r, 20);
        Location l2 = new LocationImpl(r, 97);

        SchemaImpl s1 = new SchemaImpl("test");
        s1.setId("bar");
        s1.setLocation(l1);

        SchemaImpl s2 = new SchemaImpl("test");
        s2.setId("bar");
        s2.setLocation(l2);

        interceptLogging(md.getClass().getName());

        md.addSchema(s1);
        md.addSchema(s2);

        assertLoggedMessagePattern("Schema foo.bar conflicts with existing schema at classpath:/foo/bar, line 20\\.");

        assertSame(s1, md.getSchema("bar"));
    }
View Full Code Here

        new ConfigurationPointDescriptor().toString();
        new ContributionDescriptor().toString();
        new ImplementationDescriptor().toString();
        new CreateInstanceDescriptor().toString();
        new InvokeFactoryDescriptor().toString();
        new ModuleDescriptor(_resolver, new DefaultErrorHandler()).toString();
        new SubModuleDescriptor().toString();
        new DependencyDescriptor().toString();
        new ServicePointDescriptor().toString();
        new InterceptorDescriptor().toString();
        new ElementImpl().toString();
View Full Code Here

                + e.getElementName() + ".");
    }

    public void testModuleAttributes() throws Exception
    {
        ModuleDescriptor md = parse("GenericModule.xml");

        assertEquals("hivemind.test.parse", md.getModuleId());
        assertEquals("1.0.0", md.getVersion());

        // package attribute was added in 1.1. Defaultis same as
        // module id.

        assertEquals("hivemind.test.parse", md.getPackageName());
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.parse.ModuleDescriptor

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.