use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class DiskRegionIllegalArguementsJUnitTest method testQueueSize.
@Test
public void testQueueSize() {
DiskStoreFactory dsf = cache.createDiskStoreFactory();
try {
dsf.setQueueSize(-1);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}
dsf.setQueueSize(1);
assertEquals(1, dsf.create("test").getQueueSize(), 1);
}
use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class DiskRegionIllegalArguementsJUnitTest method testDiskUsageCriticalPercentage.
@Test
public void testDiskUsageCriticalPercentage() {
DiskStoreFactory dsf = cache.createDiskStoreFactory();
try {
dsf.setDiskUsageCriticalPercentage(-1);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}
try {
dsf.setDiskUsageCriticalPercentage(101);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}
dsf.setDiskUsageCriticalPercentage(50);
assertEquals(50.0f, dsf.create("test").getDiskUsageCriticalPercentage(), 0.01);
}
use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class DiskRegionIllegalArguementsJUnitTest method testDiskDirSize.
@Test
public void testDiskDirSize() {
File file1 = new File("file1");
File file2 = new File("file2");
File file3 = new File("file3");
File file4 = new File("file4");
file1.mkdir();
file2.mkdir();
file3.mkdir();
file4.mkdir();
file1.deleteOnExit();
file2.deleteOnExit();
file3.deleteOnExit();
file4.deleteOnExit();
File[] dirs = { file1, file2, file3, file4 };
int[] ints = { 1, 2, 3, -4 };
DiskStoreFactory dsf = cache.createDiskStoreFactory();
try {
dsf.setDiskDirsAndSizes(dirs, ints);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException ok) {
}
int[] ints1 = { 1, 2, 3 };
try {
dsf.setDiskDirsAndSizes(dirs, ints1);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException ok) {
}
ints[3] = 4;
dsf.setDiskDirsAndSizes(dirs, ints);
}
use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class DiskRegionIllegalArguementsJUnitTest method testCompactionThreshold.
@Test
public void testCompactionThreshold() {
DiskStoreFactory dsf = cache.createDiskStoreFactory();
try {
dsf.setCompactionThreshold(-1);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}
try {
dsf.setCompactionThreshold(101);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}
dsf.setCompactionThreshold(0);
dsf.setCompactionThreshold(100);
assertEquals(100, dsf.create("test").getCompactionThreshold());
}
use of org.apache.geode.cache.DiskStoreFactory in project geode by apache.
the class DiskRegionIllegalArguementsJUnitTest method testDiskUsageWarningPercentage.
@Test
public void testDiskUsageWarningPercentage() {
DiskStoreFactory dsf = cache.createDiskStoreFactory();
try {
dsf.setDiskUsageWarningPercentage(-1);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}
try {
dsf.setDiskUsageWarningPercentage(101);
fail("expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
}
dsf.setDiskUsageWarningPercentage(50);
assertEquals(50.0f, dsf.create("test").getDiskUsageWarningPercentage(), 0.01);
}
Aggregations