[testng] 127/355: Adjustments to Vlad's branch to make the tests pass.
Eugene Zhukov
eugene-guest at moszumanska.debian.org
Tue Aug 18 10:19:56 UTC 2015
This is an automated email from the git hooks/post-receive script.
eugene-guest pushed a commit to annotated tag OpenBSD
in repository testng.
commit a2f7a6aabef6e11ee6c6ea41adc6640777a7756d
Author: Cedric Beust <cedric at beust.com>
Date: Tue Jan 13 15:55:46 2015 -0800
Adjustments to Vlad's branch to make the tests pass.
---
pom-test.xml | 2 +-
.../internal/annotations/JDK15TagFactory.java | 26 ++++++++++++----------
src/test/java/test/testng106/TestNG106.java | 6 ++---
src/test/resources/testng-single.xml | 9 ++------
4 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/pom-test.xml b/pom-test.xml
index d318865..bf83d94 100644
--- a/pom-test.xml
+++ b/pom-test.xml
@@ -72,7 +72,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>6.8.9-SNAPSHOT</version>
+ <version>6.8.13</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/src/main/java/org/testng/internal/annotations/JDK15TagFactory.java b/src/main/java/org/testng/internal/annotations/JDK15TagFactory.java
index 2773460..faf24ab 100755
--- a/src/main/java/org/testng/internal/annotations/JDK15TagFactory.java
+++ b/src/main/java/org/testng/internal/annotations/JDK15TagFactory.java
@@ -2,7 +2,9 @@ package org.testng.internal.annotations;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
-import java.util.Map;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
import org.testng.IAnnotationTransformer;
import org.testng.TestNGException;
@@ -31,9 +33,10 @@ import org.testng.annotations.ITestAnnotation;
import org.testng.annotations.Listeners;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
-import org.testng.collections.Maps;
import org.testng.internal.Utils;
+import com.google.inject.internal.Lists;
+
/**
* This class creates implementations of IAnnotations based on the JDK5
* annotation that was found on the Java element.
@@ -417,15 +420,15 @@ public class JDK15TagFactory {
}
private String[] join(String[] strings, String[] strings2) {
- Map<String, String> vResult = Maps.newHashMap();
- for (String s : strings) {
- vResult.put(s, s);
- }
+ List<String> result = Lists.newArrayList(strings);
+ Set<String> seen = new HashSet<String>(Lists.newArrayList(strings));
for (String s : strings2) {
- vResult.put(s, s);
+ if (! seen.contains(s)) {
+ result.add(s);
+ }
}
- return vResult.keySet().toArray(new String[vResult.size()]);
+ return result.toArray(new String[result.size()]);
}
/**
@@ -494,21 +497,20 @@ public class JDK15TagFactory {
return new String[0];
}
- Map<String, String> vResult = Maps.newHashMap();
+ List<String> result = Lists.newArrayList();
while (cls != null && cls != Object.class) {
Annotation annotation = cls.getAnnotation(annotationClass);
if (annotation != null) {
String[] g = (String[]) invokeMethod(annotation, methodName);
for (String s : g) {
- vResult.put(s, s);
+ result.add(s);
}
}
cls = cls.getSuperclass();
}
- String[] result = vResult.keySet().toArray(new String[vResult.size()]);
- return result;
+ return result.toArray(new String[result.size()]);
}
private Object invokeMethod(Annotation test, String methodName) {
diff --git a/src/test/java/test/testng106/TestNG106.java b/src/test/java/test/testng106/TestNG106.java
index 92c883f..171463a 100644
--- a/src/test/java/test/testng106/TestNG106.java
+++ b/src/test/java/test/testng106/TestNG106.java
@@ -1,12 +1,13 @@
package test.testng106;
+import java.util.Arrays;
+
import org.testng.Assert;
import org.testng.TestNG;
import org.testng.annotations.Test;
import org.testng.xml.XmlSuite;
-import test.SimpleBaseTest;
-import java.util.Arrays;
+import test.SimpleBaseTest;
public class TestNG106 extends SimpleBaseTest {
@Test
@@ -18,7 +19,6 @@ public class TestNG106 extends SimpleBaseTest {
createXmlTest(s, "myTest3", Test2.class.getName());
createXmlTest(s, "myTest-last", Test2.class.getName());
tng.setXmlSuites(Arrays.asList(s));
- tng.setVerbose(3);
tng.run();
Assert.assertEquals(FailingSuiteFixture.s_invocations, 0, "@BeforeSuite has failed. All tests should be skipped.");
}
diff --git a/src/test/resources/testng-single.xml b/src/test/resources/testng-single.xml
index 6898468..d144918 100644
--- a/src/test/resources/testng-single.xml
+++ b/src/test/resources/testng-single.xml
@@ -9,16 +9,11 @@
<parameter name="string" value="s"/>
<groups>
- <dependencies>
- <group name="c" depends-on="a b" />
- <group name="z" depends-on="c" />
- </dependencies>
</groups>
<classes>
- <class name="test.tmp.A">
- </class>
- </classes>
+ <class name="test.mannotation.MAnnotationSampleTest" />
+ </classes>
</test>
</suite>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/testng.git
More information about the pkg-java-commits
mailing list