Platform { public Platform(ID id, int bitCount) { this.id = id; this.bitCount = bitCount; this.sourcePathPrefix = getSourcePathPrefix(id, bitCount); } Platform(ID id, int bitCount); ID getId(); int getBitCount(); boolean isPlatformDir(String entryName); String truncatePlatformDir(String entryName); static boolean isAnyPlatformDir(String entryName); static Platform getCurrentPlatform();  }
@Test public void testPlatform() throws Exception { Platform win64 = new Platform(Platform.ID.win, 64); assertEquals(Platform.ID.win, win64.getId()); assertEquals(64, win64.getBitCount()); assertTrue(win64.isPlatformDir("lib/win64/test.dll")); assertFalse(win64.isPlatformDir("lib/win32/test.dll")); assertFalse(win64.isPlatformDir("lib/unix64/test.dll")); assertEquals("lib/test.dll", win64.truncatePlatformDir("lib/win64/test.dll")); assertEquals("lib/linux64/test.so", win64.truncatePlatformDir("lib/linux64/test.so")); }