Examples of GbeanType


Examples of org.apache.geronimo.system.plugin.model.GbeanType

   
    public void testPropertyEditorIsNotDefinedForPrimitives() throws Exception {
        GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setAttribute(intInfo, 1, bundle);
       
        GbeanType copiedGBeanType = override.writeXml();
        assertEquals(1, copiedGBeanType.getAttributeOrReference().size());
        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertNull(attributeType.getPropertyEditor());
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

   
    public void testPropertyEditorIsNotDefinedForCollectionSubClasses() throws Exception {
        GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setAttribute(collectionInfo, Collections.singleton("test"), bundle);
       
        GbeanType copiedGBeanType = override.writeXml();
        assertEquals(1, copiedGBeanType.getAttributeOrReference().size());
        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertNull(attributeType.getPropertyEditor());
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

       
        override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setAttribute(gbeanInfo.getAttribute("bar1"), "foo", bundle);
        override.setAttribute(gbeanInfo.getAttribute("bar2"), "foo", bundle);
        override.getAttributes().put("foo", null);
        GbeanType gbean = override.writeXml();
        assertEquals(3, gbean.getAttributeOrReference().size());
        AttributeType attribute = (AttributeType)gbean.getAttributeOrReference().get(2);
        assertEquals("foo", attribute.getName());
        assertTrue(attribute.isNull());
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

                    "            </reference>\n" +
                    "        </gbean>";

    public void testReferenceXml() throws Exception {
        Reader in = new StringReader(REFERENCE_XML);
        GbeanType gbeanElement = AttributesXmlUtil.loadGbean(in);
        GBeanOverride gbean = new GBeanOverride(gbeanElement, expressionParser);
        assertCopyIdentical(gbean);
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

                    "            <attribute name=\"expression\">${host}</attribute>\n" +
                    "        </gbean>";

    public void testExpressionXml() throws Exception {
        Reader in = new StringReader(EXPRESSION_XML);
        GbeanType gbeanElement = AttributesXmlUtil.loadGbean(in);
        GBeanOverride gbean = new GBeanOverride(gbeanElement, expressionParser);
        assertCopyIdentical(gbean);
        GBeanData data = new GBeanData(MockGBean.GBEAN_INFO);
        gbean.setAttribute(portInfo, "${port}", bundle);
        gbean.applyOverrides(data, null, null, bundle);
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

    private GAttributeInfo fooInfo;
    private Bundle bundle = new MockBundle(getClass().getClassLoader(), null, 0L);

    @Override
    protected void setUp() throws Exception {
        gbeanType = new GbeanType();
        gbeanType.setName("name");
       
        attributeName = "bean";
        gbeanInfo = new AnnotationGBeanInfoFactory().getGBeanInfo(TestGBean.class);
        beanInfo = gbeanInfo.getAttribute(attributeName);
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

        attributeType.setName(attributeName);
        attributeType.getContent().add("value");
        attributeType.setPropertyEditor("myPropertyEditor");
       
        GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        GbeanType copiedGBeanType = override.writeXml();
        assertEquals(1, copiedGBeanType.getAttributeOrReference().size());
        AttributeType copiedAttributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertEquals(attributeType.getPropertyEditor(), copiedAttributeType.getPropertyEditor());
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

        GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setAttribute(beanInfo, new Bean(), bundle);
       
        assertEquals("bean", override.getAttribute(attributeName));
       
        GbeanType copiedGBeanType = override.writeXml();
        assertEquals(1, copiedGBeanType.getAttributeOrReference().size());
        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertEquals("bean", attributeType.getContent().get(0));
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

   
    public void testPropertyEditorIsDefinedWhenAttributeIsNotAPrimitiveAndItsTypeDoesNotEqualValueType() throws Exception {
        GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setAttribute(serviceInfo, new Bean(), bundle);
       
        GbeanType copiedGBeanType = override.writeXml();
        assertEquals(1, copiedGBeanType.getAttributeOrReference().size());
        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertEquals(BeanEditor.class.getName(), attributeType.getPropertyEditor());
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.model.GbeanType

   
    public void testPropertyEditorIsNotDefinedWhenAttributeTypeEqualsValueType() throws Exception {
        GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setAttribute(beanInfo, new Bean(), bundle);
       
        GbeanType copiedGBeanType = override.writeXml();
        assertEquals(1, copiedGBeanType.getAttributeOrReference().size());
        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertNull(attributeType.getPropertyEditor());
    }
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.