Package org.apache.hivemind.definition

Examples of org.apache.hivemind.definition.Occurances


            XmlServicePointDefinitionImpl xmlServicePoint = (XmlServicePointDefinitionImpl) spd;

            Schema schema = xmlServicePoint.getParametersSchema();
            if (schema != null) {
               
                Occurances expected = xmlServicePoint.getParametersCount();
                checkParameterCounts(errorLog, expected);

                SchemaProcessorImpl processor = new SchemaProcessorImpl(errorLog, schema);
               
                _convertedParameters = constructParametersContainer(schema.getRootElementClassName(), factoryPoint.getModule());
View Full Code Here


*/
public class TestOccurances extends TestCase
{
    public void testNone()
    {
        Occurances o = Occurances.NONE;

        assertEquals(true, o.inRange(0));
        assertEquals(false, o.inRange(1));
    }
View Full Code Here

        assertEquals(false, o.inRange(1));
    }

    public void testOnePlus()
    {
        Occurances o = Occurances.ONE_PLUS;
        assertEquals(false, o.inRange(0));
        assertEquals(true, o.inRange(1));
        assertEquals(true, o.inRange(2));
    }
View Full Code Here

        assertEquals(true, o.inRange(2));
    }

    public void testRequired()
    {
        Occurances o = Occurances.REQUIRED;

        assertEquals(false, o.inRange(0));
        assertEquals(true, o.inRange(1));
        assertEquals(false, o.inRange(2));
    }
View Full Code Here

        assertEquals(false, o.inRange(2));
    }

    public void testUnbounded()
    {
        Occurances o = Occurances.UNBOUNDED;

        assertEquals(true, o.inRange(0));
        assertEquals(true, o.inRange(1));
        assertEquals(true, o.inRange(2));
    }
View Full Code Here

        assertEquals(true, o.inRange(2));
    }

    public void testOptional()
    {
        Occurances o = Occurances.OPTIONAL;

        assertEquals(true, o.inRange(0));
        assertEquals(true, o.inRange(1));
        assertEquals(false, o.inRange(2));
    }
View Full Code Here

        checkAttributes();

        String id = getValidatedAttribute("id", ID_PATTERN, "id-format");
        cpd.setId(id);

        Occurances count = (Occurances) getEnumAttribute("occurs", OCCURS_MAP);

        if (count != null)
            cpd.setCount(count);

        Visibility visibility = (Visibility) getEnumAttribute("visibility", VISIBILITY_MAP);
View Full Code Here

        spd.setInterfaceClassName(interfaceName);

        spd.setParametersSchemaId(getAttribute("parameters-schema-id"));

        Occurances count = (Occurances) getEnumAttribute("parameters-occurs", OCCURS_MAP);

        if (count != null)
            spd.setParametersCount(count);

        Visibility visibility = (Visibility) getEnumAttribute("visibility", VISIBILITY_MAP);
View Full Code Here

        }
    }
   
    private void checkContributionCounts(ModuleDefinition definingModule, ConfigurationPointDefinition configurationPoint)
    {
        Occurances expected = configurationPoint.getExpectedContributions();

        int actual = configurationPoint.getContributions().size();

        if (expected.inRange(actual))
            return;

        _errorHandler.error(LOG, DefinitionMessages.wrongNumberOfContributions(
                definingModule, configurationPoint,
                actual,
View Full Code Here

TOP

Related Classes of org.apache.hivemind.definition.Occurances

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.