Package org.apache.hivemind.schema

Examples of org.apache.hivemind.schema.Schema


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

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

        List l = s.getElementModel();

        assertEquals(1, l.size());

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


    {
        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

    {
        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

        md.setModuleId("foo");

        MockControl c1 = newControl(Schema.class);
        MockControl c2 = newControl(Schema.class);

        Schema s1 = (Schema) c1.getMock();
        Schema s2 = (Schema) c2.getMock();

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

        s1.getId();
        c1.setReturnValue("bar");

        s2.getId();
        c2.setReturnValue("bar");

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

        s1.getLocation();
        c1.setReturnValue(l1);

        s2.getLocation();
        c2.setReturnValue(l2);

        replayControls();

        md.addSchema(s1);
View Full Code Here

            _factory =
                (ServiceImplementationFactory) factoryPoint.getService(
                    ServiceImplementationFactory.class);

            Schema schema = factoryPoint.getParametersSchema();

      // Note: it's kind of a toss up whether logging should occur using the
      // id of the service being constructed, or of the factory being invoked.
      // Here, we're using the constructed service ... with the intent being that
      // users will enable debugging for the service (or search the logs for the service)
View Full Code Here

        String schemaId = cpd.getContributionsSchemaId();

        assertEquals("Fool", schemaId);

        Schema schema = md.getSchema(schemaId);

        assertNotNull(schema.getLocation());

        l = schema.getElementModel();
        assertEquals(2, l.size());

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

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

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

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

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

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

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

        assertLoggedMessagePattern("Multiple parameters schemas specified for service MyServiceFactory. Using locally defined schema \\(at ");

        ServicePointDescriptor spd = (ServicePointDescriptor) md.getServicePoints().get(0);
        Schema nestedSchema = spd.getParametersSchema();

        assertNotNull(nestedSchema);

        ElementModel em = (ElementModel) nestedSchema.getElementModel().get(0);

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

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

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

TOP

Related Classes of org.apache.hivemind.schema.Schema

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.