Skip to content

Commit

Permalink
Update Concurrency TCK test suite to service release 3.0.2 (#21907)
Browse files Browse the repository at this point in the history
* WIP - updates for new concurrency tck

* ensure seperate files

* switch over to published artifacts

* update documentation and TODOs

* feedback changes - comments only

* merge conflicts
  • Loading branch information
KyleAure authored Sep 23, 2022
1 parent 6f1b08f commit 751f456
Show file tree
Hide file tree
Showing 20 changed files with 551 additions and 230 deletions.
6 changes: 3 additions & 3 deletions dev/io.openliberty.jakarta.concurrency.3.0_fat_tck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cd concurrency-api
mvn clean install
```

The API and TCK libraries will be tagged with the `3.0.0-SNAPSHOT` version. Keep this in mind if you plan to follow the [Running the TCK for Verification](#Running-the-TCK-for-Verification) section.
The API and TCK libraries will be tagged with the `3.0.2-SNAPSHOT` version. Keep this in mind if you plan to follow the [Running the TCK for Verification](#Running-the-TCK-for-Verification) section.

### Getting Open Liberty

Expand Down Expand Up @@ -124,11 +124,11 @@ mvn clean test -B \
```

By default the TCK will run against a staged version of Jakarta API and TCK uploaded to sonatype.
If you want to test against a local `3.0.0-SNAPSHOT` then set these properties on the command above:
If you want to test against a local `3.0.2-SNAPSHOT` then set these properties on the command above:

```txt
-Djakarta.concurrent.tck.groupid=jakarta.enterprise.concurrent \
-Djakarta.concurrent.tck.version=3.0.0-SNAPSHOT
-Djakarta.concurrent.tck.version=3.0.2-SNAPSHOT
```

Finally, remember to stop the running server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {

arquillian 'io.openliberty.arquillian:arquillian-liberty-support-jakarta:2.0.1'

//TODO configure WLP dependency, Example below:
//TODO Configure WLP dependency if doing verification testing, Example below:
//wlp 'io.openliberty.beta:openliberty-runtime:22.0.0.3-beta@zip'
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*******************************************************************************
* Copyright (c) 2022 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package io.openliberty.jakarta.enterprise.concurrent.tck;

import static org.junit.Assert.assertEquals;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.ibm.websphere.simplicity.PortType;

import componenttest.annotation.AllowedFFDC;
import componenttest.annotation.MinimumJavaLevel;
import componenttest.annotation.Server;
import componenttest.custom.junit.runner.FATRunner;
import componenttest.topology.impl.LibertyServer;
import componenttest.topology.utils.MvnUtils;

/**
* This is a test class that runs the entire Jakarta Concurrency TCK against Full Profile.
*
* The TCK results are copied in the results/junit directory before the Simplicity FAT framework
* generates the html report - so there is detailed information on individual
* tests as if they were running as simplicity junit FAT tests in the standard location.
*/
@RunWith(FATRunner.class)
@MinimumJavaLevel(javaLevel = 11)
public class ConcurrentTckLauncherFull {

final static Map<String, String> additionalProps = new HashMap<>();

private static String suiteXmlFile = "tck-suite-full.xml"; //Default value

@Server("ConcurrentTCKFullServer")
public static LibertyServer server;

@BeforeClass
public static void setUp() throws Exception {
//UNCOMMENT - To test against a local snapshot of TCK
// additionalProps.put("jakarta.concurrent.tck.groupid", "jakarta.enterprise.concurrent");
// additionalProps.put("jakarta.concurrent.tck.version", "3.0.2-SNAPSHOT");

//username and password for Arquillian to authenticate to restConnect
additionalProps.put("tck_username", "arquillian");
additionalProps.put("tck_password", "arquillianPassword");

//Logging properties for java.util.logging to use for mvn output
additionalProps.put("java.util.logging.config.file", server.getServerRoot() + "/resources/logging/logging.properties");

//username and password to set on quickStartSecurity
server.addEnvVar("tck_username", "arquillian");
server.addEnvVar("tck_password", "arquillianPassword");

//Ports liberty should be using for testing
server.addEnvVar("tck_port", "" + server.getPort(PortType.WC_defaulthost));
server.addEnvVar("tck_port_secure", "" + server.getPort(PortType.WC_defaulthost_secure));

Map<String, String> opts = server.getJvmOptionsAsMap();
//Path that jimage will output modules for signature testing
opts.put("-Djimage.dir", server.getServerSharedPath() + "jimage/output/");
server.setJvmOptions(opts);

//Finally start the server
server.startServer();
}

@AfterClass
public static void tearDown() throws Exception {
server.stopServer(
"WLTC0032W", //Transaction rollback warning.
"WLTC0033W", //Transaction rollback warning.
"CWWKS0901E" //Quickstart security
);
}

/**
* Run the TCK (controlled by autoFVT/publish/tckRunner/tck/*)
*/
@Test
@AllowedFFDC // The tested exceptions cause FFDC so we have to allow for this.
public void launchConcurrentTCK() throws Exception {

suiteXmlFile = FATSuite.createSuiteXML(FATSuite.PROFILE.FULL);

Map<String, String> resultInfo = MvnUtils.getResultInfo(server);

/**
* The runTCKMvnCmd will set the following properties for use by arquillian
* [ wlp, tck_server, tck_port, tck_failSafeUndeployment, tck_appDeployTimeout, tck_appUndeployTimeout ]
* and then run the mvn test command.
*/
int result = MvnUtils.runTCKMvnCmd(
server, //server to run on
"io.openliberty.jakarta.concurrency.3.0_fat_tck", //bucket name
this.getClass() + ":launchConcurrentTCK", //launching method
suiteXmlFile, //tck suite
additionalProps, //additional props
Collections.emptySet() //additional jars
);

resultInfo.put("results_type", "Jakarta");
resultInfo.put("feature_name", "Concurrency");
resultInfo.put("feature_version", "3.0-full");
MvnUtils.preparePublicationFile(resultInfo);
assertEquals(0, result);
}
}
Loading

0 comments on commit 751f456

Please sign in to comment.