"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);
}