Examples of ElementModelImpl


Examples of org.apache.hivemind.schema.impl.ElementModelImpl

    public void testGetContentTranslator()
    {
        MockControl control = newControl(Module.class);
        Module m = (Module) control.getMock();

        ElementModelImpl em = new ElementModelImpl();

        em.setElementName("fred");
        em.setContentTranslator("smart");

        em.addRule(new CreateObjectRule(StringHolderImpl.class.getName()));

        ReadContentRule rule = new ReadContentRule();
        rule.setPropertyName("value");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl();
        schema.addElementModel(em);
        schema.setModule(m);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

    public void testGetContentTranslatorUnspecified()
    {
        MockControl control = newControl(Module.class);
        Module m = (Module) control.getMock();

        ElementModelImpl em = new ElementModelImpl();

        em.setElementName("fred");
        // No content handler specified

        em.addRule(new CreateObjectRule(StringHolderImpl.class.getName()));

        ReadContentRule rule = new ReadContentRule();
        rule.setPropertyName("value");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl();
        schema.addElementModel(em);
        schema.setModule(m);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

    public void testGetAttributeTranslator()
    {
        MockControl control = newControl(Module.class);
        Module m = (Module) control.getMock();

        ElementModelImpl em = new ElementModelImpl();

        AttributeModelImpl am = new AttributeModelImpl();
        am.setName("wife");
        am.setTranslator("service");

        em.setElementName("fred");
        em.addAttributeModel(am);

        em.addRule(new CreateObjectRule(StringHolderImpl.class.getName()));

        ReadAttributeRule rule = new ReadAttributeRule();
        rule.setPropertyName("value");
        rule.setAttributeName("wife");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl();
        schema.addElementModel(em);
        schema.setModule(m);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

    }

    public void testKeyedElement()
    {
        ElementModelImpl em = new ElementModelImpl();

        em.setElementName("cartoon");
        em.setKeyAttribute("name");

        AttributeModelImpl am = new AttributeModelImpl();
        am.setName("name");
        am.setTranslator("cartoon");

        em.addAttributeModel(am);

        em.addRule(new CreateObjectRule("StringHolderImpl"));

        ReadContentRule rule = new ReadContentRule();
        rule.setPropertyName("value");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl();
        schema.addElementModel(em);

        MockControl control = newControl(Module.class);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

     * is marked unique and is translated by translator 'qualified-id'. Both contributed elements
     * use same untranslated value in the unique attribute. Fixes HIVEMIND-100.
     */
    public void testUniqueElement()
    {
        ElementModelImpl em = new ElementModelImpl();

        em.setElementName("cartoon");

        AttributeModelImpl am = new AttributeModelImpl();
        am.setName("name");
        am.setTranslator("qualified-id");
        am.setUnique(true);

        em.addAttributeModel(am);

        em.addRule(new CreateObjectRule("StringHolderImpl"));

        ReadAttributeRule rule = new ReadAttributeRule();
        rule.setAttributeName("name");
        rule.setPropertyName("value");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl();
        schema.addElementModel(em);

        MockControl control1 = newControl(Module.class);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

        TranslatorManager tm = (TranslatorManager) tmControl.getMock();

        MockControl symbolExpanderControl = newControl(SymbolExpander.class);
        SymbolExpander symbolExpander = (SymbolExpander) symbolExpanderControl.getMock();

        ElementModelImpl em = new ElementModelImpl("module");

        em.setElementName("fred");
        em.setContentTranslator("smart");

        em.addRule(new CreateObjectRule(StringHolderImpl.class.getName()));

        ReadContentRule rule = new ReadContentRule();
        rule.setPropertyName("value");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl("module");
        schema.addElementModel(em);

        SchemaProcessorImpl p = new SchemaProcessorImpl(null, schema);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();

        MockControl symbolExpanderControl = newControl(SymbolExpander.class);
        SymbolExpander symbolExpander = (SymbolExpander) symbolExpanderControl.getMock();

        ElementModelImpl em = new ElementModelImpl("module");

        em.setElementName("fred");
        // No content handler specified

        em.addRule(new CreateObjectRule(StringHolderImpl.class.getName()));

        ReadContentRule rule = new ReadContentRule();
        rule.setPropertyName("value");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl("module");
        schema.addElementModel(em);

        SchemaProcessorImpl p = new SchemaProcessorImpl(null, schema);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

        TranslatorManager tm = (TranslatorManager) tmControl.getMock();

        MockControl symbolExpanderControl = newControl(SymbolExpander.class);
        SymbolExpander symbolExpander = (SymbolExpander) symbolExpanderControl.getMock();

        ElementModelImpl em = new ElementModelImpl("module");

        AttributeModelImpl am = new AttributeModelImpl();
        am.setName("wife");
        am.setTranslator("service");

        em.setElementName("fred");
        em.addAttributeModel(am);

        em.addRule(new CreateObjectRule(StringHolderImpl.class.getName()));

        ReadAttributeRule rule = new ReadAttributeRule();
        rule.setPropertyName("value");
        rule.setAttributeName("wife");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl("module");
        schema.addElementModel(em);

        SchemaProcessorImpl p = new SchemaProcessorImpl(null, schema);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

    }

    public void testKeyedElement()
    {
        ElementModelImpl em = new ElementModelImpl("module");
       
        MockControl tmControl = newControl(TranslatorManager.class);
        TranslatorManager tm = (TranslatorManager) tmControl.getMock();
       
        MockControl registryControl = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();

        MockControl symbolExpanderControl = newControl(SymbolExpander.class);
        SymbolExpander symbolExpander = (SymbolExpander) symbolExpanderControl.getMock();

        em.setElementName("cartoon");
        em.setKeyAttribute("name");

        AttributeModelImpl am = new AttributeModelImpl();
        am.setName("name");
        am.setTranslator("cartoon");

        em.addAttributeModel(am);
       
        em.addRule(new CreateObjectRule("StringHolderImpl"));
       
        ReadContentRule rule = new ReadContentRule();
        rule.setPropertyName("value");

        em.addRule(rule);
       
        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl("module");
        schema.addElementModel(em);

        MockControl control = newControl(Module.class);
View Full Code Here

Examples of org.apache.hivemind.schema.impl.ElementModelImpl

     * is marked unique and is translated by translator 'qualified-id'. Both contributed elements
     * use same untranslated value in the unique attribute. Fixes HIVEMIND-100.
     */
    public void testUniqueElement()
    {
        ElementModelImpl em = new ElementModelImpl("module");

        em.setElementName("cartoon");

        AttributeModelImpl am = new AttributeModelImpl();
        am.setName("name");
        am.setTranslator("qualified-id");
        am.setUnique(true);

        em.addAttributeModel(am);

        em.addRule(new CreateObjectRule("StringHolderImpl"));

        ReadAttributeRule rule = new ReadAttributeRule();
        rule.setAttributeName("name");
        rule.setPropertyName("value");

        em.addRule(rule);

        em.addRule(new InvokeParentRule("addElement"));

        SchemaImpl schema = new SchemaImpl("module");
        schema.addElementModel(em);

        MockControl control1 = newControl(Module.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.