Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies, Upgrade to JDK17 #2747

Merged
merged 14 commits into from Apr 29, 2022
Merged
8 changes: 8 additions & 0 deletions build-logic/code-quality/build.gradle.kts
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
}
Expand All @@ -10,3 +12,9 @@ dependencies {
implementation("org.sonarqube:org.sonarqube.gradle.plugin:2.8")
implementation("com.github.autostyle:autostyle-plugin-gradle:3.1")
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "11"
}
}
10 changes: 9 additions & 1 deletion build-logic/jvm/build.gradle.kts
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
}
Expand All @@ -10,5 +12,11 @@ dependencies {
implementation(project(":basics"))
implementation(project(":code-quality"))
implementation("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.74")
implementation("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.5.10")
implementation("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.20")
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "11"
}
}
Expand Up @@ -6,7 +6,7 @@ plugins {
}

dependencies {
testImplementation(platform("org.jetbrains.kotlin:kotlin-bom:1.6.10"))
testImplementation(platform("org.jetbrains.kotlin:kotlin-bom:1.6.20"))
juherr marked this conversation as resolved.
Show resolved Hide resolved
testImplementation("org.jetbrains.kotlin:kotlin-stdlib")
}

Expand Down
8 changes: 8 additions & 0 deletions build-logic/publishing/build.gradle.kts
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
}
Expand All @@ -12,3 +14,9 @@ dependencies {
implementation("com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:7.0.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin")
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "11"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to manage this version in the gradle properties file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, but feel free to improve it

}
}
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,4 @@
distributionBase=GRADLE_USER_HOME
distributionSha256Sum=b586e04868a22fd817c8971330fec37e298f3242eb85c374181b12d637f80302
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 2 additions & 6 deletions testng-core/src/main/java/org/testng/reporters/jq/Main.java
Expand Up @@ -20,7 +20,7 @@ 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",
Expand Down Expand Up @@ -103,11 +103,7 @@ public void generateReport(

private InputStream load(String fileName) {
juherr marked this conversation as resolved.
Show resolved Hide resolved
String path;
if (fileName.equals("jquery.min.js")) {
path = "/META-INF/resources/webjars/jquery/3.5.1/jquery.min.js";
} else {
path = Main.TESTNG_RESOURCE_PREFIX + fileName;
}
path = Main.TESTNG_RESOURCE_PREFIX + fileName;
return getClass().getResourceAsStream(path);
}
}
2 changes: 1 addition & 1 deletion testng-core/src/main/resources/org/testng/header
Expand Up @@ -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="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'>
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -2,7 +2,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import org.testng.DataProviderHolder;
Expand All @@ -11,7 +10,6 @@
import org.testng.ITestObjectFactory;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.testng.collections.Lists;
import org.testng.collections.Maps;
import org.testng.internal.annotations.DefaultAnnotationTransformer;
import org.testng.internal.annotations.IAnnotationFinder;
Expand Down Expand Up @@ -66,8 +64,7 @@ private void runTest(ITestNGMethod testNGMethod, ParameterHolder.ParameterOrigin
assertThat(params.parameterHolder).isNotNull();
assertThat(params.parameterHolder.origin).isEqualByComparingTo(origin);
Iterator<Object[]> iterators = params.parameterHolder.parameters;
assertThat(Lists.newArrayList(iterators))
.containsAll(Collections.singletonList(new Object[] {"bar"}));
assertThat(iterators).toString().equals("bar");
hduerkop marked this conversation as resolved.
Show resolved Hide resolved
}

private ParameterHandler.ParameterBag invokeParameterCreation(ITestNGMethod method) {
Expand Down
Expand Up @@ -4,32 +4,16 @@

import java.io.File;
import java.lang.reflect.Method;
import java.security.Permission;
import org.testng.IReporter;
import org.testng.ITestNGListener;
import org.testng.TestNG;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.testng.reporters.EmailableReporter;
import org.testng.reporters.EmailableReporter2;
import test.SimpleBaseTest;

public class EmailableReporterTest extends SimpleBaseTest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same goes for this as well. Any specific reason behind us removing off this test that works with a custom security manager?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it because of https://openjdk.java.net/jeps/411 .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hduerkop - Please revert it back since we are still saying that we are going to be JDK11 as the minimum JDK but the security manager has been deprecated in JDK17. So we should perhaps leave it there as is until TestNG moves into JDK17 or above as its minimum JDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to disagree here since JDK17 is the current LTS and is or soon will be dominant on build platforms

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hduerkop - if testng has jdk11 as its minimum jdk then we will need to have everything that exists in jdk11 including tests that test features which are relevant for jdk11 as well.

I agree that build systems atleast on the open source world may move forward but we need to be cognizant of user needs and cannot enforce this upon our users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not an enforcement, but an option to use JDK17 this way - 11 and 17 work this way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the initial objective of the test? Is it another way to test it?

private SecurityManager manager;

@BeforeClass(alwaysRun = true)
public void setup() {
manager = System.getSecurityManager();
System.setSecurityManager(new MySecurityManager(manager));
}

@AfterClass(alwaysRun = true)
public void cleanup() {
System.setSecurityManager(manager);
}

@Test(dataProvider = "getReporterInstances", priority = 1)
public void testReportsNameCustomizationViaRunMethodInvocationAndJVMArguments(
IReporter reporter, String jvm) {
Expand Down Expand Up @@ -133,23 +117,4 @@ private void runTestViaRunMethod(IReporter reporter, String jvm) {
File actual = new File(output.getAbsolutePath(), filename);
assertThat(actual).exists();
}

public static class MySecurityManager extends SecurityManager {

private SecurityManager baseSecurityManager;

MySecurityManager(SecurityManager baseSecurityManager) {
this.baseSecurityManager = baseSecurityManager;
}

@Override
public void checkPermission(Permission permission) {
if (permission.getName().startsWith("exitVM")) {
throw new SecurityException("System exit not allowed");
}
if (baseSecurityManager != null) {
baseSecurityManager.checkPermission(permission);
}
}
}
}
110 changes: 86 additions & 24 deletions versions.properties
Expand Up @@ -7,47 +7,73 @@
#### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file

plugin.com.github.johnrengelman.shadow=7.0.0

plugin.com.github.vlsi.gradle-extensions=1.74

plugin.com.github.vlsi.stage-vote-release=1.77

version.ch.qos.logback..logback-classic=1.2.3

version.ch.qos.logback..logback-core=1.2.3

version.com.beust..jcommander=1.81
plugin.com.github.vlsi.stage-vote-release=1.78

version.ch.qos.logback..logback-classic=1.2.11
## # available=1.3.0-alpha0
## # available=1.3.0-alpha1
## # available=1.3.0-alpha2
## # available=1.3.0-alpha3
## # available=1.3.0-alpha4
## # available=1.3.0-alpha5
## # available=1.3.0-alpha6
## # available=1.3.0-alpha7
## # available=1.3.0-alpha8
## # available=1.3.0-alpha9
## # available=1.3.0-alpha10
## # available=1.3.0-alpha11
## # available=1.3.0-alpha12
## # available=1.3.0-alpha13
## # available=1.3.0-alpha14

version.ch.qos.logback..logback-core=1.2.11
## # available=1.3.0-alpha0
## # available=1.3.0-alpha1
## # available=1.3.0-alpha2
## # available=1.3.0-alpha3
## # available=1.3.0-alpha4
## # available=1.3.0-alpha5
## # available=1.3.0-alpha6
## # available=1.3.0-alpha7
## # available=1.3.0-alpha8
## # available=1.3.0-alpha9
## # available=1.3.0-alpha10
## # available=1.3.0-alpha11
## # available=1.3.0-alpha12
## # available=1.3.0-alpha13
## # available=1.3.0-alpha14

version.com.beust..jcommander=1.82

version.com.google.code.findbugs..jsr305=3.0.2

version.com.google.inject..guice-bom=5.0.1
version.com.google.inject..guice-bom=5.1.0

version.commons-io..commons-io=2.11.0

version.javax..javaee-api=8.0.1

version.junit.junit=4.13.2

version.mockito=4.2.0
version.mockito=4.4.0

version.org.apache-extras.beanshell..bsh=2.0b6

version.org.apache.ant..ant-testutil=1.10.12

version.org.apache.ant..ant=1.10.12

version.org.apache.felix..org.apache.felix.framework=7.0.0
version.org.apache.felix..org.apache.felix.framework=7.0.3

version.org.assertj..assertj-core=3.22.0

version.org.codehaus.groovy..groovy-all=2.4.7
version.org.codehaus.groovy..groovy-all=3.0.10

version.org.jboss.shrinkwrap..shrinkwrap-api=1.2.6
## # available=2.0.0-beta-1

version.org.jboss.shrinkwrap..shrinkwrap-impl-base=1.2.6

version.org.mockito..mockito-core=2.12.0
## # available=2.0.0-beta-1

version.org.ops4j.pax.exam..pax-exam-container-native=4.13.1

Expand All @@ -57,15 +83,51 @@ version.org.ops4j.pax.exam..pax-exam-testng=4.13.1

version.org.ops4j.pax.url..pax-url-aether=2.6.1

version.org.spockframework..spock-core=1.0-groovy-2.4
version.org.spockframework..spock-core=2.1-groovy-3.0
## # available=2.1-M1-groovy-2.5
## # available=2.1-M1-groovy-3.0
## # available=2.1-M2-groovy-2.5
## # available=2.1-M2-groovy-3.0
## # available=2.2-M1-groovy-2.5
## # available=2.2-M1-groovy-3.0
## # available=2.2-M1-groovy-4.0

version.org.webjars..jquery=3.5.1
## # available=3.6.0
version.org.webjars..jquery=3.6.0

version.org.xmlunit..xmlunit-assertj=2.8.4
version.org.xmlunit..xmlunit-assertj=2.9.0

version.org.yaml..snakeyaml=1.30

version.org.slf4j..slf4j-simple=1.7.32

version.org.slf4j..slf4j-api=1.7.32
version.org.slf4j..slf4j-simple=1.7.36
## # available=1.8.0-alpha0
## # available=1.8.0-alpha1
## # available=1.8.0-alpha2
## # available=1.8.0-beta0
## # available=1.8.0-beta1
## # available=1.8.0-beta2
## # available=1.8.0-beta4
## # available=2.0.0-alpha0
## # available=2.0.0-alpha1
## # available=2.0.0-alpha2
## # available=2.0.0-alpha3
## # available=2.0.0-alpha4
## # available=2.0.0-alpha5
## # available=2.0.0-alpha6
## # available=2.0.0-alpha7

version.org.slf4j..slf4j-api=1.7.36
## # available=1.8.0-alpha0
## # available=1.8.0-alpha1
## # available=1.8.0-alpha2
## # available=1.8.0-beta0
## # available=1.8.0-beta1
## # available=1.8.0-beta2
## # available=1.8.0-beta4
## # available=2.0.0-alpha0
## # available=2.0.0-alpha1
## # available=2.0.0-alpha2
## # available=2.0.0-alpha3
## # available=2.0.0-alpha4
## # available=2.0.0-alpha5
## # available=2.0.0-alpha6
## # available=2.0.0-alpha7