Package org.apache.openjpa.datacache

Examples of org.apache.openjpa.datacache.PartitionedDataCache


        "openjpa.DataCacheManager",
        "DistributionPolicy=org.apache.openjpa.persistence.datacache.TestPartitionedDataCache$TestPolicy");
    }
   
    public void testPropertyParsing() {
        PartitionedDataCache cache = new PartitionedDataCache();
        String badProperty = "(name=a,cacheSize=100),(name=b,cacheSize=200";// missing last bracket
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
        badProperty = "(name=a,cacheSize=100)(name=b,cacheSize=200)";// missing comma
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
        badProperty = "(cacheSize=100),(name=b,cacheSize=200)";// missing name
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
        badProperty = "(name=a,cacheSize=100),(name=a,cacheSize=200)";// duplicate name
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
        badProperty = "(name=default,cacheSize=100),(name=a,cacheSize=200)";// default name
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
       
View Full Code Here


        "openjpa.CacheDistributionPolicy",
        "org.apache.openjpa.persistence.datacache.TestPartitionedDataCache$TestPolicy");
    }
   
    public void testPropertyParsing() {
        PartitionedDataCache cache = new PartitionedDataCache();
        String badProperty = "(name=a,cacheSize=100),(name=b,cacheSize=200";// missing last bracket
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
        badProperty = "(name=a,cacheSize=100)(name=b,cacheSize=200)";// missing comma
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
        badProperty = "(cacheSize=100),(name=b,cacheSize=200)";// missing name
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
        badProperty = "(name=a,cacheSize=100),(name=a,cacheSize=200)";// duplicate name
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
        badProperty = "(name=default,cacheSize=100),(name=a,cacheSize=200)";// default name
        try {
            cache.setPartitions(badProperty);
            fail("Expected parse error on " + badProperty);
        } catch (UserException e) {
            System.err.println(e);
        }
       
View Full Code Here

TOP

Related Classes of org.apache.openjpa.datacache.PartitionedDataCache

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.