Skip to content

Commit

Permalink
GoogleCloudPlatform#3381 - test case updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lak-proddev committed Jul 6, 2019
1 parent 8194366 commit 45c771d
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ public void testAddDependencies() throws Exception {
Bundle bundle = Platform.getBundle("com.google.cloud.tools.eclipse.appengine.libraries.test");
URL fileUrl = bundle.getEntry("/testdata/formatAdd.xml");
File expected = new File(FileLocator.resolve(fileUrl).toURI());
assertFileContentsEqual(pomFile.getLocation().toFile(), expected);

assertFileContentsEqual(expected, pomFile.getLocation().toFile());
}

@Test
Expand All @@ -103,10 +102,10 @@ public void testRemoveUnusedDependencies() throws Exception {
Bundle bundle = Platform.getBundle("com.google.cloud.tools.eclipse.appengine.libraries.test");
URL fileUrl = bundle.getEntry("/testdata/formatRemove.xml");
File expected = new File(FileLocator.resolve(fileUrl).toURI());
assertFileContentsEqual(pomFile.getLocation().toFile(), expected);
assertFileContentsEqual(expected, pomFile.getLocation().toFile());
}

private static void assertFileContentsEqual(File actual, File expected) throws IOException {
assertArrayEquals(Files.readAllBytes(actual.toPath()), Files.readAllBytes(expected.toPath()));
private static void assertFileContentsEqual(File expected, File actual) throws IOException {
assertArrayEquals(Files.readAllBytes(expected.toPath()), Files.readAllBytes(actual.toPath()));
}
}

0 comments on commit 45c771d

Please sign in to comment.