Examples of PluginListValue


Examples of org.apache.openjpa.lib.conf.PluginListValue

     * for individual Data Cache configuration.
     */
    public void setPartitions(String parts) {
        _partProperties.clear();
        parsePartitionProperties(parts);
        PluginListValue partitions = new PluginListValue("partitions");
        String[] types = (String[])Array.newInstance(String.class, _partProperties.size());
        Arrays.fill(types, _type.getName());
        partitions.setClassNames(types);
        partitions.setProperties(_partProperties.toArray(new String[_partProperties.size()]));
        DataCache[] array = (DataCache[])partitions.instantiate(_type, conf);
        for (DataCache part : array) {
            if (part.getName() == null)
                throw new UserException(_loc.get("partition-cache-null-partition", parts));
            if (_partitions.containsKey(part.getName()))
                throw new UserException(_loc.get("partition-cache-duplicate-partition", part.getName(), parts));
View Full Code Here

Examples of org.apache.openjpa.lib.conf.PluginListValue

    public void endConfiguration() {
    }
   
    public void setInstrument(String instrument) {
        _instrumentValues = new PluginListValue("Instrument");
        if (getInstrumentAliases() != null) {
            _instrumentValues.setAliases(getInstrumentAliases());
        }
        _instrumentValues.setString(instrument);
       
View Full Code Here

Examples of org.apache.openjpa.lib.conf.PluginListValue

    }

    public void testDefault() {
        defaultTest(new StringValue("testKey"));
        defaultTest(new PluginValue("testKey", true));
        defaultTest(new PluginListValue("testKey"));
        pluginDefaultTest(new PluginValue("testKey", true));
    }
View Full Code Here

Examples of org.apache.openjpa.lib.conf.PluginListValue

    }

    public void testAlias() {
        aliasTest(new StringValue("testKey"));
        aliasTest(new PluginValue("testKey", true));
        aliasTest(new PluginListValue("testKey"));
        emptyAliasTest(new StringValue("testKey"));
        emptyAliasTest(new StringValue("testKey"));
        pluginAliasTest(new PluginValue("testKey", true));
        pluginAliasTest(new PluginListValue("testKey"));
        pluginListAliasTest(new PluginListValue("testKey"));
    }
View Full Code Here

Examples of org.apache.openjpa.lib.conf.PluginListValue

        val.setString("none");
        assertTrue(((PluginListValue) val).getClassNames().length == 0);
    }

    public void testPluginListParsing() {
        PluginListValue val = new PluginListValue("testKey");
        assertEquals(0, val.getClassNames().length);
        val.setString("foo");
        assertEquals(1, val.getClassNames().length);
        assertEquals("foo", val.getClassNames()[0]);
        assertNull(val.getProperties()[0]);
        val.setString("foo()");
        assertEquals(1, val.getClassNames().length);
        assertEquals("foo", val.getClassNames()[0]);
        assertNull(val.getProperties()[0]);
        val.setString("foo(a=b)");
        assertEquals(1, val.getClassNames().length);
        assertEquals("foo", val.getClassNames()[0]);
        assertEquals("a=b", val.getProperties()[0]);
        val.setString("foo(a=b, c=\"d,e f\", g=\"h\")");
        assertEquals(1, val.getClassNames().length);
        assertEquals("foo", val.getClassNames()[0]);
        assertEquals("a=b, c=\"d,e f\", g=\"h\"", val.getProperties()[0]);
        val.setString("foo(a=b, c=\"d,e f\"), bar, biz(a=c, d=g), baz()");
        assertEquals(4, val.getClassNames().length);
        assertEquals("foo", val.getClassNames()[0]);
        assertEquals("a=b, c=\"d,e f\"", val.getProperties()[0]);
        assertEquals("bar", val.getClassNames()[1]);
        assertNull(val.getProperties()[1]);
        assertEquals("biz", val.getClassNames()[2]);
        assertEquals("a=c, d=g", val.getProperties()[2]);
        assertEquals("baz", val.getClassNames()[3]);
        assertNull(val.getProperties()[3]);
    }
View Full Code Here

Examples of org.apache.openjpa.lib.conf.PluginListValue

     * for individual Data Cache configuration.
     */
    public void setPartitions(String parts) {
        _partProperties.clear();
        parsePartitionProperties(parts);
        PluginListValue partitions = new PluginListValue("partitions");
        String[] types = (String[])Array.newInstance(String.class, _partProperties.size());
        Arrays.fill(types, _type.getName());
        partitions.setClassNames(types);
        partitions.setProperties(_partProperties.toArray(new String[_partProperties.size()]));
        DataCache[] array = (DataCache[])partitions.instantiate(_type, conf);
        for (DataCache part : array) {
            if (part.getName() == null)
                throw new UserException(_loc.get("partition-cache-null-partition", parts));
            if (_partitions.containsKey(part.getName()))
                throw new UserException(_loc.get("partition-cache-duplicate-partition", part.getName(), parts));
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.