Package org.apache.hivemind.schema

Examples of org.apache.hivemind.schema.Schema


        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

    {
        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

        return getSchema(qualifiedId, moduleId, location);
    }

    private Schema getSchema(String schemaId, String referencingModule, Location reference)
    {
        Schema schema = (Schema) _schemas.get(schemaId);

        if (schema == null)
            _errorHandler
                    .error(_log, ImplMessages.unableToResolveSchema(schemaId), reference, null);
        else if (!schema.visibleToModule(referencingModule))
        {
            _errorHandler.error(
                    _log,
                    ImplMessages.schemaNotVisible(schemaId, referencingModule),
                    reference,
View Full Code Here

        return getSchema(qualifiedId, moduleId, location);
    }

    private Schema getSchema(String schemaId, String referencingModule, Location reference)
    {
        Schema schema = (Schema) _schemas.get(schemaId);

        if (schema == null)
            _errorHandler
                    .error(_log, ImplMessages.unableToResolveSchema(schemaId), reference, null);
        else if (!schema.visibleToModule(referencingModule))
        {
            _errorHandler.error(
                    _log,
                    ImplMessages.schemaNotVisible(schemaId, referencingModule),
                    reference,
View Full Code Here

public class TestRegistryInfrastructureConstructor extends HiveMindTestCase
{
    public void testFound()
    {
        MockControl schemaControl = newControl(Schema.class);
        Schema schema = (Schema) schemaControl.getMock();

        schema.getId();
        schemaControl.setReturnValue("Baz", 2);

        schema.visibleToModule("zip.zoop");
        schemaControl.setReturnValue(true);

        schema.canInstancesBeKeyed();
        schemaControl.setReturnValue(false);

        replayControls();

        DefaultErrorHandler errorHandler = new DefaultErrorHandler();
View Full Code Here

        ErrorHandler eh = (ErrorHandler) ehControl.getMock();

        Log log = LogFactory.getLog(TestRegistryInfrastructureConstructor.class);

        MockControl schemaControl = newControl(Schema.class);
        Schema schema = (Schema) schemaControl.getMock();

        Location l = fabricateLocation(13);

        schema.getId();
        schemaControl.setReturnValue("Baz", 2);

        schema.visibleToModule("zip.zoop");
        schemaControl.setReturnValue(false);

        eh.error(log, ImplMessages.schemaNotVisible("foo.bar.Baz", "zip.zoop"), l, null);

        replayControls();
View Full Code Here

            ServicePoint factoryPoint = _contributingModule.getServicePoint(_factoryServiceId);

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

            Schema schema = factoryPoint.getParametersSchema();

            SchemaProcessorImpl processor = new SchemaProcessorImpl(factoryPoint.getErrorLog(),
                    schema);

            processor.process(_parameters, _contributingModule);
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.