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

Update dependencies to work with Java 17 #100

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,39 @@

<repositories>
<repository>
<id>saucelabs-repository</id>
<url>https://repository-saucelabs.forge.cloudbees.com/release</url>
<id>wso2.releases</id>
<name>WSO2 Releases Repository</name>
<url>https://maven.wso2.org/nexus/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>

<!-- WSO2 Snapshot artifact repository -->
<repository>
<id>wso2.snapshots</id>
<name>WSO2 Snapshot Repository</name>
<url>https://maven.wso2.org/nexus/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>

<repository>
<id>wso2-nexus</id>
<name>WSO2 internal Repository</name>
<url>https://maven.wso2.org/nexus/content/groups/wso2-public/</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
</repository>
</repositories>

Expand Down Expand Up @@ -386,8 +411,8 @@
<axis2.wso2.version>1.6.1-wso2v37</axis2.wso2.version>

<!-- Other dependencies -->
<testng.version>6.1.1</testng.version>
<jacoco.core.version>0.7.5.201505241946</jacoco.core.version>
<testng.version>7.10.1</testng.version>
<jacoco.core.version>0.8.12</jacoco.core.version>
<org.codehaus.plexus.version>3.0.22</org.codehaus.plexus.version>
<commons.collections.version>3.2.1</commons.collections.version>
<lingala.zip4j.version>1.2.3</lingala.zip4j.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.1.201405082137</version>
<version>${jacoco.core.version}</version>
<executions>
<execution>
<id>default-prepare-agent</id>
Expand All @@ -58,7 +58,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<version>3.2.5</version>
<executions>
<execution>
<id>default-test</id>
Expand All @@ -72,7 +72,7 @@
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<argLine>
-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/0.7.1.201405082137/org.jacoco.agent-0.7.1.201405082137-runtime.jar=destfile=${project.build.directory}/jacoco.exec
-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.core.version}/org.jacoco.agent-${jacoco.core.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec
</argLine>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,26 @@ private static boolean waitForCoverageDumpFileCreation(File file) {

while (waitTime > System.currentTimeMillis()) {
if (file.length() > 0) {
long length1 = file.length();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
log.warn("Sleep interrupted ", e);
}
long length2 = file.length();
if (length1 != length2) {
log.info("Execution data file non empty file " + file.getAbsolutePath() +
" is still being written.");
try {
Thread.sleep(400);
} catch (InterruptedException e) {
log.warn("Sleep interrupted ", e);
}
continue;
}
status = true;
log.info("Execution data file non empty file size in KB : " + file.length() / 1024);
log.info("Execution data file non empty file " + file.getAbsolutePath() + " size in KB : " +
file.length() / 1024);
break;
} else {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.testng.IAnnotationTransformer;
import org.testng.IAnnotationTransformer2;
import org.testng.annotations.IConfigurationAnnotation;
import org.testng.annotations.IDataProviderAnnotation;
import org.testng.annotations.IFactoryAnnotation;
Expand All @@ -39,7 +38,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

public class TestTransformerListener implements IAnnotationTransformer, IAnnotationTransformer2 {
public class TestTransformerListener implements IAnnotationTransformer {

private static final Log log = LogFactory.getLog(TestTransformerListener.class);
private AutomationContext context;
Expand Down Expand Up @@ -160,4 +159,4 @@ public void transform(IDataProviderAnnotation iDataProviderAnnotation, Method me
public void transform(IFactoryAnnotation iFactoryAnnotation, Method method) {
//To change body of implemented methods use File | Settings | File Templates.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

package org.wso2.carbon.automation.engine.test.context;

import junit.framework.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
import org.testng.Assert;
import org.wso2.carbon.automation.engine.context.AutomationContext;
import org.wso2.carbon.automation.engine.context.TestUserMode;

Expand Down Expand Up @@ -54,7 +54,8 @@ public void testDefaultInstance() throws XPathExpressionException {

@Test(groups = "context.unit.test", description = "Upload aar service and verify deployment")
public void testGetSuperTenant() throws XPathExpressionException {
Assert.assertTrue(context.getSuperTenant().getTenantAdmin().getUserName().equals("admin"));

Assert.assertEquals(context.getSuperTenant().getTenantAdmin().getUserName(), "admin");
}

@Test(groups = "context.unit.test", description = "Upload aar service and verify deployment")
Expand All @@ -73,11 +74,15 @@ public void testGetConfigValue() throws XPathExpressionException {
}
@Test(groups = "context.unit.test", description = "Upload aar service and verify deployment")
public void testGetConfigNode() throws XPathExpressionException {
Assert.assertTrue(context.getConfigurationNode("//datasources/datasource[@name='dataService']").getChildNodes().item(2).getNodeName().equals("password"));

Assert.assertEquals(
context.getConfigurationNode("//datasources/datasource[@name='dataService']").getChildNodes().item(2)
.getNodeName(), "password");
}
@Test(groups = "context.unit.test", description = "Upload aar service and verify deployment")
public void testGetCofigNodeList() throws XPathExpressionException {
Assert.assertTrue(context.getConfigurationNodeList("//datasources/datasource").getLength()==2);

Assert.assertEquals(context.getConfigurationNodeList("//datasources/datasource").getLength(), 2);
}
@Test(groups = "context.unit.test", description = "Upload aar service and verify deployment")
public void testGetDefaultInstance() throws XPathExpressionException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<version>3.3.0</version>
<executions>
<execution>
<id>default-test</id>
Expand All @@ -47,7 +47,12 @@
</execution>
</executions>
<configuration>
<argLine>-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m</argLine>
<argLine>
-Xmx1024m
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED
</argLine>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<suiteXmlFiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<version>3.3.0</version>
<executions>
<execution>
<id>default-test</id>
Expand All @@ -60,6 +60,10 @@


<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
Expand Down