-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - updates for new concurrency tck
- Loading branch information
Showing
18 changed files
with
417 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
...ck/fat/src/io/openliberty/jakarta/enterprise/concurrent/tck/ConcurrentTckLauncherWeb.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 whole Jakarta Concurrency TCK. 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 ConcurrentTckLauncherWeb { | ||
|
||
final static Map<String, String> additionalProps = new HashMap<>(); | ||
|
||
private static String suiteXmlFile = "tck-suite-web.xml"; //Default value | ||
|
||
@Server("ConcurrentTCKWebServer") | ||
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"); //TODO comment out once 3.0.2 is on maven central | ||
|
||
//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.WEB); | ||
|
||
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-Web"); | ||
MvnUtils.preparePublicationFile(resultInfo); | ||
assertEquals(0, result); | ||
} | ||
} |
Oops, something went wrong.