Cache c = new OsCache(null);
assertEquals("oscache", c.getType());
}
public void testUnsupported() {
Cache c = new OsCache(null);
try {
c.size();
fail("UnsupportedOperationException should have been thrown.");
} catch (UnsupportedOperationException ex) {
assertEquals("size()", ex.getMessage());
} catch (Throwable t) {
fail("UnsupportedOperationException should have been thrown.");
}
try {
c.isEmpty();
fail("UnsupportedOperationException should have been thrown.");
} catch (UnsupportedOperationException ex) {
assertEquals("isEmpty()", ex.getMessage());
} catch (Throwable t) {
fail("UnsupportedOperationException should have been thrown.");
}
try {
c.containsValue("test");
fail("UnsupportedOperationException should have been thrown.");
} catch (UnsupportedOperationException ex) {
assertEquals("containsValue(Object)", ex.getMessage());
} catch (Throwable t) {
fail("UnsupportedOperationException should have been thrown.");
}
try {
c.keySet();
fail("UnsupportedOperationException should have been thrown.");
} catch (UnsupportedOperationException ex) {
assertEquals("keySet()", ex.getMessage());
} catch (Throwable t) {
fail("UnsupportedOperationException should have been thrown.");
}
try {
c.values();
fail("UnsupportedOperationException should have been thrown.");
} catch (UnsupportedOperationException ex) {
assertEquals("values()", ex.getMessage());
} catch (Throwable t) {
fail("UnsupportedOperationException should have been thrown.");
}
try {
c.entrySet();
fail("UnsupportedOperationException should have been thrown.");
} catch (UnsupportedOperationException ex) {
assertEquals("entrySet()", ex.getMessage());
} catch (Throwable t) {
fail("UnsupportedOperationException should have been thrown.");