Examples of JexlExpressionParser


Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

                    "    <ns2:module name=\"org.apache.geronimo.plugins/plancreator-jetty/2.1-SNAPSHOT/car\"/>\n" +
                    "</ns2:attributes>\n";
   
    public void testReadWrite() throws Exception {
        Reader reader = new StringReader(CONFIG);
        JexlExpressionParser parser = new JexlExpressionParser();
        ServerOverride serverOverride = LocalAttributeManager.read(reader, parser);
        StringWriter writer = new StringWriter();
        LocalAttributeManager.write(serverOverride, writer);
        String result = writer.toString();
       
View Full Code Here

Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

        gbeanType.getAttributeOrReference().add(attributeType);
        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.configuration.condition.JexlExpressionParser

        AttributeType copiedAttributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertEquals(attributeType.getPropertyEditor(), copiedAttributeType.getPropertyEditor());
    }
   
    public void testPropertyEditorIsUsedToGetTextValue() throws Exception {
        GBeanOverride override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setAttribute(beanInfo, new Bean(), bundle);
       
        assertEquals("bean", override.getAttribute(attributeName));
       
        GbeanType copiedGBeanType = override.writeXml();
View Full Code Here

Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertEquals("bean", attributeType.getContent().get(0));
    }
   
    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);
View Full Code Here

Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertEquals(BeanEditor.class.getName(), attributeType.getPropertyEditor());
    }
   
    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);
View Full Code Here

Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertNull(attributeType.getPropertyEditor());
    }
   
    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);
View Full Code Here

Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

        AttributeType attributeType = (AttributeType) copiedGBeanType.getAttributeOrReference().get(0);
        assertNull(attributeType.getPropertyEditor());
    }
   
    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);
View Full Code Here

Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

    }
   
    public void testReferences() throws Exception {
        GBeanOverride override;
       
        override = new GBeanOverride(gbeanType, new JexlExpressionParser());       
        override.setClearReference("foo");
        override.setReferencePatterns("foo", new ReferencePatterns(new AbstractName(new URI("/foo/bar/car?foo=bar"))));
        override.writeXml();
       
        assertFalse(override.isClearReference("foo"));
        assertFalse(override.getClearReferences().contains("foo"));       
        assertTrue(override.getReferencePatterns("foo") != null);
        assertTrue(override.getReferences().containsKey("foo"));
       
        override = new GBeanOverride(gbeanType, new JexlExpressionParser());  
        override.setReferencePatterns("foo", new ReferencePatterns(new AbstractName(new URI("/foo/bar/car?foo=bar"))));       
        override.setClearReference("foo");
        override.writeXml();
       
        assertTrue(override.isClearReference("foo"));
View Full Code Here

Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

    }
   
    public void testAttributes() throws Exception {
        GBeanOverride override;
       
        override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setNullAttribute("foo");
        override.setClearAttribute("foo");
        override.setAttribute(fooInfo, "bar", bundle);
        override.writeXml();
       
        assertFalse(override.isNullAttribute("foo"));
        assertFalse(override.getNullAttributes().contains("foo"));   
        assertFalse(override.isClearAttribute("foo"));
        assertFalse(override.getClearAttributes().contains("foo"))
        assertTrue(override.getAttribute("foo") != null);
        assertTrue(override.getAttributes().containsKey("foo"));
           
        override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setAttribute(fooInfo, "bar", bundle);
        override.setNullAttribute("foo");
        override.setClearAttribute("foo");
        override.writeXml();
       
        assertFalse(override.isNullAttribute("foo"));
        assertFalse(override.getNullAttributes().contains("foo"));   
        assertFalse(override.getAttribute("foo") != null);
        assertFalse(override.getAttributes().containsKey("foo"));       
        assertTrue(override.isClearAttribute("foo"));
        assertTrue(override.getClearAttributes().contains("foo"))
       
        override = new GBeanOverride(gbeanType, new JexlExpressionParser());
        override.setClearAttribute("foo");
        override.setAttribute(fooInfo, "bar", bundle);
        override.setNullAttribute("foo");
        override.writeXml();
           
        assertFalse(override.getAttribute("foo") != null);
        assertFalse(override.getAttributes().containsKey("foo"));       
        assertFalse(override.isClearAttribute("foo"));
        assertFalse(override.getClearAttributes().contains("foo"));        
        assertTrue(override.isNullAttribute("foo"));
        assertTrue(override.getNullAttributes().contains("foo"));
       
        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());
View Full Code Here

Examples of org.apache.geronimo.system.configuration.condition.JexlExpressionParser

        resolvedPropertiesFile = System.getProperty(SUBSTITUTIONS_FILE_PROPERTY, configSubstitutionsFileName);
        configSubstitutionsFile = resolvedPropertiesFile == null? null: serverInfo.resolveServer(resolvedPropertiesFile);
        localConfigSubstitutions = loadConfigSubstitutions(configSubstitutionsFile);
        prefix = System.getProperty(SUBSTITUTION_PREFIX_PREFIX, configSubstitutionsPrefix);
        Map<String, Object> configSubstitutions = loadAllConfigSubstitutions(localConfigSubstitutions, prefix);
        expressionParser = new JexlExpressionParser(configSubstitutions);
        this.readOnly = readOnly;
        this.serverInfo = serverInfo;
        serverOverride = new ServerOverride();
        log.debug("setting configSubstitutionsFile to " + configSubstitutionsFile + ".");
    }
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.