Sync from SUSE:SLFO:Main testng revision 2119da1f9dfa2cbaca1dd42975d5f75d

This commit is contained in:
Adrian Schröter 2024-05-31 15:01:11 +02:00
parent 51043d7e64
commit 7a5a532936
12 changed files with 797 additions and 326 deletions

View File

@ -1,17 +1,17 @@
From bce3019741aeb785658b23095ae408a6c2d8ca35 Mon Sep 17 00:00:00 2001
From acd7f374502cbbde54f1dd43cde1c4faa5d4139a Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Wed, 31 May 2017 13:44:36 +0200
Subject: [PATCH 1/2] Avoid accidental javascript in javadoc
Subject: [PATCH 1/4] Avoid accidental javascript in javadoc
---
src/main/java/org/testng/xml/TestNGContentHandler.java | 4 +++-
.../src/main/java/org/testng/xml/TestNGContentHandler.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/testng/xml/TestNGContentHandler.java b/src/main/java/org/testng/xml/TestNGContentHandler.java
index b74572a..7c490e9 100644
--- a/src/main/java/org/testng/xml/TestNGContentHandler.java
+++ b/src/main/java/org/testng/xml/TestNGContentHandler.java
@@ -250,7 +250,9 @@ public class TestNGContentHandler extends DefaultHandler {
diff --git a/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java b/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java
index a1f64c00..74c1e10a 100644
--- a/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java
+++ b/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java
@@ -328,7 +328,9 @@ public class TestNGContentHandler extends DefaultHandler {
}
}
@ -23,5 +23,5 @@ index b74572a..7c490e9 100644
if (start) {
m_currentLanguage = attributes.getValue("language");
--
2.20.1
2.44.0

View File

@ -1,38 +1,38 @@
From 9155677e2d5acdd2379c38041189da52c7f04946 Mon Sep 17 00:00:00 2001
From acbea8349bb443e867371bbfb5eb2e7f84f53784 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Wed, 18 Jul 2018 15:57:49 +0200
Subject: [PATCH 2/2] Replace bundled jquery with CDN link
Subject: [PATCH 2/4] Replace bundled jquery with CDN link
---
src/main/java/org/testng/reporters/jq/Main.java | 1 -
src/main/resources/org/testng/header | 2 +-
testng-core/src/main/java/org/testng/reporters/jq/Main.java | 1 -
testng-core/src/main/resources/org/testng/header | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/java/org/testng/reporters/jq/Main.java b/src/main/java/org/testng/reporters/jq/Main.java
index efd6799..2d8b74e 100644
--- a/src/main/java/org/testng/reporters/jq/Main.java
+++ b/src/main/java/org/testng/reporters/jq/Main.java
@@ -21,7 +21,6 @@ public class Main implements IReporter {
diff --git a/testng-core/src/main/java/org/testng/reporters/jq/Main.java b/testng-core/src/main/java/org/testng/reporters/jq/Main.java
index 7c6a959b..82ef710e 100644
--- a/testng-core/src/main/java/org/testng/reporters/jq/Main.java
+++ b/testng-core/src/main/java/org/testng/reporters/jq/Main.java
@@ -20,7 +20,6 @@ public class Main implements IReporter {
private static final String TESTNG_RESOURCE_PREFIX = "/org/testng/";
private static final String[] RESOURCES =
new String[] {
- "jquery.min.js",
- "jquery-3.6.0.min.js",
"testng-reports.css",
"testng-reports.js",
"testng-reports1.css",
diff --git a/src/main/resources/org/testng/header b/src/main/resources/org/testng/header
index f5abbc3..817badc 100644
--- a/src/main/resources/org/testng/header
+++ b/src/main/resources/org/testng/header
diff --git a/testng-core/src/main/resources/org/testng/header b/testng-core/src/main/resources/org/testng/header
index d1573f93..29ed3e16 100644
--- a/testng-core/src/main/resources/org/testng/header
+++ b/testng-core/src/main/resources/org/testng/header
@@ -7,7 +7,7 @@
<link type="text/css" href="testng-reports1.css" rel="stylesheet" id="ultra" />
<link type="text/css" href="testng-reports.css" rel="stylesheet" id="retro" disabled="false"/>
- <script type="text/javascript" src="jquery.min.js"></script>
+ <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="jquery-3.6.0.min.js"></script>
+ <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="testng-reports.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type='text/javascript'>
--
2.31.1
2.44.0

View File

@ -0,0 +1,445 @@
From 9b3e583a38c5c7cdea761e687ee07dfdca6b2e40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch>
Date: Tue, 16 Apr 2024 09:16:42 +0200
Subject: [PATCH 3/4] Preserve Java 8 compatibility
---
.../main/java/org/testng/util/Strings.java | 2 +-
.../org/testng/internal/PackageUtils.java | 13 ++++--
.../main/java/org/testng/internal/Utils.java | 4 +-
.../protocols/BundledResourceProcessor.java | 12 ++++--
.../internal/protocols/FileProcessor.java | 11 +++--
.../src/main/java/org/testng/SuiteRunner.java | 3 +-
.../src/main/java/org/testng/TestRunner.java | 18 ++++----
.../testng/internal/DataProviderLoader.java | 13 +++++-
.../org/testng/internal/NoOpTestClass.java | 41 ++++++++++---------
.../main/java/org/testng/internal/Yaml.java | 2 +-
.../org/testng/reporters/VerboseReporter.java | 10 ++++-
.../org/testng/xml/TestNGContentHandler.java | 11 +++--
12 files changed, 92 insertions(+), 48 deletions(-)
diff --git a/testng-collections/src/main/java/org/testng/util/Strings.java b/testng-collections/src/main/java/org/testng/util/Strings.java
index 452f56f2..5ec081bf 100644
--- a/testng-collections/src/main/java/org/testng/util/Strings.java
+++ b/testng-collections/src/main/java/org/testng/util/Strings.java
@@ -33,7 +33,7 @@ public final class Strings {
if (list.isEmpty()) {
return true;
}
- return list.stream().allMatch(t -> t == null || t.isBlank());
+ return list.stream().allMatch(t -> t == null || t.trim().isEmpty());
}
private static final Map<String, String> ESCAPE_HTML_MAP = Maps.newLinkedHashMap();
diff --git a/testng-core-api/src/main/java/org/testng/internal/PackageUtils.java b/testng-core-api/src/main/java/org/testng/internal/PackageUtils.java
index 6669fb6a..e45ad73c 100644
--- a/testng-core-api/src/main/java/org/testng/internal/PackageUtils.java
+++ b/testng-core-api/src/main/java/org/testng/internal/PackageUtils.java
@@ -1,12 +1,12 @@
package org.testng.internal;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
import java.io.File;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Collection;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
@@ -114,7 +114,7 @@ public class PackageUtils {
private static Function<ClassLoader, Stream<URL>> asURLs(String packageDir) {
return cl -> {
try {
- Iterator<URL> iterator = cl.getResources(packageDir).asIterator();
+ Iterator<URL> iterator = Collections.list(cl.getResources(packageDir)).iterator();
return StreamSupport.stream(
Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED), false);
} catch (IOException e) {
@@ -129,7 +129,12 @@ public class PackageUtils {
return true;
}
- String fileName = URLDecoder.decode(url.getFile(), UTF_8);
+ String fileName;
+ try {
+ fileName = URLDecoder.decode(url.getFile(), "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ fileName = new String();
+ }
for (String classpathFrag : classpathFragments) {
String path = classpathFrag + lastFragment;
diff --git a/testng-core-api/src/main/java/org/testng/internal/Utils.java b/testng-core-api/src/main/java/org/testng/internal/Utils.java
index 174c8ef3..30cf8b30 100644
--- a/testng-core-api/src/main/java/org/testng/internal/Utils.java
+++ b/testng-core-api/src/main/java/org/testng/internal/Utils.java
@@ -275,7 +275,7 @@ public final class Utils {
LOG.error("Couldn't find resource on the class path: " + resourceName);
return;
}
- try (inputStream) {
+ try {
try (FileOutputStream outputStream = new FileOutputStream(file)) {
int nread;
byte[] buffer = new byte[4096];
@@ -283,6 +283,8 @@ public final class Utils {
outputStream.write(buffer, 0, nread);
}
}
+ } finally {
+ inputStream.close();
}
}
diff --git a/testng-core-api/src/main/java/org/testng/internal/protocols/BundledResourceProcessor.java b/testng-core-api/src/main/java/org/testng/internal/protocols/BundledResourceProcessor.java
index 79d0626b..b48f7523 100644
--- a/testng-core-api/src/main/java/org/testng/internal/protocols/BundledResourceProcessor.java
+++ b/testng-core-api/src/main/java/org/testng/internal/protocols/BundledResourceProcessor.java
@@ -1,7 +1,6 @@
package org.testng.internal.protocols;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
+import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLConnection;
@@ -33,8 +32,13 @@ class BundledResourceProcessor extends Processor {
Method thisMethod = url.openConnection().getClass().getDeclaredMethod("getFileURL", params);
Object[] paramsObj = {};
URL fileUrl = (URL) thisMethod.invoke(connection, paramsObj);
- return findClassesInDirPackage(
- packageOnly, included, excluded, URLDecoder.decode(fileUrl.getFile(), UTF_8), recursive);
+ String decoded;
+ try {
+ decoded = URLDecoder.decode(fileUrl.getFile(), "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ decoded = new String();
+ }
+ return findClassesInDirPackage(packageOnly, included, excluded, decoded, recursive);
} catch (Exception ex) {
// ignore - probably not an Eclipse OSGi bundle
}
diff --git a/testng-core-api/src/main/java/org/testng/internal/protocols/FileProcessor.java b/testng-core-api/src/main/java/org/testng/internal/protocols/FileProcessor.java
index 12b93a0e..e85fdc88 100644
--- a/testng-core-api/src/main/java/org/testng/internal/protocols/FileProcessor.java
+++ b/testng-core-api/src/main/java/org/testng/internal/protocols/FileProcessor.java
@@ -1,7 +1,6 @@
package org.testng.internal.protocols;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
+import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.List;
@@ -10,11 +9,17 @@ class FileProcessor extends Processor {
@Override
public List<String> process(Input input, URL url) {
+ String decoded;
+ try {
+ decoded = URLDecoder.decode(url.getFile(), "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ decoded = new String();
+ }
return findClassesInDirPackage(
input.getPackageWithoutWildCards(),
input.getIncluded(),
input.getExcluded(),
- URLDecoder.decode(url.getFile(), UTF_8),
+ decoded,
input.isRecursive());
}
}
diff --git a/testng-core/src/main/java/org/testng/SuiteRunner.java b/testng-core/src/main/java/org/testng/SuiteRunner.java
index 452e5711..dfa87c80 100644
--- a/testng-core/src/main/java/org/testng/SuiteRunner.java
+++ b/testng-core/src/main/java/org/testng/SuiteRunner.java
@@ -818,8 +818,7 @@ public class SuiteRunner implements ISuite, ISuiteRunnerListener {
TestListenersContainer(List<ITestListener> listeners, ITestListener exitCodeListener) {
this.listeners.addAll(listeners);
- this.exitCodeListener =
- Objects.requireNonNullElseGet(exitCodeListener, () -> new ITestListener() {});
+ this.exitCodeListener = exitCodeListener != null ? exitCodeListener : new ITestListener() {};
}
}
}
diff --git a/testng-core/src/main/java/org/testng/TestRunner.java b/testng-core/src/main/java/org/testng/TestRunner.java
index 8f8085c0..b051d8ac 100644
--- a/testng-core/src/main/java/org/testng/TestRunner.java
+++ b/testng-core/src/main/java/org/testng/TestRunner.java
@@ -7,6 +7,7 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
@@ -557,11 +558,13 @@ public class TestRunner
}
private static ITestNGMethod[] beforeClassConfigMethods(ITestClass tc) {
- return ITestClassConfigInfo.allBeforeClassMethods(tc).toArray(ITestNGMethod[]::new);
+ List<ITestNGMethod> methodsList = ITestClassConfigInfo.allBeforeClassMethods(tc);
+ return methodsList.toArray(new ITestNGMethod[methodsList.size()]);
}
private static ITestNGMethod[] afterClassConfigMethods(ITestClass tc) {
- return ITestClassConfigInfo.allAfterClassMethods(tc).toArray(ITestNGMethod[]::new);
+ List<ITestNGMethod> methodsList = ITestClassConfigInfo.allAfterClassMethods(tc);
+ return methodsList.toArray(new ITestNGMethod[methodsList.size()]);
}
private ITestNGMethod[] computeAndGetAllTestMethods() {
@@ -1045,11 +1048,12 @@ public class TestRunner
@Override
public List<IConfigurationListener> getConfigurationListeners() {
- return m_configurationListeners.stream()
- .map(ClassBasedWrapper::wrap)
- .distinct()
- .map(ClassBasedWrapper::unWrap)
- .collect(Collectors.toUnmodifiableList());
+ return Collections.unmodifiableList(
+ m_configurationListeners.stream()
+ .map(ClassBasedWrapper::wrap)
+ .distinct()
+ .map(ClassBasedWrapper::unWrap)
+ .collect(Collectors.toList()));
}
private void logFailedTest(ITestResult tr, boolean withinSuccessPercentage) {
diff --git a/testng-core/src/main/java/org/testng/internal/DataProviderLoader.java b/testng-core/src/main/java/org/testng/internal/DataProviderLoader.java
index 8f27cf32..85aeb936 100644
--- a/testng-core/src/main/java/org/testng/internal/DataProviderLoader.java
+++ b/testng-core/src/main/java/org/testng/internal/DataProviderLoader.java
@@ -2,6 +2,8 @@ package org.testng.internal;
import java.io.IOException;
import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
import org.testng.log4testng.Logger;
public class DataProviderLoader extends ClassLoader {
@@ -29,7 +31,16 @@ public class DataProviderLoader extends ClassLoader {
byte[] classBytes;
try {
- classBytes = in.readAllBytes();
+ List<Byte> byteList = new ArrayList<>();
+ int byteRead;
+ while ((byteRead = in.read()) != -1) {
+ byteList.add((byte) byteRead);
+ }
+ classBytes = new byte[byteList.size()];
+ int i = 0;
+ for (Byte b : byteList) {
+ classBytes[i++] = b;
+ }
} catch (IOException e) {
throw new ClassNotFoundException("ERROR reading class file" + e);
}
diff --git a/testng-core/src/main/java/org/testng/internal/NoOpTestClass.java b/testng-core/src/main/java/org/testng/internal/NoOpTestClass.java
index bb3feb3b..dc406f92 100644
--- a/testng-core/src/main/java/org/testng/internal/NoOpTestClass.java
+++ b/testng-core/src/main/java/org/testng/internal/NoOpTestClass.java
@@ -1,6 +1,7 @@
package org.testng.internal;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.testng.ITestClass;
import org.testng.ITestNGMethod;
@@ -39,16 +40,16 @@ public class NoOpTestClass implements ITestClass, IObject {
public NoOpTestClass(ITestClass testClass) {
m_testClass = testClass.getRealClass();
- m_beforeSuiteMethods = List.of(testClass.getBeforeSuiteMethods());
- m_beforeTestConfMethods = List.of(testClass.getBeforeTestConfigurationMethods());
+ m_beforeSuiteMethods = Arrays.asList(testClass.getBeforeSuiteMethods());
+ m_beforeTestConfMethods = Arrays.asList(testClass.getBeforeTestConfigurationMethods());
m_beforeGroupsMethods = testClass.getBeforeGroupsMethods();
- m_beforeClassMethods = List.of(testClass.getBeforeClassMethods());
- m_beforeTestMethods = List.of(testClass.getBeforeTestMethods());
- m_afterSuiteMethods = List.of(testClass.getAfterSuiteMethods());
- m_afterTestConfMethods = List.of(testClass.getAfterTestConfigurationMethods());
- m_afterGroupsMethods = List.of(testClass.getAfterGroupsMethods());
- m_afterClassMethods = List.of(testClass.getAfterClassMethods());
- m_afterTestMethods = List.of(testClass.getAfterTestMethods());
+ m_beforeClassMethods = Arrays.asList(testClass.getBeforeClassMethods());
+ m_beforeTestMethods = Arrays.asList(testClass.getBeforeTestMethods());
+ m_afterSuiteMethods = Arrays.asList(testClass.getAfterSuiteMethods());
+ m_afterTestConfMethods = Arrays.asList(testClass.getAfterTestConfigurationMethods());
+ m_afterGroupsMethods = Arrays.asList(testClass.getAfterGroupsMethods());
+ m_afterClassMethods = Arrays.asList(testClass.getAfterClassMethods());
+ m_afterTestMethods = Arrays.asList(testClass.getAfterTestMethods());
m_instances = IObject.objects(testClass, true);
m_instanceHashes = IObject.instanceHashCodes(testClass);
m_xmlTest = testClass.getXmlTest();
@@ -56,35 +57,35 @@ public class NoOpTestClass implements ITestClass, IObject {
}
public void setBeforeTestMethods(ITestNGMethod[] beforeTestMethods) {
- m_beforeTestMethods = List.of(beforeTestMethods);
+ m_beforeTestMethods = Arrays.asList(beforeTestMethods);
}
public void setAfterTestMethod(ITestNGMethod[] afterTestMethods) {
- m_afterTestMethods = List.of(afterTestMethods);
+ m_afterTestMethods = Arrays.asList(afterTestMethods);
}
/** @return Returns the afterClassMethods. */
@Override
public ITestNGMethod[] getAfterClassMethods() {
- return m_afterClassMethods.toArray(ITestNGMethod[]::new);
+ return m_afterClassMethods.toArray(new ITestNGMethod[m_afterClassMethods.size()]);
}
/** @return Returns the afterTestMethods. */
@Override
public ITestNGMethod[] getAfterTestMethods() {
- return m_afterTestMethods.toArray(ITestNGMethod[]::new);
+ return m_afterTestMethods.toArray(new ITestNGMethod[m_afterTestMethods.size()]);
}
/** @return Returns the beforeClassMethods. */
@Override
public ITestNGMethod[] getBeforeClassMethods() {
- return m_beforeClassMethods.toArray(ITestNGMethod[]::new);
+ return m_beforeClassMethods.toArray(new ITestNGMethod[m_beforeClassMethods.size()]);
}
/** @return Returns the beforeTestMethods. */
@Override
public ITestNGMethod[] getBeforeTestMethods() {
- return m_beforeTestMethods.toArray(ITestNGMethod[]::new);
+ return m_beforeTestMethods.toArray(new ITestNGMethod[m_beforeTestMethods.size()]);
}
/** @return Returns the testMethods. */
@@ -95,22 +96,22 @@ public class NoOpTestClass implements ITestClass, IObject {
@Override
public ITestNGMethod[] getBeforeSuiteMethods() {
- return m_beforeSuiteMethods.toArray(ITestNGMethod[]::new);
+ return m_beforeSuiteMethods.toArray(new ITestNGMethod[m_beforeSuiteMethods.size()]);
}
@Override
public ITestNGMethod[] getAfterSuiteMethods() {
- return m_afterSuiteMethods.toArray(ITestNGMethod[]::new);
+ return m_afterSuiteMethods.toArray(new ITestNGMethod[m_afterSuiteMethods.size()]);
}
@Override
public ITestNGMethod[] getBeforeTestConfigurationMethods() {
- return m_beforeTestConfMethods.toArray(ITestNGMethod[]::new);
+ return m_beforeTestConfMethods.toArray(new ITestNGMethod[m_beforeTestConfMethods.size()]);
}
@Override
public ITestNGMethod[] getAfterTestConfigurationMethods() {
- return m_afterTestConfMethods.toArray(ITestNGMethod[]::new);
+ return m_afterTestConfMethods.toArray(new ITestNGMethod[m_afterTestConfMethods.size()]);
}
/** @return all @Configuration methods that should be invoked before certain groups */
@@ -122,7 +123,7 @@ public class NoOpTestClass implements ITestClass, IObject {
/** @return all @Configuration methods that should be invoked after certain groups */
@Override
public ITestNGMethod[] getAfterGroupsMethods() {
- return m_afterGroupsMethods.toArray(ITestNGMethod[]::new);
+ return m_afterGroupsMethods.toArray(new ITestNGMethod[m_afterGroupsMethods.size()]);
}
/** @see org.testng.internal.IObject#getInstanceHashCodes() */
diff --git a/testng-core/src/main/java/org/testng/internal/Yaml.java b/testng-core/src/main/java/org/testng/internal/Yaml.java
index da3d2141..eb0e37f1 100644
--- a/testng-core/src/main/java/org/testng/internal/Yaml.java
+++ b/testng-core/src/main/java/org/testng/internal/Yaml.java
@@ -140,7 +140,7 @@ public final class Yaml {
/** Convert a XmlTest into YAML */
private static void toYaml(StringBuilder result, XmlTest t) {
- String sp2 = " ".repeat(2);
+ String sp2 = new String(" ");
result.append(" ").append("- name: ").append(t.getName()).append("\n");
maybeAdd(result, sp2, "verbose", t.getVerbose(), XmlSuite.DEFAULT_VERBOSE);
diff --git a/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java b/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java
index 450c5525..747802fc 100644
--- a/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java
+++ b/testng-core/src/main/java/org/testng/reporters/VerboseReporter.java
@@ -206,7 +206,7 @@ public class VerboseReporter implements IConfigurationListener, ITestListener {
sb.append(" ms");
if (!Utils.isStringEmpty(tm.getDescription())) {
sb.append("\n");
- sb.append(" ".repeat(Math.max(0, identLevel)));
+ sb.append(repeatString(" ", Math.max(0, identLevel)));
sb.append(tm.getDescription());
}
if (tm.getInvocationCount() > 1) {
@@ -271,6 +271,14 @@ public class VerboseReporter implements IConfigurationListener, ITestListener {
return buf.toString();
}
+ private static String repeatString(String str, int count) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < count; i++) {
+ sb.append(str);
+ }
+ return sb.toString();
+ }
+
@Override
public String toString() {
return "VerboseReporter{" + "suiteName=" + suiteName + '}';
diff --git a/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java b/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java
index 74c1e10a..463d8467 100644
--- a/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java
+++ b/testng-core/src/main/java/org/testng/xml/TestNGContentHandler.java
@@ -5,6 +5,7 @@ import static org.testng.internal.Utils.isStringBlank;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URI;
@@ -12,7 +13,6 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLDecoder;
-import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -158,8 +158,13 @@ public class TestNGContentHandler extends DefaultHandler {
private static boolean isMalformedFileSystemBasedSystemId(String systemId) {
try {
-
- URL url = new URL(URLDecoder.decode(systemId, StandardCharsets.UTF_8).trim());
+ String decoded;
+ try {
+ decoded = URLDecoder.decode(systemId, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ decoded = new String();
+ }
+ URL url = new URL(decoded.trim());
if (url.getProtocol().equals("file")) {
File file = new File(url.getFile());
boolean isDirectory = file.isDirectory();
--
2.44.0

View File

@ -2,7 +2,7 @@
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/cbeust/testng.git</param>
<param name="revision">7.4.0</param>
<param name="revision">7.10.1</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="exclude">bin*</param>
<param name="exclude">gradle*</param>

240
pom.xml
View File

@ -1,240 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- Refer to the file ./build-with-maven for instruction on how to use this pom.xml -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<packaging>jar</packaging>
<name>TestNG</name>
<version>@VERSION@</version>
<description>TestNG is a testing framework.</description>
<url>http://testng.org</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:cbeust/testng.git</connection>
<developerConnection>scm:git:git@github.com:cbeust/testng.git</developerConnection>
<url>git@github.com:cbeust/testng.git</url>
</scm>
<developers>
<developer>
<name>Cedric Beust</name>
</developer>
</developers>
<distributionManagement>
<repository>
<id>bintray</id>
<url>https://api.bintray.com/maven/cbeust/maven/testng</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<version>1.64</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.17</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.7</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache-extras.beanshell</groupId>
<artifactId>bsh</artifactId>
<version>2.0b6</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<!-- Generating Javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.3</version>
<configuration>
<failOnError>false</failOnError>
<excludePackageNames>*internal</excludePackageNames>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Bundle sources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Compilation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- Resource handling -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<phase>process-sources</phase>
</execution>
</executions>
</plugin>
<!-- OSGi manifest creation -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<instructions>
<_versionpolicy>$(@)</_versionpolicy>
<Export-Package>com.beust.testng,org.testng*</Export-Package>
<Import-Package>
com.beust.jcommander.*;version="[1.7.0,3.0.0)",
bsh.*;version="[2.0.0,3.0.0)";resolution:=optional,
com.google.inject.*;version="[1.2,1.3)";resolution:=optional,
junit.framework;version="[3.8.1, 5.0.0)";resolution:=optional,
org.junit.*;resolution:=optional,
org.apache.tools.ant.*;version="[1.7.0, 2.0.0)";resolution:=optional,
org.yaml.*;version="[1.6,2.0)";resolution:=optional,
!com.beust.testng,
!org.testng.*,
!com.sun.*,
*
</Import-Package>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
<!-- Add OSGi manifest in JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<!-- Tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
<name>listener</name>
<value>test.invokedmethodlistener.MyListener</value>
</property>
</properties>
<systemPropertyVariables>
<test.resources.dir>${project.build.testOutputDirectory}</test.resources.dir>
</systemPropertyVariables>
</configuration>
</plugin>
<!-- Signing with gpg -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

77
testng-7.10.1.pom Normal file
View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- This module was also published with a richer model, Gradle metadata, -->
<!-- which should be used instead. Do not delete the following line which -->
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
<!-- that they should prefer consuming it instead. -->
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.10.1</version>
<name>testng</name>
<description>Testing framework for Java</description>
<url>https://testng.org</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<id>cbeust</id>
<name>Cedric Beust</name>
<email>cedric@beust.com</email>
</developer>
<developer>
<id>juherr</id>
<name>Julien Herr</name>
<email>julien@herr.fr</email>
</developer>
<developer>
<id>krmahadevan</id>
<name>Krishnan Mahadevan</name>
<email>krishnan.mahadevan1978@gmail.com</email>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/testng-team/testng.git</connection>
<url>https://github.com/testng-team/testng.git</url>
</scm>
<issueManagement>
<system>Github</system>
<url>https://github.com/testng-team/testng/issues</url>
</issueManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
<version>1.82</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.7.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.1.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.2</version>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>
</project>

BIN
testng-7.10.1.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
testng-7.4.0.tar.xz (Stored with Git LFS)

Binary file not shown.

View File

@ -1,14 +0,0 @@
diff --git a/src/main/java/org/testng/JarFileUtils.java b/src/main/java/org/testng/JarFileUtils.java
index 683a8b5..2f2ed8f 100644
--- a/src/main/java/org/testng/JarFileUtils.java
+++ b/src/main/java/org/testng/JarFileUtils.java
@@ -77,6 +77,9 @@ class JarFileUtils {
if (Parser.canParse(jeName.toLowerCase())) {
InputStream inputStream = jf.getInputStream(je);
File copyFile = new File(file, jeName);
+ if (!copyFile.toPath().normalize().startsWith(file.toPath().normalize())) {
+ throw new IOException("Bad zip entry");
+ }
Files.copyFile(inputStream, copyFile);
if (matchesXmlPathInJar(je)) {
suitePath = copyFile.toString();

View File

@ -11,17 +11,34 @@
<property name="project.groupId" value="org.testng"/>
<property name="project.artifactId" value="testng"/>
<property name="project.name" value="TestNG"/>
<property name="project.version" value="7.4.0"/>
<property name="project.description" value="TestNG is a testing framework."/>
<property name="project.version" value="7.10.1"/>
<property name="project.description" value="${project.name} is a testing framework."/>
<property name="compiler.source" value="1.8"/>
<property name="compiler.release" value="8"/>
<property name="compiler.source" value="1.${compiler.release}"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="src/main/resources"/>
<property name="build.srcDir" value="testng/src/main/java"/>
<property name="build.srcDirCoreApi" value="testng-core-api/src/main/java"/>
<property name="build.srcDirReflectionUtils" value="testng-reflection-utils/src/main/java"/>
<property name="build.srcDirAsserts" value="testng-asserts/src/main/java"/>
<property name="build.srcDirTestOsgi" value="testng-test-osgi/src/main/java"/>
<property name="build.srcDirTestKit" value="testng-test-kit/src/main/java"/>
<property name="build.srcDirRunnerApi" value="testng-runner-api/src/main/java"/>
<property name="build.srcDirCollections" value="testng-collections/src/main/java"/>
<property name="build.srcDirCore" value="testng-core/src/main/java"/>
<property name="build.resourceDir" value="testng/src/main/resources"/>
<property name="build.resourceDirCoreApi" value="testng-core-api/src/main/resources"/>
<property name="build.resourceDirReflectionUtils" value="testng-reflection-utils/src/main/resources"/>
<property name="build.resourceDirAsserts" value="testng-asserts/src/main/resources"/>
<property name="build.resourceDirTestOsgi" value="testng-test-osgi/src/main/resources"/>
<property name="build.resourceDirTestKit" value="testng-test-kit/src/main/resources"/>
<property name="build.resourceDirRunnerApi" value="testng-runner-api/src/main/resources"/>
<property name="build.resourceDirCollections" value="testng-collections/src/main/resources"/>
<property name="build.resourceDirCore" value="testng-core/src/main/resources"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
@ -56,17 +73,24 @@
encoding="utf-8"
optimize="false"
deprecation="true"
release="${compiler.release}"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
<pathelement location="${build.srcDirCoreApi}"/>
<pathelement location="${build.srcDirReflectionUtils}"/>
<pathelement location="${build.srcDirAsserts}"/>
<pathelement location="${build.srcDirTestKit}"/>
<pathelement location="${build.srcDirRunnerApi}"/>
<pathelement location="${build.srcDirCollections}"/>
<pathelement location="${build.srcDirCore}"/>
</src>
<classpath refid="build.classpath"/>
</javac>
<copy todir="${build.outputDir}">
<fileset dir="${build.resourceDir}"/>
<fileset dir="${build.resourceDirCore}"/>
</copy>
</target>
@ -75,7 +99,7 @@
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir}"
<javadoc sourcepath="${build.srcDirCoreApi}:${build.srcDirReflectionUtils}:${build.srcDirAsserts}:${build.srcDirTestKit}:${build.srcDirRunnerApi}:${build.srcDirCollections}:${build.srcDirCore}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
@ -110,18 +134,27 @@
basedir="${build.outputDir}"
excludes="**/package.html">
<manifest>
<attribute name="Automatic-Module-Name" value="org.testng"/>
<attribute name="Bundle-Description" value="${project.description}"/>
<attribute name="Bundle-License" value="http://apache.org/licenses/LICENSE-2.0"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="${project.name}"/>
<attribute name="Bundle-SymbolicName" value="${project.groupId}"/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="com.beust.testng;uses:=&quot;org.testng&quot;;version=&quot;${project.version}&quot;,org.testng;uses:=&quot;com.beust.jcommander,com.beust.jcommander.converters,com.google.inject,javax.xml.parsers,org.apache.tools.ant,org.apache.tools.ant.taskdefs,org.apache.tools.ant.types,org.testng.annotations,org.testng.internal,org.testng.internal.annotations,org.testng.internal.junit,org.testng.internal.thread.graph,org.testng.xml,org.xml.sax&quot;;version=&quot;${project.version}&quot;,org.testng.annotations;uses:=&quot;com.google.inject,org.testng,org.testng.internal.annotations&quot;;version=&quot;${project.version}&quot;,org.testng.asserts;version=&quot;${project.version}&quot;,org.testng.collections;version=&quot;${project.version}&quot;,org.testng.internal;uses:=&quot;com.google.inject,javax.annotation,org.testng,org.testng.annotations,org.testng.collections,org.testng.internal.annotations,org.testng.internal.thread,org.testng.internal.thread.graph,org.testng.junit,org.testng.reporters,org.testng.xml&quot;;version=&quot;${project.version}&quot;,org.testng.internal.annotations;uses:=&quot;org.testng,org.testng.annotations,org.testng.internal,org.testng.xml&quot;;version=&quot;${project.version}&quot;,org.testng.internal.collections;version=&quot;${project.version}&quot;,org.testng.internal.invokers;uses:=&quot;org.testng&quot;;version=&quot;${project.version}&quot;,org.testng.internal.junit;version=&quot;${project.version}&quot;,org.testng.internal.reflect;uses:=&quot;org.testng&quot;;version=&quot;${project.version}&quot;,org.testng.internal.thread;version=&quot;${project.version}&quot;,org.testng.internal.thread.graph;uses:=&quot;org.testng,org.testng.internal&quot;;version=&quot;${project.version}&quot;,org.testng.junit;uses:=&quot;junit.framework,org.junit.runner,org.testng,org.testng.internal,org.testng.internal.annotations,org.testng.xml&quot;;version=&quot;${project.version}&quot;,org.testng.log;version=&quot;${project.version}&quot;,org.testng.log4testng;version=&quot;${project.version}&quot;,org.testng.mustache;version=&quot;${project.version}&quot;,org.testng.reporters;uses:=&quot;javax.annotation,org.testng,org.testng.internal,org.testng.xml&quot;;version=&quot;${project.version}&quot;,org.testng.reporters.jq;uses:=&quot;org.testng,org.testng.reporters,org.testng.xml&quot;;version=&quot;${project.version}&quot;,org.testng.reporters.util;uses:=&quot;org.testng&quot;;version=&quot;${project.version}&quot;,org.testng.util;uses:=&quot;org.testng&quot;;version=&quot;${project.version}&quot;,org.testng.xml;uses:=&quot;org.testng,org.testng.reporters,org.testng.xml.dom,org.xml.sax,org.xml.sax.helpers&quot;;version=&quot;${project.version}&quot;,org.testng.xml.dom;uses:=&quot;javax.xml.parsers,javax.xml.xpath,org.testng,org.testng.internal.collections,org.testng.xml,org.w3c.dom,org.xml.sax&quot;;version=&quot;${project.version}&quot;,org.testng.xml.internal;uses:=&quot;org.testng.xml&quot;;version=&quot;${project.version}&quot;"/>
<attribute name="Import-Package" value="com.beust.jcommander;version=&quot;[1.7.0,3.0.0)&quot;,com.beust.jcommander.converters;version=&quot;[1.7.0,3.0.0)&quot;,bsh;version=&quot;[2.0.0,3.0.0)&quot;;resolution:=optional,com.google.inject;version=&quot;[1.2,1.3)&quot;;resolution:=optional,junit.framework;version=&quot;[3.8.1,5.0.0)&quot;;resolution:=optional,org.junit;resolution:=optional;version=&quot;[4.12,5)&quot;,org.junit.runner;resolution:=optional;version=&quot;[4.12,5)&quot;,org.junit.runner.manipulation;resolution:=optional;version=&quot;[4.12,5)&quot;,org.junit.runner.notification;resolution:=optional;version=&quot;[4.12,5)&quot;,org.apache.tools.ant;version=&quot;[1.7.0,2.0.0)&quot;;resolution:=optional,org.apache.tools.ant.taskdefs;version=&quot;[1.7.0,2.0.0)&quot;;resolution:=optional,org.apache.tools.ant.types;version=&quot;[1.7.0,2.0.0)&quot;;resolution:=optional,org.apache.tools.ant.types.resources;version=&quot;[1.7.0,2.0.0)&quot;;resolution:=optional,org.apache.tools.ant.types.selectors;version=&quot;[1.7.0,2.0.0)&quot;;resolution:=optional,org.yaml.snakeyaml;version=&quot;[1.6,2.0)&quot;;resolution:=optional,org.yaml.snakeyaml.constructor;version=&quot;[1.6,2.0)&quot;;resolution:=optional,org.yaml.snakeyaml.nodes;version=&quot;[1.6,2.0)&quot;;resolution:=optional,javax.annotation,javax.xml.parsers,javax.xml.xpath,org.w3c.dom,org.xml.sax,org.xml.sax.helpers"/>
<attribute name="Export-Package" value="org.testng,org.testng.annotations,org.testng.asserts,org.testng.collections,org.testng.internal,org.testng.internal.annotations,org.testng.internal.collections,org.testng.internal.invokers,org.testng.internal.invokers.objects,org.testng.internal.objects,org.testng.internal.objects.pojo,org.testng.internal.reflect,org.testng.internal.thread,org.testng.internal.thread.graph,org.testng.log,org.testng.log4testng,org.testng.reporters,org.testng.reporters.jq,org.testng.reporters.util,org.testng.thread,org.testng.util,org.testng.xml,org.testng.xml.internal"/>
<attribute name="Implementation-Title" value="${project.name}"/>
<attribute name="Implementation-Url" value="https://testng.org"/>
<attribute name="Implementation-Vendor-Id" value="${project.groupId}"/>
<attribute name="Implementation-Vendor" value="${project.name}"/>
<attribute name="Implementation-Version" value="${project.version}"/>
<attribute name="Import-Package" value="*;resolution:=optional,bsh.*;version=&quot;[2.0.0,3.0.0)&quot;;resolution:=optional,com.beust.jcommander.*;version=&quot;[1.7.0,3.0.0)&quot;;resolution:=optional,com.google.inject.*;version=&quot;[1.2,1.3)&quot;;resolution:=optional,org.yaml.*;version=&quot;[1.6,2.0)&quot;;resolution:=optional"/>
<attribute name="JavaPackages-ArtifactId" value="${project.artifactId}"/>
<attribute name="JavaPackages-GroupId" value="${project.groupId}"/>
<attribute name="JavaPackages-Version" value="${project.version}"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=${compiler.target}))&quot;"/>
<attribute name="Specification-Title" value="${project.name}"/>
<attribute name="Specification-Vendor" value="${project.name}"/>
<attribute name="Specification-Version" value="${project.version}"/>
</manifest>
</jar>
</target>

View File

@ -1,3 +1,190 @@
-------------------------------------------------------------------
Tue Apr 16 13:27:19 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Upgrade to version 7.10.1
* Changes of 7.10.1
+ Fix for #3110
* Changes of 7.10.0
+ Clean-up deprecated code
+ Minor discrepancy fixes
+ Deleting TestNG eclipse plugin specific classes
+ Code clean-up
+ Remove deprecated JUnit related support in TestNG
+ Handle exceptions in emailable Reporter
+ Add wrapperbot and update workflow order
+ Support ITestNGFactory customisation
+ Streamline data provider listener invocation
+ Streamline Guice Module creation in concurrency.
+ Copy test result attributes when unexpected failures
+ chore: use explicit dependency versions instead of
refreshVersions
+ Remove Ant
+ Support ordering of listeners
+ Add errorprone
+ Allow custom thread pool executors to be wired in.
+ Allow data providers to be non cacheable
+ Use Locks instead of synchronised keyword
+ Document pgp artifact signing keys
+ Add Unique Id for all test class instances
+ Adding issue management workflows
+ Map object to configurations
+ Allow listeners to be disabled at runtime
+ Streamline Data Provider execution
+ Test case failure
+ Honour inheritance when parsing listener factories
+ Fixing flaky tests
+ Tweaks around accessing SuiteResult
+ Streamline random generation
+ Minor refactoring around RunOrder enum
+ Streamline dependencies for configurations
* Changes of 7.9.0
+ GitHub 2913
+ Test Results as artifacts for failed runs
+ Minor code clean-ups
+ Fixing the Github CI yaml file
+ Fixing data races
+ Dont honour params specified in suite-file tag
+ Decouple SuiteRunner and TestRunner
+ Disable Native DI for BeforeSuite methods
+ Streamline running Parallel Dataproviders+retries
+ Remove extra whitespace in log for
Configuration.createMethods()
+ Added the link for TestNG Documentation's GitHub Repo in
README.md
+ FirstTimeOnlyConfig methods + Listener invocations
+ #2974: Add overrideGroupsFromCliInParentChildXml test
+ Ensure thread safety for attribute access
+ Add @inherited to the Listeners annotation
+ Restrict Group inheritance to Before|AfterGroups
+ Ensure ITestResult injected to @AfterMethod is apt
+ Support suite level thread pools for data provider
+ Minor Code tweaks
+ Favour CompletableFuture instead of PoolService
+ Favour FutureTask for concurrency support
+ Shared Threadpool for normal/datadriven tests.
+ Abort for invalid combinations
* Changes of 7.8.0
+ XmlTest index is not set for test suites invoked with YAML
+ Listener's onAfterClass is called before @afterclass
configuration methods are executed.
+ After upgrading to TestNG 7.5.0, setting ITestResult.status
to FAILURE doesn't fail the test anymore
+ JUnitReportReporter should capture the test case output at
the test case level
+ [Feature] Allow test classes to define "configfailurepolicy"
at a per class level
+ TestNG.xml doesn't honour Parallel value of a clone
+ before configuration and before invocation should be 'SKIP'
when beforeMethod is 'skip'
+ Test listeners specified in parent testng.xml file are not
included in testng-failed.xml file
+ Discrepancies with DataProvider and Retry of failed tests
+ Skipped Tests with DataProvider appear as failed
+ testng-results xml reports config skips from base classes as
ignored
+ Feature: Check that specific object present in List
+ Upgrade snakeyaml to 2.0
+ [Feature] Not exception but warning if some (not all) of the
given test names are not found in suite files.
+ [Feature] Generate testng-results.xml per test suite
* Changes of 7.7.1
+ Streamline overloaded assertion methods for Groovy
* Changes of 7.7.0
+ Replace FindBugs by SpotBugs
+ Gradle: Drop forUseAtConfigurationTime()
+ Added ability to provide custom message to
assertThrows\expectThrows methods
+ Fix issue 2801 - Only resolve hostname once
+ [SECURITY] Fix Zip Slip Vulnerability (bsc#1205628,
CVE-2022-4065)
+ GITHUB-2807 - Failsafe buildStackTrace
+ Prevent overlogging of debug msgs in Graph impl
+ Streamline dataprovider invoking in abstract classes
+ Streamline TestResult due to expectedExceptions
+ Unexpected test runs count with retry analyzer
+ Make PackageUtils compliant with JPMS
+ Ability to retry a data provider during failures
+ Refactoring
+ Fixing bug with DataProvider retry
+ Add config key for callback discrepancy behavior
+ Upgrading versions
+ Fix #2770: FileAlreadyExistsException on copy
+ JarFileUtils.delete(File f) throw actual exception (instead
of FileNotFound) when file cannot be deleted #2825
+ GITHUB-2830 - Failsafe parameter.toString
+ Changing assertion message of the osgitest
+ hidden spotbugs in release #2829
+ Enhancing the Matrix
+ Avoid Compilation errors on Semeru JDK flavour.
+ Add addition yml extension
+ Support getting dependencies info for a test
+ Honour regex in dependsOnMethods
+ Ensure All tests run all the time
+ Deprecate support for running Spock Tests
+ Streamline dependsOnMethods for configurations
+ Ensure ITestContext available for JUnit4 tests
+ Deprecate support for running JUnit tests
* Changes of 7.6.1
+ Fix Files.copy() such that parent dirs are created
+ Remove deprecated utility methods
+ Fix typos
* Changes of 7.6.0
+ Remove redundant Parameter implementation
+ Upgrade to JDK11
+ Move SimpleBaseTest to be Kotlin based
+ Restore testnames when using suites in suite.
+ Moving ClassHelperTests into Kotlin
+ IHookable and IConfigurable callback discrepancy
+ Minor refactoring
+ Add additional condition for assertEqualsNoOrder
+ beforeConfiguration() listener method should be invoked for
skipped configurations as well
+ #2734 keep the initial order of listeners
+ SuiteRunner could not be initial by default Configuration
+ Enable Dataprovider failures to be considered.
+ BeforeGroups should run before any matched test
+ Fix possible StringIndexOutOfBoundsException exception in
XmlReporter
+ DataProvider: possibility to unload dataprovider class, when
done with it
+ fix possibilty that AfterGroups method is invoked before all
tests
+ fix equals implementation for WrappedTestNGMethod
+ Upgrade dependencies, Upgrade to JDK17
+ Wire-In listeners consistently
+ Streamline AfterClass invocation
+ Show FQMN for tests in console
+ Fix 2725
- Modified patches:
* 0001-Avoid-accidental-javascript-in-javadoc.patch
* 0002-Replace-bundled-jquery-with-CDN-link.patch
+ regenerate for the current version
- Added patch:
* 0003-Preserve-Java-8-compatibility.patch
+ restore the possibility to build with --release 8
- Removed patches:
* 0003-Upgrade-snakeyaml-to-2.0.patch
* 0004-vuln-fix-Zip-Slip-Vulnerability.patch
+ integrated in this version
-------------------------------------------------------------------
Mon Apr 15 18:07:44 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Modified patches:
* 0001-Avoid-accidental-javascript-in-javadoc.patch
* 0002-Replace-bundled-jquery-with-CDN-link.patch
* testng-CVE-2022-4065.patch ->
0004-vuln-fix-Zip-Slip-Vulnerability.patch
+ re-cherry-pick and rediff in git
- Added patch:
* 0003-Upgrade-snakeyaml-to-2.0.patch
+ Fix build against snakeyaml >= 2.0
-------------------------------------------------------------------
Wed Feb 21 17:12:29 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Use %patch -P N instead of deprecated %patchN.
-------------------------------------------------------------------
Tue Nov 22 12:13:04 UTC 2022 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package testng
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,29 +17,26 @@
Name: testng
Version: 7.4.0
Version: 7.10.1
Release: 0
Summary: Java-based testing framework
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://testng.org/
Source0: %{name}-%{version}.tar.xz
Source1: pom.xml
Source1: https://repo1.maven.org/maven2/org/testng/testng/%{version}/testng-%{version}.pom
Source2: %{name}-build.xml
Patch0: 0001-Avoid-accidental-javascript-in-javadoc.patch
Patch1: 0002-Replace-bundled-jquery-with-CDN-link.patch
Patch2: testng-CVE-2022-4065.patch
Patch2: 0003-Preserve-Java-8-compatibility.patch
BuildRequires: ant
BuildRequires: beust-jcommander
BuildRequires: bsh2
BuildRequires: fdupes
BuildRequires: google-guice
BuildRequires: javapackages-local
BuildRequires: javapackages-local >= 6
BuildRequires: jsr-305
BuildRequires: junit
BuildRequires: snakeyaml
Requires: mvn(com.beust:jcommander)
Requires: mvn(org.yaml:snakeyaml)
BuildRequires: slf4j
BuildRequires: snakeyaml >= 2.0
BuildArch: noarch
%description
@ -57,33 +54,19 @@ This package contains the API documentation for %{name}.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
sed 's/@VERSION@/%{version}/' %{SOURCE1} > pom.xml
cp %{SOURCE1} pom.xml
cp %{SOURCE2} build.xml
cp -p testng-core/src/main/java/*.dtd.html testng-core/src/main/resources/
# remove any bundled libs, but not test resources
find ! -path "*/test/*" -name *.jar -print -delete
find -name *.class -delete
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
# these are unnecessary
%pom_remove_plugin :maven-gpg-plugin .
%pom_remove_plugin :maven-source-plugin .
%pom_remove_plugin :maven-javadoc-plugin .
sed -i -e 's/DEV-SNAPSHOT/%{version}/' src/main/java/org/testng/internal/Version.java
cp -p ./src/main/java/*.dtd.html ./src/main/resources/.
# jdk15 classifier is used by some other packages
%{mvn_alias} : :::jdk15:
%pom_remove_dep org.webjars:jquery
%build
mkdir -p lib
build-jar-repository -s lib ant/ant beust-jcommander bsh2/bsh google-guice jsr305 junit snakeyaml
build-jar-repository -s lib beust-jcommander guice/google-guice jsr-305 slf4j/api snakeyaml
%{ant} jar javadoc
%install
@ -93,7 +76,7 @@ install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.j
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}
install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar -a org.testng:testng::jdk15:
# javadoc