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

EL TCK Refactoring using Junit #1164

Merged
merged 8 commits into from
Jun 12, 2023
Merged
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
11 changes: 8 additions & 3 deletions el/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
<version>10.0.0-SNAPSHOT</version>
</parent>

<artifactId>el</artifactId>
<artifactId>el-tck</artifactId>
<packaging>jar</packaging>

<name>el</name>
<description>el</description>
<name>el-tck</name>
<description>EL TCK</description>

<dependencies>
<dependency>
Expand All @@ -46,6 +46,11 @@
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>

</project>
22 changes: 0 additions & 22 deletions el/src/main/java/com/sun/ts/tests/el/api/build.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

import java.util.Properties;

import com.sun.javatest.Status;
import com.sun.ts.lib.harness.ServiceEETest;
import com.sun.ts.lib.util.TestUtil;
import com.sun.ts.tests.common.el.api.resolver.ResolverTest;
import com.sun.ts.tests.el.common.elcontext.BareBonesELContext;
Expand All @@ -33,26 +31,34 @@
import jakarta.el.ArrayELResolver;
import jakarta.el.ELContext;

public class ELClient extends ServiceEETest {
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;

private Properties testProps;
import java.lang.System.Logger;


public class ELClientIT {

private static final Logger logger = System.getLogger(ELClientIT.class.getName());

private static final String[] names = { "doug", "nick", "roger", "ryan",
"ed" };

public static void main(String[] args) {
ELClient theTests = new ELClient();
Status s = theTests.run(args, System.out, System.err);
s.exit();
@AfterEach
public void cleanup() throws Exception {
logger.log(Logger.Level.INFO, "Cleanup method called");
}

public void setup(String[] args, Properties p) throws Exception {
TestUtil.logTrace("Setup method called");
this.testProps = p;
@BeforeEach
void logStartTest(TestInfo testInfo) {
logger.log(Logger.Level.INFO, "STARTING TEST : "+testInfo.getDisplayName());
}

public void cleanup() throws Exception {
TestUtil.logTrace("Cleanup method called");
@AfterEach
void logFinishTest(TestInfo testInfo) {
logger.log(Logger.Level.INFO, "FINISHED TEST : "+testInfo.getDisplayName());
}

/**
Expand All @@ -65,6 +71,7 @@ public void cleanup() throws Exception {
* getValue() getType() setValue() isReadOnly()
* getCommonPropertyType() getFeatureDescriptors()
*/
@Test
public void arrayELResolverTest() throws Exception {

boolean pass;
Expand All @@ -85,7 +92,7 @@ public void arrayELResolverTest() throws Exception {
if (!pass) {
throw new Exception(ELTestUtil.FAIL + buf.toString());
}
TestUtil.logTrace(buf.toString());
logger.log(Logger.Level.TRACE, buf.toString());
}

/**
Expand All @@ -100,6 +107,7 @@ public void arrayELResolverTest() throws Exception {
*
* getValue() getType() setValue() isReadOnly()
*/
@Test
public void arrayELResolverNPETest() throws Exception {

boolean pass;
Expand All @@ -117,7 +125,7 @@ public void arrayELResolverNPETest() throws Exception {
if (!pass) {
throw new Exception(ELTestUtil.FAIL + buf.toString());
}
TestUtil.logTrace(buf.toString());
logger.log(Logger.Level.TRACE, buf.toString());
}

/**
Expand All @@ -132,6 +140,7 @@ public void arrayELResolverNPETest() throws Exception {
*
* getType() isReadOnly() setValue()
*/
@Test
public void arrayELResolverPNFETest() throws Exception {

boolean pass;
Expand All @@ -152,7 +161,7 @@ public void arrayELResolverPNFETest() throws Exception {
if (!pass) {
throw new Exception(ELTestUtil.FAIL + buf.toString());
}
TestUtil.logTrace(buf.toString());
logger.log(Logger.Level.TRACE, buf.toString());
}

/**
Expand All @@ -167,6 +176,7 @@ public void arrayELResolverPNFETest() throws Exception {
*
* getValue() setValue()
*/
@Test
public void arrayELResolverIAETest() throws Exception {

boolean pass;
Expand All @@ -186,7 +196,7 @@ public void arrayELResolverIAETest() throws Exception {
if (!pass) {
throw new Exception(ELTestUtil.FAIL + buf.toString());
}
TestUtil.logTrace(buf.toString());
logger.log(Logger.Level.INFO, buf.toString());
}

/**
Expand All @@ -202,6 +212,7 @@ public void arrayELResolverIAETest() throws Exception {
*
* ArrayELResolver(boolean) setValue()
*/
@Test
public void arrayELResolverPNWETest() throws Exception {

boolean pass;
Expand All @@ -222,7 +233,7 @@ public void arrayELResolverPNWETest() throws Exception {
if (!pass) {
throw new Exception(ELTestUtil.FAIL + buf.toString());
}
TestUtil.logTrace(buf.toString());
logger.log(Logger.Level.TRACE, buf.toString());
}

/*
Expand All @@ -235,6 +246,7 @@ public void arrayELResolverPNWETest() throws Exception {
*
* getValue()
*/
@Test
public void arrayELResolverOBETest() throws Exception {

boolean pass = true;
Expand Down Expand Up @@ -273,6 +285,7 @@ public void arrayELResolverOBETest() throws Exception {
*
* setValue()
*/
@Test
public void arrayELResolverCCETest() throws Exception {

boolean pass = false;
Expand All @@ -288,7 +301,7 @@ public void arrayELResolverCCETest() throws Exception {
pass = true;

} catch (Exception e) {
TestUtil.logErr(
logger.log(Logger.Level.ERROR,
"Failed: Exception thrown but was not a " + "ClassCastException");
throw new Exception(e);
}
Expand Down

This file was deleted.

Loading