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