public void testParse_recordStatsRepeated() { try { parse("recordStats,recordStats"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_repeatedKeyStrength() { try { parse("weakKeys, weakKeys"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_writeExpirationRepeated() { try { parse( "expireAfterWrite=10s,expireAfterWrite=10m"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_maximumWeightRepeated() { try { parse("maximumWeight=10, maximumWeight=20"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_weakValuesCannotHaveValue() { try { parse("weakValues=true"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_recordStatsValueSpecified() { try { parse("recordStats=True"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_maximumSizeRepeated() { try { parse("maximumSize=10, maximumSize=20"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_weakKeysCannotHaveValue() { try { parse("weakKeys=true"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_softValuesCannotHaveValue() { try { parse("softValues=true"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_unknownKey() { try { parse("foo=17"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_initialCapacityRepeated() { try { parse("initialCapacity=10, initialCapacity=20"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_maximumSizeAndMaximumWeight() { try { parse("maximumSize=10, maximumWeight=20"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_accessExpirationRepeated() { try { parse( "expireAfterAccess=10s,expireAfterAccess=10m"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void disabled_testParse_extraCommaIsInvalid() { try { parse("weakKeys,"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } try { parse(",weakKeys"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } try { parse("weakKeys,,softValues"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testParse_repeatedValueStrength() { try { parse("softValues, softValues"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } try { parse("softValues, weakValues"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } try { parse("weakValues, softValues"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } try { parse("weakValues, weakValues"); fail("Expected exception"); } catch (IllegalArgumentException expected) { // expected } }
public void testMaximumWeight_withoutWeigher() { Caffeine<Object, Object> builder = Caffeine.from(parse("maximumWeight=9000")); try { builder.build(k -> null); fail(); } catch (IllegalStateException expected) {} }