diff options
author | Andrew Niefer | 2011-05-12 17:12:29 +0000 |
---|---|---|
committer | Andrew Niefer | 2011-05-12 17:12:29 +0000 |
commit | 84d4e980cd970f2bd4f576f23553520f688ac52c (patch) | |
tree | e0df6a615e57ffce85b4cc935a918f95fd0ac991 | |
parent | dd4ea5390b3c0512e21fabc43ad98aeaf3df5d58 (diff) | |
download | eclipse.pde.build-84d4e980cd970f2bd4f576f23553520f688ac52c.tar.gz eclipse.pde.build-84d4e980cd970f2bd4f576f23553520f688ac52c.tar.xz eclipse.pde.build-84d4e980cd970f2bd4f576f23553520f688ac52c.zip |
bug 330006 - false positive in feature comparev20110512-1320R3_7_1R3_7
-rw-r--r-- | org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java | 7 | ||||
-rw-r--r-- | org.eclipse.pde.build/src/org/eclipse/pde/internal/build/FeatureGenerator.java | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java index 9d9a0eb2..3a6b83fa 100644 --- a/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java +++ b/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2Tests.java @@ -587,7 +587,7 @@ public class P2Tests extends P2TestCase { IFolder b = Utils.createFolder(buildFolder, "plugins/b"); IFolder c = Utils.createFolder(buildFolder, "plugins/c"); - Utils.generateFeature(buildFolder, "F", null, new String[] {"a;unpack=false", "b;unpack=false", "c;unpack=false"}); + Utils.generateFeature(buildFolder, "F", null, new String[] {"a;unpack=false", "b;unpack=false;os=linux", "b;unpack=false;os=win32", "c;unpack=false"}); Properties featureProperties = new Properties(); featureProperties.put("bin.includes", "feature.xml"); Utils.storeProperties(buildFolder.getFile("features/F/build.properties"), featureProperties); @@ -629,6 +629,7 @@ public class P2Tests extends P2TestCase { properties = BuildConfiguration.getBuilderProperties(buildFolder); properties.put("topLevelElementId", "F"); properties.put("generate.p2.metadata", "true"); + properties.put("configs", "linux, gtk, x86"); properties.put("p2.metadata.repo", repo1Location); properties.put("p2.artifact.repo", repo1Location); properties.put("p2.publish.artifacts", "true"); @@ -640,7 +641,7 @@ public class P2Tests extends P2TestCase { runBuild(buildFolder); //now change A and recompile - Utils.generateFeature(buildFolder, "F", null, new String[] {"a;unpack=true", "b;optional=true", "c;unpack=false"}); + Utils.generateFeature(buildFolder, "F", null, new String[] {"a;unpack=true", "b;os=linux;optional=true", "c;unpack=false"}); Utils.storeProperties(buildFolder.getFile("features/F/build.properties"), featureProperties); code = new StringBuffer(); @@ -700,7 +701,7 @@ public class P2Tests extends P2TestCase { IArtifactRepository artifact = loadArtifactRepository(finalLocation); assertEquals(artifact.getName(), "testRepoName"); //bug 274094 assertLogContainsLine(buildFolder.getFile("log.log"), "Messages while mirroring artifact descriptors"); - assertLogContainsLines(buildFolder.getFile("compare.log"), new String[] {"canonical: org.eclipse.update.feature,F,1.0.0", "The entry \"Plugin: a 1.0.0.v2\" is not present in both features", "The entry \"Plugin: b 1.0.0\" has different unpack attribute values"}); + assertLogContainsLines(buildFolder.getFile("compare.log"), new String[] {"canonical: org.eclipse.update.feature,F,1.0.0", "The feature has a different number of entries", "The entry \"Plugin: a 1.0.0.v2\" is not present in both features", "The entry \"Plugin: b 1.0.0\" has different unpack attribute values"}); assertLogContainsLines(buildFolder.getFile("compare.log"), new String[] {"canonical: osgi.bundle,b,1.0.0", "The class B.class is different."}); boolean failed = true; try { diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/FeatureGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/FeatureGenerator.java index 9a799b68..a8b11bbb 100644 --- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/FeatureGenerator.java +++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/FeatureGenerator.java @@ -41,14 +41,16 @@ public class FeatureGenerator extends AbstractScriptGenerator { public boolean equals(Object obj) { if (obj instanceof Entry) { Entry objEntry = (Entry) obj; - return id.equals(((Entry) obj).id) && version.equals(objEntry.version); + if (!(id.equals(((Entry) obj).id) && version.equals(objEntry.version))) + return false; + return getAttributes().equals(objEntry.getAttributes()); } return id.equals(obj); } public int hashCode() { - return id.hashCode() + version.hashCode(); + return id.hashCode() + version.hashCode() + getAttributes().hashCode(); } public Map getAttributes() { |