assertEquals("[module]/ivys/ivy-[revision].xml", settings.getDefaultCacheIvyPattern());
assertEquals("[module]/[type]s/[artifact]-[revision].[ext]",
settings.getDefaultCacheArtifactPattern());
assertEquals(true, settings.isDefaultUseOrigin());
DefaultRepositoryCacheManager c = (DefaultRepositoryCacheManager) settings
.getRepositoryCacheManager("mycache");
assertNotNull(c);
assertEquals("mycache", c.getName());
assertEquals(1000, c.getDefaultTTL());
assertEquals(200,
c.getTTL(ModuleRevisionId.newInstance("apache", "ivy", "latest.integration")));
assertEquals(10 * 60 * 1000 + 20 * 1000, // 10m 20s
c.getTTL(ModuleRevisionId.newInstance("org1", "A", "A")));
assertEquals(5 * 3600 * 1000, // 5h
c.getTTL(ModuleRevisionId.newInstance("org2", "A", "A")));
assertEquals(60 * 3600 * 1000, // 2d 12h = 60h
c.getTTL(ModuleRevisionId.newInstance("org3", "A", "A")));
assertEquals(new File("mycache").getCanonicalFile(), c.getBasedir().getCanonicalFile());
assertEquals(false, c.isUseOrigin());
assertEquals("no-lock", c.getLockStrategy().getName());
assertEquals("[module]/ivy-[revision].xml", c.getIvyPattern());
assertEquals("[module]/[artifact]-[revision].[ext]", c.getArtifactPattern());
DefaultRepositoryCacheManager c2 = (DefaultRepositoryCacheManager) settings
.getRepositoryCacheManager("mycache2");
assertNotNull(c2);
assertEquals("mycache2", c2.getName());
assertEquals(new File("repository").getCanonicalFile(), c2.getBasedir().getCanonicalFile());
assertEquals("artifact-lock", c2.getLockStrategy().getName());
assertEquals("[module]/ivys/ivy-[revision].xml", c2.getIvyPattern());
assertEquals("[module]/[type]s/[artifact]-[revision].[ext]", c2.getArtifactPattern());
assertEquals(true, c2.isUseOrigin());
assertEquals(c2, settings.getResolver("A").getRepositoryCacheManager());
assertEquals(c, settings.getResolver("B").getRepositoryCacheManager());
}