Package org.apache.hivemind.parse

Examples of org.apache.hivemind.parse.ModuleDescriptor


                + 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


        assertEquals("hivemind.test.parse", md.getPackageName());
    }

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

        List l = md.getConfigurationPoints();
        assertEquals(1, l.size());

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

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

        assertEquals(Occurances.ONE_PLUS, cpd.getCount());
    }

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

        List l = md.getContributions();
        assertEquals(1, l.size());

        ContributionDescriptor cd = (ContributionDescriptor) l.get(0);

        assertEquals("MyExtensionPoint", cd.getConfigurationId());
View Full Code Here

        assertEquals("MyExtensionPoint", cd.getConfigurationId());
    }

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

        List l = md.getContributions();
        assertEquals(1, l.size());

        ContributionDescriptor cd = (ContributionDescriptor) l.get(0);

        l = cd.getElements();
View Full Code Here

        { "gnip", "gnop" });
    }

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

        List l = md.getServicePoints();
        assertEquals(2, l.size());
        ServicePointDescriptor spd = (ServicePointDescriptor) l.get(0);

        assertEquals("MyService1", spd.getId());
        assertEquals("package.MyService", spd.getInterfaceClassName());
View Full Code Here

        assertNull(id.getName());
    }

    public void testImplementation() throws Exception
    {
        ModuleDescriptor md = parse("GenericModule.xml");
        List l = md.getImplementations();
        assertEquals(1, l.size());

        ImplementationDescriptor id1 = (ImplementationDescriptor) l.get(0);

        assertEquals("othermodule.OtherService", id1.getServiceId());
View Full Code Here

        assertEquals("MyInterceptor", id2.getFactoryServiceId());
    }

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

        List l = md.getConfigurationPoints();
        assertEquals(1, l.size());
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) l.get(0);

        String schemaId = cpd.getContributionsSchemaId();

        assertEquals("Fool", schemaId);

        Schema schema = md.getSchema(schemaId);

        assertNotNull(schema.getLocation());

        l = schema.getElementModel();
        assertEquals(2, l.size());
View Full Code Here

        assertLoggedMessage("Schema Bad is invalid: Key attribute 'bad' of element 'foo' never declared.");
    }

    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 = md.getSchema(cpd.getContributionsSchemaId());

        l = schema.getElementModel();

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

        assertEquals("addElement", rule5.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);

        String schemaId = spd.getParametersSchemaId();

        assertEquals("Parameters", schemaId);

        ElementModel em = (ElementModel) md.getSchema(schemaId).getElementModel().get(0);

        assertEquals("myParameter", em.getElementName());
    }
View Full Code Here

    public void testDuplicateContributionsSchema() throws Exception
    {
        interceptLogging();

        ModuleDescriptor md = parse("DuplicateSchemas.xml");

        assertLoggedMessagePattern("Multiple contributions schemas specified for configuration MyConfiguration. Using locally defined schema \\(at ");

        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) md
                .getConfigurationPoints().get(0);
        Schema nestedSchema = cpd.getContributionsSchema();

        assertNotNull(nestedSchema);
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.