Package org.apache.hivemind.parse

Examples of org.apache.hivemind.parse.ConfigurationPointDescriptor


        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);

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


    {
        ModuleDescriptor md = parse("SchemaDescription.xml");

        List points = md.getConfigurationPoints();

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

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

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

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

        List l = s.getElementModel();

        assertEquals(1, l.size());
View Full Code Here

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

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

        ElementModel em = (ElementModel) l.get(0);

        List rules = em.getRules();
View Full Code Here

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

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

        ElementModel em = (ElementModel) l.get(0);

        List rules = em.getRules();
View Full Code Here

    public void testPushContentRule() throws Exception
    {
        ModuleDescriptor md = parse("PushContentRule.xml");

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

        ElementModel em = (ElementModel) l.get(0);

        List rules = em.getRules();
View Full Code Here

    public void testPrivateConfigurationPoint() throws Exception
    {
        ModuleDescriptor md = parse("PrivateConfigurationPoint.xml");

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

        assertEquals(Visibility.PRIVATE, cpd.getVisibility());
    }
View Full Code Here

public class TestToString extends FrameworkTestCase
{

    public void testToString()
    {
        new ConfigurationPointDescriptor().toString();
        new ContributionDescriptor().toString();
        new ImplementationDescriptor().toString();
        new CreateInstanceDescriptor().toString();
        new InvokeFactoryDescriptor().toString();
        new ModuleDescriptor(_resolver, new DefaultErrorHandler()).toString();
View Full Code Here

        List points = md.getConfigurationPoints();
        int count = size(points);

        for (int i = 0; i < count; i++)
        {
            ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(i);

            ConfigurationPointDefinitionImpl configurationPoint = new ConfigurationPointDefinitionImpl(
                    module, cpd.getId(), cpd.getLocation(), cpd.getVisibility(),
                    cpd.getType(), cpd.getCount());
            module.addConfigurationPoint(configurationPoint);
           
            // If schema is embedded we can add a parser now, otherwise it must
            // be resolved and processed later
            if (cpd.getContributionsSchema() != null) {
                // TODO: compare container class name and rootElementClassName
                if (HashMap.class.getName().equals(cpd.getContributionsSchema().getRootElementClassName())
                    || UniqueHashMap.class.getName().equals(cpd.getContributionsSchema().getRootElementClassName())) {
                   
                    configurationPoint.setConfigurationTypeName(Map.class.getName());
                }

                // Add parser constructor with direct reference to schema
                ConfigurationParserDefinition parserDef = new ConfigurationParserDefinitionImpl(
                        module, cpd.getContributionsSchema().getLocation(), HiveMindSchemaParser.INPUT_FORMAT_NAME,
                        new HiveMindSchemaParserConstructor(cpd.getContributionsSchema()));
               
                configurationPoint.addParser(parserDef);
            } else if (cpd.getContributionsSchemaId() != null) {
                // Add schema assignment and resolve in post processing
                String qualifiedId = IdUtils.qualify(module.getId(), cpd.getId());
                SchemaAssignment schemaAssignment = new SchemaAssignment(qualifiedId,
                        cpd.getContributionsSchemaId(), cpd.getLocation());
                module.addSchemaAssignment(schemaAssignment);
            }
        }
    }
View Full Code Here

        fooBar.addSchema(schema);

        ModuleDescriptor zipZoop = new ModuleDescriptor(null, errorHandler);
        zipZoop.setModuleId("zip.zoop");

        ConfigurationPointDescriptor cpd = new ConfigurationPointDescriptor();
        cpd.setId("Zap");
        cpd.setContributionsSchemaId("foo.bar.Baz");

        zipZoop.addConfigurationPoint(cpd);

        XmlModuleDescriptorProcessor processor = new XmlModuleDescriptorProcessor(definition,
                errorHandler);
View Full Code Here

TOP

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

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.