/** Test of fromPackageToFile method, of class PackageScanner. */ @Test public void testFromPackageToFile() { System.out.println("fromPackageToFile"); File expResult = null; try { PackageScanner.fromPackageToFile(wrongPackage); fail("Result is supposed to null"); } catch (NullPointerException ex) { } URL url = fromPackageToUrl(correctPackage); expResult = new File(url.getPath()); File result = PackageScanner.fromPackageToFile(correctPackage); assertEquals(expResult.getAbsolutePath(), result.getAbsolutePath()); }
/** Test of listFiles method, of class PackageScanner. */ @Test public void testListFiles_String_FilenameFilter() { System.out.println("listFiles"); FilenameFilter filter = new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(".yawl"); } }; File[] result = PackageScanner.listFiles(correctPackage + ".specs", filter); assertNotNull(result); for (File file : result) { assertTrue(file.getName().endsWith(".yawl")); } }