コード例 #1
0
	public void testConfigureCache_PackedGitLimit_0() {
		try {
			final WindowCacheConfig cfg = new WindowCacheConfig();
			cfg.setPackedGitLimit(0);
			WindowCache.reconfigure(cfg);
			fail("incorrectly permitted PackedGitLimit = 0");
		} catch (IllegalArgumentException e) {
			//
		}
	}
コード例 #2
0
	public void testConfigureCache_Limits1() {
		// This test is just to force coverage over some lower bounds for
		// the table. We don't want the table to wind up with too small
		// of a size. This is highly dependent upon the table allocation
		// algorithm actually implemented in WindowCache.
		//
		final WindowCacheConfig cfg = new WindowCacheConfig();
		cfg.setPackedGitLimit(6 * 4096 / 5);
		cfg.setPackedGitWindowSize(4096);
		WindowCache.reconfigure(cfg);
	}
コード例 #3
0
	public void testConfigureCache_PackedGitWindowSizeAbovePackedGitLimit() {
		try {
			final WindowCacheConfig cfg = new WindowCacheConfig();
			cfg.setPackedGitLimit(1024);
			cfg.setPackedGitWindowSize(8192);
			WindowCache.reconfigure(cfg);
			fail("incorrectly permitted PackedGitWindowSize > PackedGitLimit");
		} catch (IllegalArgumentException e) {
			assertEquals("Window size must be < limit", e.getMessage());
		}
	}