From 5d028af44b2bf71e2bfe420d5cec07ee1656dcb1 Mon Sep 17 00:00:00 2001 From: Lakshminarayana Nekkanti Date: Thu, 27 Jun 2019 21:40:51 +0530 Subject: [PATCH 1/6] Better indentation when adding GCP libraries to pom.xml #3381 Change-Id: I5d4a22b089f1516845e8597cf11c5198772dc4dd --- .../eclipse/appengine/libraries/Pom.java | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries/src/com/google/cloud/tools/eclipse/appengine/libraries/Pom.java b/plugins/com.google.cloud.tools.eclipse.appengine.libraries/src/com/google/cloud/tools/eclipse/appengine/libraries/Pom.java index cb11ac82b3..2f98f7c53c 100644 --- a/plugins/com.google.cloud.tools.eclipse.appengine.libraries/src/com/google/cloud/tools/eclipse/appengine/libraries/Pom.java +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries/src/com/google/cloud/tools/eclipse/appengine/libraries/Pom.java @@ -234,7 +234,7 @@ void updateDependencies(Collection selectedLibraries, dependency.appendChild(artifactIdElement); if (testComment == null) { - dependencies.appendChild(dependency); + addChild(dependencies, dependency); } else { dependencies.insertBefore(dependency, testComment); } @@ -279,7 +279,7 @@ private void handleDependencyManaged(LibraryFile artifact, Element dependency) { } } else { if (versionNode != null) { - dependency.removeChild(versionNode); + removeChild(dependency, versionNode); } } } @@ -305,8 +305,8 @@ private void createBOMIfNeeded(XPath xpath) throws CoreException { dependencyManagement = document.createElementNS("http://maven.apache.org/POM/4.0.0", "dependencyManagement"); } - dependencyManagement.appendChild(dependencies); - document.getDocumentElement().appendChild(dependencyManagement); + addChild(dependencyManagement, dependencies); + addChild(document.getDocumentElement(), dependencyManagement); } Element dependency = @@ -321,7 +321,7 @@ private void createBOMIfNeeded(XPath xpath) throws CoreException { if (bom != null) { boms.add(bom); } - dependencies.appendChild(dependency); + addChild(dependencies, dependency); } } catch (XPathExpressionException ex) { IStatus status = StatusUtil.error(Pom.class, ex.getMessage(), ex); @@ -444,7 +444,7 @@ static void removeUnusedDependencies(Element dependencies, } for (Node node : nodesToRemove) { - dependencies.removeChild(node); + removeChild(dependencies, node); } } @@ -482,10 +482,29 @@ private static String getValue(Element dependency, String childName) { private void writeDocument() throws CoreException, TransformerException { Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount","2"); //$NON-NLS-1$ //$NON-NLS-2$ ByteArrayOutputStream out = new ByteArrayOutputStream(); transformer.transform(new DOMSource(document), new StreamResult(out)); InputStream in = new ByteArrayInputStream(out.toByteArray()); pomFile.setContents(in, true, true, null); } + + private void addChild(Node parent, Node newChild) { + parent.appendChild(newChild); + removeWhiteSpaceBefore(newChild);// for child indentation + } + + private static void removeChild(Node parent, Node oldChild) { + removeWhiteSpaceBefore(oldChild); + parent.removeChild(oldChild); + } + + private static void removeWhiteSpaceBefore(Node node) { + Node prevElement = node.getPreviousSibling(); + if (prevElement != null && prevElement.getNodeType() == Node.TEXT_NODE + && prevElement.getNodeValue().trim().length() == 0) { + node.getParentNode().removeChild(prevElement); + } + } } From 5f5682358ad2e1bfa76d104244c09b2d7e5e2dd8 Mon Sep 17 00:00:00 2001 From: Lakshminarayana Nekkanti Date: Sat, 6 Jul 2019 18:31:46 +0530 Subject: [PATCH 2/6] #3381 - test case added --- .../appengine/libraries/POMFormatTest.java | 134 ++++++++++++++++++ .../eclipse/appengine/libraries/PomTest.java | 6 +- .../testdata/formatAdd.xml | 33 +++++ .../testdata/formatRemove.xml | 24 ++++ .../testdata/testPomEmpty.xml | 6 + 5 files changed, 200 insertions(+), 3 deletions(-) create mode 100644 plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/POMFormatTest.java create mode 100644 plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/formatAdd.xml create mode 100644 plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/formatRemove.xml create mode 100644 plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/testPomEmpty.xml diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/POMFormatTest.java b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/POMFormatTest.java new file mode 100644 index 0000000000..956f30fad6 --- /dev/null +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/POMFormatTest.java @@ -0,0 +1,134 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.tools.eclipse.appengine.libraries; + +import static org.junit.Assert.fail; + +import com.google.cloud.tools.eclipse.appengine.libraries.model.Library; +import com.google.cloud.tools.eclipse.appengine.libraries.model.LibraryFile; +import com.google.cloud.tools.eclipse.test.util.project.TestProjectCreator; +import com.google.cloud.tools.eclipse.util.ArtifactRetriever; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Platform; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.osgi.framework.Bundle; +import org.xml.sax.SAXException; + +public class POMFormatTest { + + @Rule + public final TestProjectCreator projectCreator = new TestProjectCreator(); + private Pom pom; + private IFile pomFile; + + @Before + public void setUp() throws SAXException, IOException, CoreException { + IProject project = projectCreator.getProject(); + pomFile = project.getFile("pom.xml"); + try (InputStream in = + Files.newInputStream(Paths.get("testdata/testPomEmpty.xml").toAbsolutePath())) { + pomFile.create(in, IFile.FORCE, null); + pom = Pom.parse(pomFile); + } + + Logger logger = Logger.getLogger(ArtifactRetriever.class.getName()); + logger.setLevel(Level.OFF); + } + + + @Test + public void testAddDependencies() throws Exception { + Library library0 = PomTest.newLibrary("id0", + new LibraryFile(PomTest.coordinates("com.example.group0", "artifact0", "1.2.3"))); + Library library1 = PomTest.newLibrary("id1", + new LibraryFile(PomTest.coordinates("com.example.group1", "artifact1"))); + Library library2 = PomTest.newLibrary("id2", + new LibraryFile(PomTest.coordinates("com.example.group2", "artifact2")), + new LibraryFile(PomTest.coordinates("com.example.group3", "artifact3"))); + + List libraries = Arrays.asList(library0, library1, library2); + pom.addDependencies(libraries); + + 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); + + } + + @Test + public void testRemoveUnusedDependencies() throws Exception { + LibraryFile file1 = new LibraryFile(PomTest.coordinates("com.example.group1", "artifact1")); + LibraryFile file2 = new LibraryFile(PomTest.coordinates("com.example.group2", "artifact2")); + Library library1 = PomTest.newLibrary("id1", file1); + Library library2 = PomTest.newLibrary("id2", file1, file2); + + pom.addDependencies(Arrays.asList(library1, library2)); + + 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); + } + + public static void assertFileContentsEqual(File actual, File expected) throws IOException { + boolean areEqual = true; + try (BufferedReader reader1 = new BufferedReader(new FileReader(actual)); + BufferedReader reader2 = new BufferedReader(new FileReader(expected));) { + String line1 = reader1.readLine(); + String line2 = reader2.readLine(); + + int lineNum = 1; + + while (line1 != null || line2 != null) { + if (line1 == null || line2 == null) { + areEqual = false; + break; + } else if (!line1.equalsIgnoreCase(line2)) { + areEqual = false; + break; + } + line1 = reader1.readLine(); + line2 = reader2.readLine(); + lineNum++; + } + if (!areEqual) { + String message = "Two files have different content. They differ at line " + lineNum + " \"" + + actual.getName() + "\" has " + line1 + " and \"" + expected.getName() + "\" has " + + line2 + " at line " + lineNum + "\n"; + fail(message); + } + } + } +} diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomTest.java b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomTest.java index c0acc349cb..1cc1c3dc7c 100644 --- a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomTest.java +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomTest.java @@ -373,17 +373,17 @@ private static Element getOnlyChild(Element element, String name) { return (Element) children.item(0); } - private static Library newLibrary(String libraryId, LibraryFile... libraryFiles) { + static Library newLibrary(String libraryId, LibraryFile... libraryFiles) { Library library = new Library(libraryId); library.setLibraryFiles(Arrays.asList(libraryFiles)); return library; } - private static MavenCoordinates coordinates(String groupId, String artifactId) { + static MavenCoordinates coordinates(String groupId, String artifactId) { return new MavenCoordinates.Builder().setGroupId(groupId).setArtifactId(artifactId).build(); } - private static MavenCoordinates coordinates(String groupId, String artifactId, String version) { + static MavenCoordinates coordinates(String groupId, String artifactId, String version) { return new MavenCoordinates.Builder().setGroupId(groupId).setArtifactId(artifactId) .setVersion(version).build(); } diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/formatAdd.xml b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/formatAdd.xml new file mode 100644 index 0000000000..c126a31a2e --- /dev/null +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/formatAdd.xml @@ -0,0 +1,33 @@ + + + + + + com.google.cloud + google-cloud-bom + pom + import + 0.99.0-alpha + + + + + + com.example.group0 + artifact0 + 1.2.3 + + + com.example.group1 + artifact1 + + + com.example.group2 + artifact2 + + + com.example.group3 + artifact3 + + + diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/formatRemove.xml b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/formatRemove.xml new file mode 100644 index 0000000000..372a77ef84 --- /dev/null +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/formatRemove.xml @@ -0,0 +1,24 @@ + + + + + + com.google.cloud + google-cloud-bom + pom + import + 0.99.0-alpha + + + + + + com.example.group1 + artifact1 + + + com.example.group2 + artifact2 + + + diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/testPomEmpty.xml b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/testPomEmpty.xml new file mode 100644 index 0000000000..546e0fd8dd --- /dev/null +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/testdata/testPomEmpty.xml @@ -0,0 +1,6 @@ + + + From 81943666ba2742a95b4e1d16dd226874d705b24e Mon Sep 17 00:00:00 2001 From: Lakshminarayana Nekkanti Date: Sat, 6 Jul 2019 20:10:21 +0530 Subject: [PATCH 3/6] #3381 - test case updated --- ...{POMFormatTest.java => PomFormatTest.java} | 50 ++++++------------- 1 file changed, 14 insertions(+), 36 deletions(-) rename plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/{POMFormatTest.java => PomFormatTest.java} (72%) diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/POMFormatTest.java b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java similarity index 72% rename from plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/POMFormatTest.java rename to plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java index 956f30fad6..968b679369 100644 --- a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/POMFormatTest.java +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java @@ -16,15 +16,13 @@ package com.google.cloud.tools.eclipse.appengine.libraries; -import static org.junit.Assert.fail; +import static org.junit.Assert.assertArrayEquals; import com.google.cloud.tools.eclipse.appengine.libraries.model.Library; import com.google.cloud.tools.eclipse.appengine.libraries.model.LibraryFile; import com.google.cloud.tools.eclipse.test.util.project.TestProjectCreator; import com.google.cloud.tools.eclipse.util.ArtifactRetriever; -import java.io.BufferedReader; import java.io.File; -import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -39,13 +37,14 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Platform; +import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.osgi.framework.Bundle; import org.xml.sax.SAXException; -public class POMFormatTest { +public class PomFormatTest { @Rule public final TestProjectCreator projectCreator = new TestProjectCreator(); @@ -66,6 +65,11 @@ public void setUp() throws SAXException, IOException, CoreException { logger.setLevel(Level.OFF); } + @After + public void tearDown() { + Logger logger = Logger.getLogger(ArtifactRetriever.class.getName()); + logger.setLevel(null); + } @Test public void testAddDependencies() throws Exception { @@ -81,8 +85,8 @@ public void testAddDependencies() throws Exception { pom.addDependencies(libraries); 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()); + URL fileUrl = bundle.getEntry("/testdata/formatAdd.xml"); + File expected = new File(FileLocator.resolve(fileUrl).toURI()); assertFileContentsEqual(pomFile.getLocation().toFile(), expected); } @@ -97,38 +101,12 @@ public void testRemoveUnusedDependencies() throws Exception { pom.addDependencies(Arrays.asList(library1, library2)); 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()); + URL fileUrl = bundle.getEntry("/testdata/formatRemove.xml"); + File expected = new File(FileLocator.resolve(fileUrl).toURI()); assertFileContentsEqual(pomFile.getLocation().toFile(), expected); } - public static void assertFileContentsEqual(File actual, File expected) throws IOException { - boolean areEqual = true; - try (BufferedReader reader1 = new BufferedReader(new FileReader(actual)); - BufferedReader reader2 = new BufferedReader(new FileReader(expected));) { - String line1 = reader1.readLine(); - String line2 = reader2.readLine(); - - int lineNum = 1; - - while (line1 != null || line2 != null) { - if (line1 == null || line2 == null) { - areEqual = false; - break; - } else if (!line1.equalsIgnoreCase(line2)) { - areEqual = false; - break; - } - line1 = reader1.readLine(); - line2 = reader2.readLine(); - lineNum++; - } - if (!areEqual) { - String message = "Two files have different content. They differ at line " + lineNum + " \"" - + actual.getName() + "\" has " + line1 + " and \"" + expected.getName() + "\" has " - + line2 + " at line " + lineNum + "\n"; - fail(message); - } - } + private static void assertFileContentsEqual(File actual, File expected) throws IOException { + assertArrayEquals(Files.readAllBytes(actual.toPath()), Files.readAllBytes(expected.toPath())); } } From 45c771d7a8583ab3be920897b3a2042b1424f1c4 Mon Sep 17 00:00:00 2001 From: Lakshminarayana Nekkanti Date: Sat, 6 Jul 2019 22:46:32 +0530 Subject: [PATCH 4/6] #3381 - test case updated --- .../tools/eclipse/appengine/libraries/PomFormatTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java index 968b679369..c10bcf6093 100644 --- a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java @@ -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 @@ -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())); } } From 38d59ea1042052fe83116db225a89b0fe5f8c816 Mon Sep 17 00:00:00 2001 From: Lakshminarayana Nekkanti Date: Sun, 7 Jul 2019 09:25:00 +0530 Subject: [PATCH 5/6] #3381 - test case updated --- .../appengine/libraries/PomFormatTest.java | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java index c10bcf6093..747f67c7fb 100644 --- a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java @@ -16,7 +16,7 @@ package com.google.cloud.tools.eclipse.appengine.libraries; -import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.fail; import com.google.cloud.tools.eclipse.appengine.libraries.model.Library; import com.google.cloud.tools.eclipse.appengine.libraries.model.LibraryFile; @@ -26,8 +26,10 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; +import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.logging.Level; @@ -106,6 +108,32 @@ public void testRemoveUnusedDependencies() throws Exception { } private static void assertFileContentsEqual(File expected, File actual) throws IOException { - assertArrayEquals(Files.readAllBytes(expected.toPath()), Files.readAllBytes(actual.toPath())); + final List expectedLines = + Files.readAllLines(expected.toPath(), Charset.forName("UTF-8")); + final List actualLines = Files.readAllLines(actual.toPath(), Charset.forName("UTF-8")); + + if (expectedLines == null || expectedLines.size() == 0) { + fail("Expected file shouldn't be empty"); + return; + } + if (expectedLines.size() != actualLines.size()) { + fail("Line sizes are differed, expected.length=" + expectedLines.size() + " actual.length=" + + actualLines.size()); + return; + } + + final List diff = new ArrayList<>(); + for (final String line : expectedLines) { + if (!actualLines.contains(line)) { + diff.add(("Line Number : " + expectedLines.indexOf(line) + 1) + " " + line + "\n"); + } + } + if (diff.size() > 0) { + String message = "The difference are:\n"; + for (String line : diff) { + message = message.concat(line); + } + fail(message); + } } } From 741ded9ee6c84e2fc023184c7041f16c23659be9 Mon Sep 17 00:00:00 2001 From: Lakshminarayana Nekkanti <39690425+lak-proddev@users.noreply.github.com> Date: Sun, 7 Jul 2019 11:34:30 +0530 Subject: [PATCH 6/6] Typo --- .../cloud/tools/eclipse/appengine/libraries/PomFormatTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java index 747f67c7fb..2ffb95114a 100644 --- a/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java +++ b/plugins/com.google.cloud.tools.eclipse.appengine.libraries.test/src/com/google/cloud/tools/eclipse/appengine/libraries/PomFormatTest.java @@ -129,7 +129,7 @@ private static void assertFileContentsEqual(File expected, File actual) throws I } } if (diff.size() > 0) { - String message = "The difference are:\n"; + String message = "The differences are:\n"; for (String line : diff) { message = message.concat(line); }