- -Listed below are jakarta.activation components that we have API tests for. - -
-@@ -27,36 +30,29 @@ * initiates objects of type CommandInfo then testcase passes otherwise it fails. */ -public class CommandInfo_Test implements Test +public class CommandInfo_Test { private String message = null; - private DataHandler dh = null; - public PrintWriter outLog; - public PrintWriter outConsole; - public Status status; + public Status status; - public static void main(String argv[]) + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } + + public Status test() { - CommandInfo_Test lTest = new CommandInfo_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } - - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) - { - this.outLog = outLog; // Test with a CommandObject String verb = "view"; String className = "javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject"; - outLog.println("UNIT TEST: CommandInfo(verb, className)"); - CommandInfo cInfo = new CommandInfo(verb, className); // API TEST if (!validateInfo(cInfo, verb, className)) return Status.failed(message); - outLog.println("UNIT TEST: passed\n"); status = Status.passed("CommandInfo Test succeeded"); return status; } diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandClass_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandClass_Test.java similarity index 77% rename from tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandClass_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandClass_Test.java index 31c616c..cbc660b 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandClass_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandClass_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.CommandInfo; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; /** FileTypeMap is an abstract class. The main functional testing is in the only * provided concrete implementation, MimetypesFileTypeMap, tested separately.
@@ -27,19 +30,18 @@ * otherwise it fails. */ -public class getCommandClass_Test implements Test +public class getCommandClass_Test { private String message = null; - public PrintWriter outConsole; - public static void main(String argv[]) - { - getCommandClass_Test lTest = new getCommandClass_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + public Status test() { // Test with a CommandObject String verb = "view"; diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandName_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandName_Test.java similarity index 71% rename from tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandName_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandName_Test.java index fca48ba..c697c52 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandName_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandName_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.CommandInfo; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; /** FileTypeMap is an abstract class. The main functional testing is in the only * provided concrete implementation, MimetypesFileTypeMap, tested separately.
@@ -27,34 +30,28 @@ * api if it returns the expected value then this testcase passes otherwsie it fails. */ -public class getCommandName_Test implements Test +public class getCommandName_Test { private String message = null; - public PrintWriter outLog; - public PrintWriter outConsole; - public static void main(String argv[]) - { - getCommandName_Test lTest = new getCommandName_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + public Status test() { - this.outLog = outLog; // Test with a CommandObject String verb = "view"; String className = "javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject"; CommandInfo cInfo = new CommandInfo(verb, className); - outLog.println("UNIT TEST: getCommandName()"); - if (!validateInfo(cInfo, verb, className)) return Status.failed(message); - outLog.println("UNIT TEST: passed\n"); return Status.passed("getCommandName() Test succeeded"); } diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandObject_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandObject_Test.java similarity index 87% rename from tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandObject_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandObject_Test.java index 3236b7f..9f6a69f 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandInfo/getCommandObject_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandInfo/getCommandObject_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,21 @@ package javasoft.sqe.tests.api.jakarta.activation.CommandInfo; -import java.io.*; -import java.net.URL; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; import java.net.MalformedURLException; +import java.net.URL; import java.net.URLClassLoader; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.CommandObject; +import jakarta.activation.DataHandler; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestNoBeans; /** * Create a CommandInfo object using one its contructors, then invoke @@ -30,23 +38,20 @@ * passes otherwise it fails. */ -public class getCommandObject_Test implements Test +public class getCommandObject_Test { private String message = null; private DataHandler dh = null; - public PrintWriter outLog; - public PrintWriter outConsole; - public static void main(String argv[]) - { - getCommandObject_Test lTest = new getCommandObject_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + public Status test() { - this.outLog = outLog; // Test with a CommandObject String verb = "view"; String className = "javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject"; @@ -57,7 +62,6 @@ public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) return Status.failed(message); Object obj = null; - outLog.println("UNIT TEST 1: getCommandObject(DataHandler, ClassLoader)"); try { obj = cInfo.getCommandObject(dh, this.getClass().getClassLoader()); // API TEST @@ -67,10 +71,6 @@ public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) return Status.failed("getCommandObject() unexpected throw: " + ioex.toString()); } - outLog.println("UNIT TEST 1: passed\n"); - - outLog.println("UNIT TEST 2: getCommandObject(DataHandler, ClassLoader) no java.beans.Beans"); - /* * Check that CommandInfo.getCommandObject can create a * command object even in an environment without @@ -91,8 +91,6 @@ public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) if (!fcl.getFiltered()) return Status.failed("getCommandObject() failed to filter"); - - outLog.println("UNIT TEST 2: passed\n"); return Status.passed("getCommandObject() Test succeeded"); } diff --git a/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/createDataContentHandler_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/createDataContentHandler_Test.java new file mode 100644 index 0000000..c9e75e4 --- /dev/null +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/createDataContentHandler_Test.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0, which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * This Source Code may also be made available under the following Secondary + * Licenses when the conditions for such availability set forth in the + * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, + * version 2 with the GNU Classpath Exception, which is available at + * https://www.gnu.org/software/classpath/license.html. + * + * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + */ + +package javasoft.sqe.tests.api.jakarta.activation.CommandMap; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandMap; +import jakarta.activation.DataContentHandler; +import jakarta.activation.MailcapCommandMap; + +/** CommandMap is an abstract class. The main functional testing is in the only + * provided concrete implementation, MailcapCommandMap, done separately.
+ * We get default CommandMap objedct then using it call createDataContentHandler() + * api with string parameter. If this call returns a non-null DataContentHandler + * object then this testcase passes otherwise it fails. + */ + +public class createDataContentHandler_Test +{ + @Disabled("createDataContentHandler_Test was disabled in ts.jtx") + @Test + public void disabled() + { + Status s = run(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } + + public Status run() + { + // does getDefaultCommandMap return a MailcapCommandMap ? + CommandMap lCommandMap = CommandMap.getDefaultCommandMap(); + + if (!(lCommandMap instanceof MailcapCommandMap)) + return Status.failed("getDefaultCommandMap() did not return MailcapCommandMap"); + + DataContentHandler dch = lCommandMap.createDataContentHandler("text/plain"); //API TEST + + if( dch == null ) + return Status.failed("createDataContentHandler failed to return DataContentHandler object!"); + + return Status.passed("createDataContentHandler() Test succeeded"); + } +} diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getAllCommands_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getAllCommands_Test.java similarity index 73% rename from tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getAllCommands_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getAllCommands_Test.java index 7920f5f..be95bce 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getAllCommands_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getAllCommands_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.CommandMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.CommandMap; +import jakarta.activation.MailcapCommandMap; /** CommandMap is an abstract class. The main functional testing is in the only * provided concrete implementation, MailcapCommandMap, done separately.
@@ -28,16 +33,16 @@ * array object then this testcase passes otherwise it fails. */ -public class getAllCommands_Test implements Test +public class getAllCommands_Test { - public static void main(String argv[]) - { - getAllCommands_Test lTest = new getAllCommands_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } - - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } + + public Status test() { // does getDefaultCommandMap return a MailcapCommandMap? CommandMap lCommandMap = CommandMap.getDefaultCommandMap(); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getCommand_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getCommand_Test.java similarity index 75% rename from tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getCommand_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getCommand_Test.java index a0e843e..c477f13 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getCommand_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getCommand_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.CommandMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.CommandMap; +import jakarta.activation.MailcapCommandMap; /** CommandMap is an abstract class. The main functional testing is in the only * provided concrete implementation, MailcapCommandMap, done separately.
@@ -27,16 +32,16 @@ * of type CommandInfo then this testcase passes, otherwise it fails. */ -public class getCommand_Test implements Test +public class getCommand_Test { - public static void main(String argv[]) - { - getCommand_Test lTest = new getCommand_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + public Status test() { // We are not going to require any 'default' viewer objects, // We will explicitly create a commandmap with one. diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getDefaultCommandMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getDefaultCommandMap_Test.java similarity index 77% rename from tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getDefaultCommandMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getDefaultCommandMap_Test.java index 4ef8d30..dec30dd 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getDefaultCommandMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getDefaultCommandMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.CommandMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandMap; +import jakarta.activation.MailcapCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; /** CommandMap is an abstract class. The main functional testing is in the only * provided concrete implementation, MailcapCommandMap, done separately.
@@ -28,16 +33,16 @@ * testcase passes otherwise it fails. */ -public class getDefaultCommandMap_Test implements Test +public class getDefaultCommandMap_Test { - public static void main(String argv[]) - { - getDefaultCommandMap_Test lTest = new getDefaultCommandMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + public Status test() { // does getDefaultCommandMap return a MailcapCommandMap? CommandMap lCommandMap = CommandMap.getDefaultCommandMap(); // API TEST diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getPreferredCommands_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getPreferredCommands_Test.java similarity index 73% rename from tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getPreferredCommands_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getPreferredCommands_Test.java index 9ec6a17..fc4344e 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/getPreferredCommands_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/getPreferredCommands_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.CommandMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.CommandMap; +import jakarta.activation.MailcapCommandMap; /** CommandMap is an abstract class. The main functional testing is in the only * provided concrete implementation, MailcapCommandMap, done separately.
@@ -28,16 +33,16 @@ * CommandInfo array object then this testcase passes otherwise it fails. */ -public class getPreferredCommands_Test implements Test +public class getPreferredCommands_Test { - public static void main(String argv[]) - { - getPreferredCommands_Test lTest = new getPreferredCommands_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } - - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } + + public Status test() { // does getDefaultCommandMap return a MailcapCommandMap? CommandMap lCommandMap = CommandMap.getDefaultCommandMap(); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/setDefaultCommandMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/setDefaultCommandMap_Test.java similarity index 77% rename from tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/setDefaultCommandMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/setDefaultCommandMap_Test.java index ddc8f79..7df7a21 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/CommandMap/setDefaultCommandMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/CommandMap/setDefaultCommandMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.CommandMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandMap; +import jakarta.activation.MailcapCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; /** CommandMap is an abstract class. The main functional testing is in the only * provided concrete implementation, MailcapCommandMap, done separately.
@@ -28,16 +33,16 @@ * then this testcase passes otherwise it fails. */ -public class setDefaultCommandMap_Test implements Test +public class setDefaultCommandMap_Test { - public static void main(String argv[]) - { - setDefaultCommandMap_Test lTest = new setDefaultCommandMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + public Status test() { // does getDefaultCommandMap return a MailcapCommandMap? CommandMap lCommandMap = CommandMap.getDefaultCommandMap(); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/DataHandler_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/DataHandler_Test.java similarity index 85% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/DataHandler_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/DataHandler_Test.java index 3661cc1..20dd0c6 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/DataHandler_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/DataHandler_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,19 +16,30 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import java.net.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; +import jakarta.activation.URLDataSource; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** * Invoke all constructors to create DataHandler objects. If these operations * are successfull then this testcase passes otherwise it fails. */ -public class DataHandler_Test extends MultiTest +public class DataHandler_Test { private static final String kFileName = "foo.txt"; @@ -39,13 +50,12 @@ public class DataHandler_Test extends MultiTest private DataHandler objdh = null; // a DataHandler created from an Object/mimeType private DataSource objds = null; // DataSource returned from getDataSource for the Object case -public static void main(String argv[]) +@Test +public void testDataHandlerTest1() { - DataHandler_Test lTest = new DataHandler_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = dataHandlerTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } - /** * dataHandlerTest1: a contructor test for DataHandler(DataSource); * @@ -72,6 +82,14 @@ public Status dataHandlerTest1() return Status.passed("DataHandler(DataSource) test succeeded"); } + +@Test +public void testDataHandlerTest2() +{ + Status s = dataHandlerTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + /** * dataHandlerTest2: test a contructor DataHandler(String, String); * @@ -126,6 +144,14 @@ public Status dataHandlerTest2() return Status.passed("DataHandler(Object, String) test succeeded"); } + +@Test +public void testDataHandlerTest3() +{ + Status s = dataHandlerTest3(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + /** * dataHandlerTest3: attempt to construct a DataSource that cannot provide an output stream * test for appropriate exception from DataHandler.getOutputStream @@ -166,6 +192,14 @@ public Status dataHandlerTest3() } return Status.passed("DataHandler(DataSource) test succeeded"); } + +@Test +public void testDataHandlerTest4() throws IOException +{ + Status s = dataHandlerTest4(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + /** * dataHandlerTest4: attempt to constrcut a DataSource that cannot provide an input stream * test for appropriate exception from DataHandler.getInputStream, writeTo (which copies @@ -220,6 +254,14 @@ public Status dataHandlerTest4() throws IOException } return Status.passed("DataHandler(DataSource) test succeeded"); } + +@Test +public void testDataHandlerTest5() throws IOException +{ + Status s = dataHandlerTest5(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + /** * dataHandlerTest5: Test the DataHandler(URL) constructor. This is just a convenience for * DataHandler(new URLDataSource(URL)). Since DataHandler's correct use of DataSource diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getAllCommands_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getAllCommands_Test.java similarity index 76% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getAllCommands_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getAllCommands_Test.java index 2fb1f2f..96e955d 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getAllCommands_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getAllCommands_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,29 +16,30 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.CommandMap; +import jakarta.activation.DataHandler; +import jakarta.activation.FileDataSource; +import jakarta.activation.MailcapCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** Create a DataHandler object then use it to invoke getAllCommands() api, * if returns non-null array object containing all commands for the type * of data represented in the DataHandler, then this testcase passes. */ -public class getAllCommands_Test extends MultiTest +public class getAllCommands_Test { private static final String kFileName = "foo.txt"; private String message = null; -public static void main(String argv[]) -{ - getAllCommands_Test lTest = new getAllCommands_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} - private boolean checkCmdInfo(CommandInfo cmdInfo, String verb, String className) { if (cmdInfo == null) { @@ -55,6 +56,14 @@ private boolean checkCmdInfo(CommandInfo cmdInfo, String verb, String className) } return true; } + +@Test +public void testGetAllCommandsTest1() +{ + Status s = getAllCommandsTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + /* * getAllCommandsTest1: Test for getAllCommands() method. */ @@ -79,6 +88,14 @@ public Status getAllCommandsTest1() return Status.passed("getAllCommands() test succeeded"); } + +@Test +public void testGetAllCommandsTest2() +{ + Status s = getAllCommandsTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + /* * getAllCommandsTest2: Another Test for getAllCommands() method. */ diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getBean_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getBean_Test.java similarity index 75% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getBean_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getBean_Test.java index d7227e8..3c173a2 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getBean_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getBean_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,26 +16,30 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.DataHandler; /** Create a DataHandler object then use it to invoke getBean() api, * if it returns a non-null Object then this testcase passes, * otherwise it fails. */ -public class getBean_Test implements Test +public class getBean_Test { - public static void main(String argv[]) - { - getBean_Test lTest = new getBean_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + public Status test() { String verb = "view"; String className = "javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject"; diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getCommand_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getCommand_Test.java similarity index 84% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getCommand_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getCommand_Test.java index 7918556..94c1a69 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getCommand_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getCommand_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,29 +16,30 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.CommandMap; +import jakarta.activation.DataHandler; +import jakarta.activation.FileDataSource; +import jakarta.activation.MailcapCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** Create a DataHandler object then use it to invoke getCommand() api, * if this call returns a CommandInfo for specified command name, then * this testcase passes, otherwise it fails. */ -public class getCommand_Test extends MultiTest +public class getCommand_Test { private static final String kFileName = "foo.txt"; private String message = null; -public static void main(String argv[]) -{ - getCommand_Test lTest = new getCommand_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} - private boolean checkCmdInfo(CommandInfo cmdInfo, String verb, String className) { if (cmdInfo == null) { @@ -56,6 +57,13 @@ private boolean checkCmdInfo(CommandInfo cmdInfo, String verb, String className) return true; } +@Test +public void testGetCommandTest1() +{ + Status s = getCommandTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + /** * getCommandTest1: Test the behavior of the CommandMap wrapper calls when using the default * command map. We need to have a know mapping to validate, so first, we install a default @@ -104,6 +112,14 @@ public Status getCommandTest1() return Status.passed("getCommand(String) test succeeded"); } + +@Test +public void testGetCommandTest2() +{ + Status s = getCommandTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + /** * getCommandTest2: Test the behavior of the CommandMap wrapper calls when using a custom * CommandMap. For variation from the defaultCommandMapTest above, we'll use diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getContentType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getContentType_Test.java similarity index 81% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getContentType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getContentType_Test.java index ebaa155..b63b10d 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getContentType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getContentType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; /** * Create DataHandler objects with mimetype string, then use it to call @@ -27,7 +32,7 @@ * this testcase passes otherwise it fails. */ -public class getContentType_Test extends MultiTest +public class getContentType_Test { private static final String kFileName = "foo.txt"; @@ -39,11 +44,11 @@ public class getContentType_Test extends MultiTest private DataHandler objdh = null; // a DataHandler created from an Object/mimeType private DataSource objds = null; // DataSource returned from getDataSource for the Object case -public static void main(String argv[]) +@Test +public void testGetContentTypeTest1() { - getContentType_Test lTest = new getContentType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getContentTypeTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getContentTypeTest1() @@ -58,6 +63,13 @@ public Status getContentTypeTest1() return Status.passed("getContentType() test succeeded"); } +@Test +public void testGetContentTypeTest2() +{ + Status s = getContentTypeTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status getContentTypeTest2() { obj = new Object(); // just a random object diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getContent_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getContent_Test.java similarity index 71% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getContent_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getContent_Test.java index 59d1241..80fcff9 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getContent_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getContent_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,26 +16,30 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataHandler; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** * Create a DataHandler object then use it to call getContent() api, * if this method returns non-null Object then this testcase passes. */ -public class getContent_Test implements Test +public class getContent_Test { - public static void main(String argv[]) - { - getContent_Test lTest = new getContent_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); - } - - public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) + @Test + public void run() + { + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } + + public Status test() { try { // create a DataHandler object diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getDataSource_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getDataSource_Test.java similarity index 78% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getDataSource_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getDataSource_Test.java index e4fc42a..7982d39 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getDataSource_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getDataSource_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,19 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; import java.net.URL; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; +import jakarta.activation.URLDataSource; /** * Create a DataHandler object pass it various types of strings then @@ -28,7 +36,7 @@ * successfully returns DataSource objects then this testcase passes. */ -public class getDataSource_Test extends MultiTest +public class getDataSource_Test { private static final String kFileName = "foo.txt"; @@ -40,11 +48,11 @@ public class getDataSource_Test extends MultiTest private DataHandler objdh = null; // a DataHandler created from an Object/mimeType private DataSource objds = null; // DataSource returned from getDataSource for the Object case -public static void main(String argv[]) +@Test +public void testGetDataSourceTest1() throws IOException { - getDataSource_Test lTest = new getDataSource_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getDataSourceTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getDataSourceTest1() throws IOException @@ -62,6 +70,13 @@ public Status getDataSourceTest1() throws IOException return Status.passed("getDataSource() test succeeded"); } +@Test +public void testGetDataSourceTest2() throws IOException +{ + Status s = getDataSourceTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status getDataSourceTest2() throws IOException { obj = new Object(); // just a random object @@ -85,6 +100,13 @@ public Status getDataSourceTest2() throws IOException return Status.passed("getDataSource() test succeeded"); } +@Test +public void testGetDataSourceTest3() throws IOException +{ + Status s = getDataSourceTest3(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status getDataSourceTest3() { String fileURLSpec = "file:test.txt"; diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getInputStream_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getInputStream_Test.java similarity index 89% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getInputStream_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getInputStream_Test.java index 8b7c086..6ff8486 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getInputStream_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getInputStream_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,18 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.io.InputStream; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDataSource; /** @@ -29,7 +36,7 @@ * if this is successfull then this testcase passes otherwise it fails. */ -public class getInputStream_Test extends MultiTest +public class getInputStream_Test { private static final String kFileName = "foo.txt"; @@ -43,11 +50,11 @@ public class getInputStream_Test extends MultiTest private byte bytes[] = {0,1,2,3,4,5,6,7,8,9}; -public static void main(String argv[]) +@Test +public void testGetInputStreamTest() { - getInputStream_Test lTest = new getInputStream_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getInputStreamTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getInputStreamTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getName_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getName_Test.java similarity index 83% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getName_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getName_Test.java index e78d11d..1257088 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getName_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getName_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,17 +16,22 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; /** * Create DataHandler object and then call getName() api, if this operation * returns the expected non-null string then this testcase passes. */ -public class getName_Test extends MultiTest +public class getName_Test { private static final String kFileName = "foo.txt"; @@ -38,11 +43,11 @@ public class getName_Test extends MultiTest private DataHandler objdh = null; // a DataHandler created from an Object/mimeType private DataSource objds = null; // DataSource returned from getDataSource for the Object case -public static void main(String argv[]) +@Test +public void testGetNameTest() { - getName_Test lTest = new getName_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getNameTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getNameTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getOutputStream_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getOutputStream_Test.java similarity index 88% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getOutputStream_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getOutputStream_Test.java index 36778a4..e066b33 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getOutputStream_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getOutputStream_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,18 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.InputStream; +import java.io.OutputStream; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; /** * Create DataHandler objects with various type input file strings then use @@ -27,7 +35,7 @@ * if this is successfull then this testcase passes otherwise it fails. */ -public class getOutputStream_Test extends MultiTest +public class getOutputStream_Test { private static final String kFileName = "foo.txt"; @@ -39,11 +47,11 @@ public class getOutputStream_Test extends MultiTest private DataHandler objdh = null; // a DataHandler created from an Object/mimeType private DataSource objds = null; // DataSource returned from getDataSource for the Object case -public static void main(String argv[]) +@Test +public void testGetOutputStreamTest() { - getOutputStream_Test lTest = new getOutputStream_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getOutputStreamTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getOutputStreamTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getPreferredCommands_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getPreferredCommands_Test.java similarity index 88% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getPreferredCommands_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getPreferredCommands_Test.java index 57c4659..6987566 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getPreferredCommands_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getPreferredCommands_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,27 +16,35 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.CommandMap; +import jakarta.activation.DataHandler; +import jakarta.activation.FileDataSource; +import jakarta.activation.MailcapCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** Using instances of DataHandler we invoke getPreferredCommands() api, if this * method returns a non-null array object of type CommandInfo, of size greater * then zero then this testcase passes otherwise it fails. */ -public class getPreferredCommands_Test extends MultiTest +public class getPreferredCommands_Test { private static final String kFileName = "foo.txt"; private String message = null; -public static void main(String argv[]) +@Test +public void testGetPreferredCommandsTest() { - getPreferredCommands_Test lTest = new getPreferredCommands_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getPreferredCommandsTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } private boolean checkCmdInfo(CommandInfo cmdInfo, String verb, String className) diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getTransferDataFlavors_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getTransferDataFlavors_Test.java similarity index 82% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getTransferDataFlavors_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getTransferDataFlavors_Test.java index 9589d81..e8b9dc9 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getTransferDataFlavors_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getTransferDataFlavors_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,20 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.ActivationDataFlavor; +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** * Use an instance of type DataHandler to invoke getTransferDataFlavors() api, @@ -28,16 +37,16 @@ * this testcase passes otherwise it fails. */ -public class getTransferDataFlavors_Test extends MultiTest +public class getTransferDataFlavors_Test { private static final String kFileName = "foo.txt"; private String message = null; -public static void main(String argv[]) +@Test +public void testGetTransferDataFlavorsTest1() throws IOException { - getTransferDataFlavors_Test lTest = new getTransferDataFlavors_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getTransferDataFlavorsTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getTransferDataFlavorsTest1() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getTransferData_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getTransferData_Test.java similarity index 85% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getTransferData_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getTransferData_Test.java index 0a95e9d..3ef362a 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/getTransferData_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/getTransferData_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,21 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.ActivationDataFlavor; +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDCH; /** * Create DataHandler instances, use them to invoke getTransferData() api, if @@ -28,17 +38,16 @@ * then this testcase passes, otherwise it fails. */ -public class getTransferData_Test extends MultiTest +public class getTransferData_Test { private static final String kFileName = "foo.txt"; -private Object obj = null; // Object for DataHandler(Object, String) private String message = null; -public static void main(String argv[]) +@Test +public void testGetTransferDataTest1() throws IOException { - getTransferData_Test lTest = new getTransferData_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getTransferDataTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } /* diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/isDataFlavorSupported_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/isDataFlavorSupported_Test.java similarity index 75% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/isDataFlavorSupported_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/isDataFlavorSupported_Test.java index 7ea53fb..8fefcd6 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/isDataFlavorSupported_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/isDataFlavorSupported_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,20 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.ActivationDataFlavor; +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** * Using an instance of DataHandler object, invoke isDataFlavorSupported() @@ -28,15 +37,15 @@ * this testcase passes. */ -public class isDataFlavorSupported_Test extends MultiTest +public class isDataFlavorSupported_Test { private static final String kFileName = "foo.txt"; -public static void main(String argv[]) +@Test +public void testIsDataFlavorSupportedTest() throws IOException { - isDataFlavorSupported_Test lTest = new isDataFlavorSupported_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = isDataFlavorSupportedTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status isDataFlavorSupportedTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setCommandMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setCommandMap_Test.java similarity index 82% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setCommandMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setCommandMap_Test.java index 9dbbe06..d389763 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setCommandMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setCommandMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,18 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.ActivationDataFlavor; +import jakarta.activation.CommandMap; +import jakarta.activation.DataHandler; +import jakarta.activation.FileDataSource; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** * Create instances of DataHandler, then use invoke setCommandMap() api, with @@ -28,16 +35,16 @@ * then this testcase passes, otherwise it fails. */ -public class setCommandMap_Test extends MultiTest +public class setCommandMap_Test { private static final String kFileName = "foo.txt"; private String message = null; -public static void main(String argv[]) +@Test +public void testSetCommandMapTest() { - setCommandMap_Test lTest = new setCommandMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = setCommandMapTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status setCommandMapTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setDataContentHandlerFactory_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setDataContentHandlerFactory_Test.java similarity index 78% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setDataContentHandlerFactory_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setDataContentHandlerFactory_Test.java index e97c6af..19e7598 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setDataContentHandlerFactory_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setDataContentHandlerFactory_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,20 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.ActivationDataFlavor; +import jakarta.activation.DataContentHandlerFactory; +import jakarta.activation.DataHandler; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDCHFactory; /** * Use an instance of DataHandler of invoke setDataContentHandlerFactory() api @@ -28,15 +37,15 @@ * this testcase passes, otherwise if an exception is thrown then it fails. */ -public class setDataContentHandlerFactory_Test extends MultiTest +public class setDataContentHandlerFactory_Test { private String message = null; -public static void main(String argv[]) +@Test +public void testSetDataContentHandlerFactoryTest() throws IOException { - setDataContentHandlerFactory_Test lTest = new setDataContentHandlerFactory_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = setDataContentHandlerFactoryTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } /* diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setMapCommand_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setMapCommand_Test.java similarity index 80% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setMapCommand_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setMapCommand_Test.java index 242d7db..2d6b498 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/setMapCommand_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/setMapCommand_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,19 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.ActivationDataFlavor; +import jakarta.activation.DataHandler; +import jakarta.activation.FileDataSource; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandMap; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestCommandObject; /** * Create instances of DataHandler, then use invoke setMapCommand() api, with @@ -28,16 +36,16 @@ * then this testcase passes, otherwise it fails. */ -public class setMapCommand_Test extends MultiTest +public class setMapCommand_Test { private static final String kFileName = "foo.txt"; private String message = null; -public static void main(String argv[]) +@Test +public void testSetCommandMapTest() throws IOException { - setMapCommand_Test lTest = new setMapCommand_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = setCommandMapTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status setCommandMapTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/writeTo_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/writeTo_Test.java similarity index 83% rename from tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/writeTo_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/writeTo_Test.java index 2efb402..9401612 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/DataHandler/writeTo_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/DataHandler/writeTo_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,21 @@ package javasoft.sqe.tests.api.jakarta.activation.DataHandler; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataHandler; +import jakarta.activation.DataSource; +import jakarta.activation.FileDataSource; +import jakarta.activation.UnsupportedDataTypeException; +import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDataSource; /** * writeTo() api writes out to OutputStream for a given DataHandler object @@ -28,7 +38,7 @@ * testcase passes, it fails if it throws an exception. */ -public class writeTo_Test extends MultiTest +public class writeTo_Test { private static final String kFileName = "foo.txt"; @@ -40,11 +50,11 @@ public class writeTo_Test extends MultiTest private DataHandler objdh = null; // a DataHandler created from an Object/mimeType private DataSource objds = null; // DataSource returned from getDataSource for the Object case -public static void main(String argv[]) +@Test +public void testWriteToTest() throws IOException { - writeTo_Test lTest = new writeTo_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = writeToTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status writeToTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/FileDataSource_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/FileDataSource_Test.java similarity index 74% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/FileDataSource_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/FileDataSource_Test.java index 388fea4..a7023af 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/FileDataSource_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/FileDataSource_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,31 +16,35 @@ package javasoft.sqe.tests.api.jakarta.activation.FileDataSource; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileDataSource; /** * Create an instance of type FileDataSource, if successfull * then this testcase passes, otherwise it fails. */ -public class FileDataSource_Test extends MultiTest +public class FileDataSource_Test { private static final String kFileName = "FDSTestFile.txt"; -public static void main(String argv[]) -{ - FileDataSource_Test lTest = new FileDataSource_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} - -public void init() +@Test +public void testFileDataSourceTest1() throws IOException { - + Status s = FileDataSourceTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status FileDataSourceTest1() @@ -55,6 +59,13 @@ public Status FileDataSourceTest1() return Status.passed("FileDataSource() test passed"); } +@Test +public void testFileDataSourceTest2() throws IOException +{ + Status s = FileDataSourceTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status FileDataSourceTest2() { InputStream is = null; @@ -72,6 +83,13 @@ public Status FileDataSourceTest2() return Status.failed("FileDataSource() no input test failed: getInputStream() didn't throw"); } +@Test +public void testFileDataSourceTest3() throws IOException +{ + Status s = FileDataSourceTest3(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status FileDataSourceTest3() throws IOException { File lFile = new File("bad/name"); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getContentType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getContentType_Test.java similarity index 82% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getContentType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getContentType_Test.java index 73e3daa..cd6b0be 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getContentType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getContentType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,18 @@ package javasoft.sqe.tests.api.jakarta.activation.FileDataSource; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileDataSource; +import jakarta.activation.FileTypeMap; +import jakarta.activation.MimetypesFileTypeMap; import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; /** @@ -28,15 +36,15 @@ * then this testcase passes, otherwise it fails. */ -public class getContentType_Test extends MultiTest +public class getContentType_Test { private static final String kFileName = "FDSTestFile.txt"; -public static void main(String argv[]) +@Test +public void testGetContentTypeTest() throws IOException { - getContentType_Test lTest = new getContentType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getContentTypeTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getContentTypeTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getFile_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getFile_Test.java similarity index 73% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getFile_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getFile_Test.java index 6b84311..e1db01a 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getFile_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getFile_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.FileDataSource; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileDataSource; /** * Create a FileDataSource instance and then use it to call getFile() api, @@ -28,15 +32,15 @@ * passes, otherwise it fails. */ -public class getFile_Test extends MultiTest +public class getFile_Test { private static final String kFileName = "FDSTestFile.txt"; -public static void main(String argv[]) +@Test +public void testGetFileTest() { - getFile_Test lTest = new getFile_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getFileTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getFileTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getInputStream_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getInputStream_Test.java similarity index 81% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getInputStream_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getInputStream_Test.java index de7952f..2126e09 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getInputStream_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getInputStream_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,18 @@ package javasoft.sqe.tests.api.jakarta.activation.FileDataSource; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileDataSource; /** * Create an instance of FileDataSource, use it to invoke getInputStream() @@ -28,17 +35,17 @@ * testcase passes, if it throws an appropriate exception then it fails. */ -public class getInputStream_Test extends MultiTest +public class getInputStream_Test { private static final String kFileName = "FDSTestFile.txt"; private String message; private String msgPrefix; -public static void main(String argv[]) +@Test +public void testGetInputStreamTest1() { - getInputStream_Test lTest = new getInputStream_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getInputStreamTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getInputStreamTest1() @@ -59,6 +66,13 @@ public Status getInputStreamTest1() return Status.passed("getInputStream() " + message); } +@Test +public void testGetInputStreamTest2() +{ + Status s = getInputStreamTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status getInputStreamTest2() { InputStream is = null; diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getName_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getName_Test.java similarity index 73% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getName_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getName_Test.java index 4beffc5..a6a6273 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getName_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getName_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.FileDataSource; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileDataSource; /** * Create an instance of FileDataSource class and use it to call getName() @@ -28,15 +32,15 @@ * otherwise it fails. */ -public class getName_Test extends MultiTest +public class getName_Test { private static final String kFileName = "FDSTestFile.txt"; -public static void main(String argv[]) +@Test +public void testGetNameTest() { - getName_Test lTest = new getName_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getNameTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getNameTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getOutputStream_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getOutputStream_Test.java similarity index 81% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getOutputStream_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getOutputStream_Test.java index 85ed179..212442b 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/getOutputStream_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/getOutputStream_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,19 @@ package javasoft.sqe.tests.api.jakarta.activation.FileDataSource; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileDataSource; /** * Create an instance of FileDataSource, use it to invoke getOutputStream() @@ -28,17 +36,17 @@ * testcase passes, if it throws an appropriate exception then it fails. */ -public class getOutputStream_Test extends MultiTest +public class getOutputStream_Test { private static final String kFileName = "FDSTestFile.txt"; private String message; private String msgPrefix; -public static void main(String argv[]) +@Test +public void testGetOutputStreamTest1() { - getOutputStream_Test lTest = new getOutputStream_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getOutputStreamTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getOutputStreamTest1() @@ -91,6 +99,13 @@ private boolean testIO(FileDataSource fds) return true; } +@Test +public void testGetOutputStreamTest2() throws IOException +{ + Status s = getOutputStreamTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status getOutputStreamTest2() throws IOException { File lFile = new File("bad/name"); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/setFileTypeMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/setFileTypeMap_Test.java similarity index 82% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/setFileTypeMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/setFileTypeMap_Test.java index b9d04a9..69d8a3c 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileDataSource/setFileTypeMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileDataSource/setFileTypeMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,18 @@ package javasoft.sqe.tests.api.jakarta.activation.FileDataSource; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileDataSource; +import jakarta.activation.FileTypeMap; +import jakarta.activation.MimetypesFileTypeMap; import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; /** @@ -28,15 +36,15 @@ * the get values are the same then this testcsae passes, otherwise it fails. */ -public class setFileTypeMap_Test extends MultiTest +public class setFileTypeMap_Test { private static final String kFileName = "FDSTestFile.txt"; -public static void main(String argv[]) +@Test +public void testSetFileTypeMapTest() throws IOException { - setFileTypeMap_Test lTest = new setFileTypeMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = setFileTypeMapTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status setFileTypeMapTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/FileTypeMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/FileTypeMap_Test.java similarity index 72% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/FileTypeMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/FileTypeMap_Test.java index 2c0c2ad..fd1768b 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/FileTypeMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/FileTypeMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.FileTypeMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileTypeMap; // FileTypeMap is an abstract class. The main functional testing is in the only provided // concrete implementation, MimetypesFileTypeMap, tested separately. Here we just test @@ -32,17 +37,17 @@ * testcase passes, otherwise it fails. */ -public class FileTypeMap_Test implements Test +public class FileTypeMap_Test { -public static void main(String argv[]) -{ - FileTypeMap_Test lTest = new FileTypeMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} + @Test + public void test() throws IOException + { + Status s = run(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } -public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) +public Status run() { FileTypeMap ftm = FileTypeMap.getDefaultFileTypeMap(); // API TEST diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/getContentType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/getContentType_Test.java similarity index 72% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/getContentType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/getContentType_Test.java index 4a425ee..ddb1d3d 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/getContentType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/getContentType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,16 @@ package javasoft.sqe.tests.api.jakarta.activation.FileTypeMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileTypeMap; /** FileTypeMap is an abstract class. The main functional testing is in the only provided * concrete implementation, MimetypesFileTypeMap, tested separately.
@@ -28,17 +34,17 @@ * string object then this testcase passes, otherwise it fails. */ -public class getContentType_Test implements Test +public class getContentType_Test { -public static void main(String argv[]) -{ - getContentType_Test lTest = new getContentType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} + @Test + public void test() throws IOException + { + Status s = run(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } -public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) +public Status run() { File fob = new File("testfile.txt"); FileTypeMap ftm = FileTypeMap.getDefaultFileTypeMap(); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/getDefaultFileTypeMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/getDefaultFileTypeMap_Test.java similarity index 82% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/getDefaultFileTypeMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/getDefaultFileTypeMap_Test.java index de3af39..049dfcd 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/getDefaultFileTypeMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/getDefaultFileTypeMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,9 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.FileTypeMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileTypeMap; import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; /** FileTypeMap is an abstract class. The main functional testing is in the only provided @@ -28,17 +34,17 @@ * then this testcase passes, otherwise it fails. */ -public class getDefaultFileTypeMap_Test implements Test +public class getDefaultFileTypeMap_Test { -public static void main(String argv[]) -{ - getDefaultFileTypeMap_Test lTest = new getDefaultFileTypeMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} + @Test + public void test() throws IOException + { + Status s = run(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } -public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) +public Status run() { // does getDefaultFileTypeMap return a MimetypesFileTypeMap? FileTypeMap systemTypeMap = FileTypeMap.getDefaultFileTypeMap(); // API TEST diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/setDefaultFileTypeMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/setDefaultFileTypeMap_Test.java similarity index 82% rename from tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/setDefaultFileTypeMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/setDefaultFileTypeMap_Test.java index 495702f..b4e5a81 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/FileTypeMap/setDefaultFileTypeMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/FileTypeMap/setDefaultFileTypeMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,9 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.FileTypeMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.FileTypeMap; import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestFileTypeMap; /** FileTypeMap is an abstract class. The main functional testing is in the only provided @@ -28,17 +34,17 @@ * set/get values are the same then this testcase passes, otherwise it fails. */ -public class setDefaultFileTypeMap_Test implements Test +public class setDefaultFileTypeMap_Test { -public static void main(String argv[]) -{ - setDefaultFileTypeMap_Test lTest = new setDefaultFileTypeMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} + @Test + public void test() throws IOException + { + Status s = run(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } -public Status run(String argv[], PrintWriter outLog, PrintWriter outConsole) +public Status run() { // does getDefaultFileTypeMap return a MimetypesFileTypeMap? FileTypeMap systemTypeMap = FileTypeMap.getDefaultFileTypeMap(); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/MailcapCommandMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/MailcapCommandMap_Test.java similarity index 75% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/MailcapCommandMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/MailcapCommandMap_Test.java index 572f08d..589b762 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/MailcapCommandMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/MailcapCommandMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,20 +16,28 @@ package javasoft.sqe.tests.api.jakarta.activation.MailcapCommandMap; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.nio.charset.StandardCharsets; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDCH; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MailcapCommandMap; /** Test: MailcapCommandMap() ; default constructor.
Test: MailcapCommandMap(String) ; allows the caller to specify the path of a mailcap file.
Test: MailcapCommandMap(InputStream) ; allows the caller to specify an InputStream containing a mailcap file. */ -public class MailcapCommandMap_Test extends MultiTest +public class MailcapCommandMap_Test { private static String testMailcap[] = { @@ -42,11 +50,11 @@ public class MailcapCommandMap_Test extends MultiTest private File testMcapFile = null; private String message; -public static void main(String argv[]) +@Test +public void testMailcapCommandMapTest1() throws IOException { - MailcapCommandMap_Test lTest = new MailcapCommandMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = mailcapCommandMapTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } private void setupFile() throws IOException @@ -79,6 +87,13 @@ public Status mailcapCommandMapTest1() return Status.passed(message); } +@Test +public void testMailcapCommandMapTest2() throws IOException +{ + Status s = mailcapCommandMapTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status mailcapCommandMapTest2() throws IOException { message = "MailcapCommandMap(fileName) test succeeded"; @@ -92,6 +107,13 @@ public Status mailcapCommandMapTest2() throws IOException return Status.passed(message); } +@Test +public void testMailcapCommandMapTest3() throws IOException +{ + Status s = mailcapCommandMapTest3(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status mailcapCommandMapTest3() throws FileNotFoundException, IOException { boolean lPassed = true; @@ -109,6 +131,13 @@ public Status mailcapCommandMapTest3() throws FileNotFoundException, IOException return Status.passed(message); } +@Test +public void testMailcapCommandMapTest4() throws IOException +{ + Status s = mailcapCommandMapTest4(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status mailcapCommandMapTest4() { try { diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/addMailcap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/addMailcap_Test.java similarity index 90% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/addMailcap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/addMailcap_Test.java index b24e631..969372a 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/addMailcap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/addMailcap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,17 @@ package javasoft.sqe.tests.api.jakarta.activation.MailcapCommandMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.DataContentHandler; +import jakarta.activation.MailcapCommandMap; /** * Create a MailcapCommandMap instance, use it to call addMailcap() method with @@ -30,7 +37,7 @@ * should be in mailcap format. */ -public class addMailcap_Test extends MultiTest +public class addMailcap_Test { private static String testMailcap[] = { "text/*;; x-java-view=rom.pun.activation.viewers.FooViewer", @@ -41,11 +48,11 @@ public class addMailcap_Test extends MultiTest private MailcapCommandMap commandMap = null; private String message; -public static void main(String argv[]) +@Test +public void testAddMailcapTest() throws IOException { - addMailcap_Test lTest = new addMailcap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = addMailcapTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status addMailcapTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/createDataContentHandler_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/createDataContentHandler_Test.java similarity index 87% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/createDataContentHandler_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/createDataContentHandler_Test.java index e52a046..0517eb5 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/createDataContentHandler_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/createDataContentHandler_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,16 @@ package javasoft.sqe.tests.api.jakarta.activation.MailcapCommandMap; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDCH; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.DataContentHandler; +import jakarta.activation.MailcapCommandMap; /** * Create a MailcapCommandMap instance, use it to call createDataContentHandler() @@ -29,7 +33,7 @@ * of type DataContentHandler, then this test passes otherwise it fails. */ -public class createDataContentHandler_Test extends MultiTest +public class createDataContentHandler_Test { private static String testMailcap[] = { "text/*;; x-java-view=rom.pun.activation.viewers.FooViewer", @@ -40,11 +44,11 @@ public class createDataContentHandler_Test extends MultiTest private MailcapCommandMap commandMap = null; private String message; -public static void main(String argv[]) +@Test +public void run() throws IOException { - createDataContentHandler_Test lTest = new createDataContentHandler_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = createDataContentHandlerTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } private boolean runTest(String mimeType, String verb, String className, String dchClassName) diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getAllCommands_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getAllCommands_Test.java similarity index 87% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getAllCommands_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getAllCommands_Test.java index 7a4e1e4..aa5c18d 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getAllCommands_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getAllCommands_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,16 @@ package javasoft.sqe.tests.api.jakarta.activation.MailcapCommandMap; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDCH; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.MailcapCommandMap; /** * Create a MailcapCommandMap instance, use it to call getAllCommands() @@ -29,7 +33,7 @@ * CommandInfo then this test passes otherwise it fails. */ -public class getAllCommands_Test extends MultiTest +public class getAllCommands_Test { private static String testMailcap[] = { "text/*;; x-java-view=rom.pun.activation.viewers.FooViewer", @@ -40,11 +44,11 @@ public class getAllCommands_Test extends MultiTest private MailcapCommandMap commandMap = null; private String message; -public static void main(String argv[]) +@Test +public void run() throws IOException { - getAllCommands_Test lTest = new getAllCommands_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getAllCommandsTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getAllCommandsTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getCommand_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getCommand_Test.java similarity index 88% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getCommand_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getCommand_Test.java index b006a11..f89333c 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getCommand_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getCommand_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,16 @@ package javasoft.sqe.tests.api.jakarta.activation.MailcapCommandMap; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDCH; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.MailcapCommandMap; /** * Create a MailcapCommandMap instance, use it to call getCommand() @@ -29,7 +33,7 @@ * CommandInfo then this test passes otherwise it fails. */ -public class getCommand_Test extends MultiTest +public class getCommand_Test { private static String testMailcap[] = { "text/*;; x-java-view=rom.pun.activation.viewers.FooViewer", @@ -40,11 +44,11 @@ public class getCommand_Test extends MultiTest private MailcapCommandMap commandMap = null; private String message; -public static void main(String argv[]) +@Test +public void run() throws IOException { - getCommand_Test lTest = new getCommand_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getCommandTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getCommandTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getPreferredCommands_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getPreferredCommands_Test.java similarity index 87% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getPreferredCommands_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getPreferredCommands_Test.java index 1f4324d..765ed81 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/getPreferredCommands_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/getPreferredCommands_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,16 @@ package javasoft.sqe.tests.api.jakarta.activation.MailcapCommandMap; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.TestDCH; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.CommandInfo; +import jakarta.activation.MailcapCommandMap; /** * Create a MailcapCommandMap instance, use it to call getPreferredCommands() @@ -29,7 +33,7 @@ * object of type CommandInfo then this test passes otherwise it fails. */ -public class getPreferredCommands_Test extends MultiTest +public class getPreferredCommands_Test { private static String testMailcap[] = { "text/*;; x-java-view=rom.pun.activation.viewers.FooViewer", @@ -40,11 +44,11 @@ public class getPreferredCommands_Test extends MultiTest private MailcapCommandMap commandMap = null; private String message; -public static void main(String argv[]) +@Test +public void run() throws IOException { - getPreferredCommands_Test lTest = new getPreferredCommands_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getPreferredCommandsTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getPreferredCommandsTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/loadFromConf_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/loadFromConf_Test.java similarity index 83% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/loadFromConf_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/loadFromConf_Test.java index e773fc3..d953233 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/loadFromConf_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/loadFromConf_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,19 @@ package javasoft.sqe.tests.api.jakarta.activation.MailcapCommandMap; -import java.util.*; -import java.io.*; -import jakarta.activation.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; import java.nio.file.Files; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MailcapCommandMap; /** * This class tests that resource files are loaded as expected.
@@ -30,7 +37,7 @@ * how2test: Create a MailcapCommandMap */ -public class loadFromConf_Test extends MultiTest { +public class loadFromConf_Test { private boolean skip = false; @@ -38,11 +45,11 @@ public class loadFromConf_Test extends MultiTest { private static final String entry1 = mimeType + ";test1"; private static final String entry2 = mimeType + ";test2"; - public static void main( String argv[] ) + @Test + public void run() { - loadFromConf_Test test = new loadFromConf_Test(); - Status s = test.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - s.exit(); + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } /** @@ -50,7 +57,8 @@ public static void main( String argv[] ) * create a fake java.home and point the System property * to it. */ - public void init() throws SetupException + @BeforeEach + public void init() { try { File home = File.createTempFile("javahome", "conf"); @@ -94,11 +102,11 @@ public void init() throws SetupException pw.println(entry2); pw.close(); } catch (IOException ioex) { - throw new SetupException(ioex.toString()); + throw new IllegalStateException(ioex.toString()); } } - public Status loadFromConfTest() + public Status test() { if (skip) return Status.passed("loadFromConf skipped"); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/loadFromLib_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/loadFromLib_Test.java similarity index 82% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/loadFromLib_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/loadFromLib_Test.java index 1ce5298..f4e47af 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MailcapCommandMap/loadFromLib_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MailcapCommandMap/loadFromLib_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,19 @@ package javasoft.sqe.tests.api.jakarta.activation.MailcapCommandMap; -import java.util.*; -import java.io.*; -import jakarta.activation.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; import java.nio.file.Files; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MailcapCommandMap; /** * This class tests that resource files are loaded as expected.
@@ -30,18 +37,18 @@ * how2test: Create a MailcapCommandMap */ -public class loadFromLib_Test extends MultiTest { +public class loadFromLib_Test { private boolean skip = false; private static final String mimeType = "application/x-test"; private static final String entry = mimeType + ";test1"; - public static void main( String argv[] ) + @Test + public void run() { - loadFromLib_Test test = new loadFromLib_Test(); - Status s = test.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - s.exit(); + Status s = loadFromLibTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } /** @@ -49,7 +56,8 @@ public static void main( String argv[] ) * create a fake java.home and point the System property * to it. */ - public void init() throws SetupException + @BeforeEach + public void init() { try { File home = File.createTempFile("javahome", "conf"); @@ -82,7 +90,7 @@ public void init() throws SetupException pw.println(entry); pw.close(); } catch (IOException ioex) { - throw new SetupException(ioex.toString()); + throw new IllegalStateException(ioex.toString()); } } diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/MimeType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/MimeType_Test.java similarity index 78% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/MimeType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/MimeType_Test.java index cf8bfd2..bf6a3a0 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/MimeType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/MimeType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create MimeType instances, using various constructors, if these @@ -27,14 +30,14 @@ * it fails. */ -public class MimeType_Test extends MultiTest +public class MimeType_Test { -public static void main(String argv[]) +@Test +public void testMimeTypeTest1() { - MimeType_Test lTest = new MimeType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = mimeTypeTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status mimeTypeTest1() @@ -60,6 +63,13 @@ public Status mimeTypeTest1() return Status.passed("MimeType(void | String) test succeeded"); } +@Test +public void testMimeTypeTest2() +{ + Status s = mimeTypeTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status mimeTypeTest2() { try { diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getBaseType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getBaseType_Test.java similarity index 75% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getBaseType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getBaseType_Test.java index 78698b3..89d1737 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getBaseType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getBaseType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call getBaseType() method, if @@ -27,15 +32,15 @@ * passes, otherwise it fails. */ -public class getBaseType_Test extends MultiTest +public class getBaseType_Test { -public static void main(String argv[]) -{ - getBaseType_Test lTest = new getBaseType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} + @Test + public void run() throws IOException + { + Status s = getBaseTypeTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } public Status getBaseTypeTest() { diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getParameter_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getParameter_Test.java similarity index 77% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getParameter_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getParameter_Test.java index d9bfe85..130203f 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getParameter_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getParameter_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call getParameter() method with a given @@ -27,14 +32,14 @@ * this test passes, otherwise it fails. */ -public class getParameter_Test extends MultiTest +public class getParameter_Test { -public static void main(String argv[]) +@Test +public void testGetParameterTest1() throws IOException { - getParameter_Test lTest = new getParameter_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getParameterTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getParameterTest1() @@ -57,6 +62,13 @@ public Status getParameterTest1() return Status.failed("getBaseType(void) test failed"); } +@Test +public void testGetParameterTest2() throws IOException +{ + Status s = getParameterTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status getParameterTest2() { try { diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getParameters_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getParameters_Test.java similarity index 77% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getParameters_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getParameters_Test.java index 7e17940..56f111e 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getParameters_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getParameters_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,17 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; import java.util.Enumeration; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; +import jakarta.activation.MimeTypeParameterList; /** * Create a MimeType instance, use it to call getParameters() method, if it @@ -28,15 +34,15 @@ * otherwise it fails. */ -public class getParameters_Test extends MultiTest +public class getParameters_Test { -public static void main(String argv[]) -{ - getParameters_Test lTest = new getParameters_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); -} + @Test + public void testGetParametersTest() throws IOException + { + Status s = getParametersTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); + } public Status getParametersTest() { diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getPrimaryType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getPrimaryType_Test.java similarity index 76% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getPrimaryType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getPrimaryType_Test.java index fda7273..2641ac7 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getPrimaryType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getPrimaryType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call getPrimaryType() method, if it @@ -27,13 +32,13 @@ * otherwise it fails. */ -public class getPrimaryType_Test extends MultiTest +public class getPrimaryType_Test { -public static void main(String argv[]) +@Test +public void testGetPrimaryTypeTest1() throws IOException { - getPrimaryType_Test lTest = new getPrimaryType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getPrimaryTypeTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getPrimaryTypeTest1() @@ -55,6 +60,13 @@ public Status getPrimaryTypeTest1() return Status.passed("getPrimaryType(void) test succeeded"); } +@Test +public void testGetPrimaryTypeTest2() throws IOException +{ + Status s = getPrimaryTypeTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status getPrimaryTypeTest2() { try { diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getSubType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getSubType_Test.java similarity index 78% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getSubType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getSubType_Test.java index 7b4ced6..b75a0ca 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/getSubType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/getSubType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,24 +16,27 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call getSubType() method, if * it returns subtype string of this object then this test passes. */ -public class getSubType_Test extends MultiTest +public class getSubType_Test { -public static void main(String argv[]) +@Test +public void testGetSubTypeTest1() { - getSubType_Test lTest = new getSubType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getSubTypeTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getSubTypeTest1() @@ -56,6 +59,13 @@ public Status getSubTypeTest1() return Status.passed("getSubType(void) test succeeded"); } +@Test +public void testGetSubTypeTest2() +{ + Status s = getSubTypeTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status getSubTypeTest2() { try { diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/match_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/match_Test.java similarity index 84% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/match_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/match_Test.java index 3558a6f..d0988bd 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/match_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/match_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** Test: boolean match(MimeType); Determine of the primary and sub type @@ -33,13 +36,13 @@ Create a MimeType instance, use it to call match() method with this test passes otherwise it fails. */ -public class match_Test extends MultiTest +public class match_Test { -public static void main(String argv[]) +@Test +public void testMatchTest1() { - match_Test lTest = new match_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = matchTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status matchTest1() @@ -69,6 +72,13 @@ public Status matchTest1() return Status.passed("match(MimeType) test succeeded"); } +@Test +public void testMatchTest2() +{ + Status s = matchTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status matchTest2() { try { // create MimeType object using constructor diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/readExternal_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/readExternal_Test.java similarity index 80% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/readExternal_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/readExternal_Test.java index 056f035..e0d9135 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/readExternal_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/readExternal_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,20 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.ObjectInput; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** Test: readExternal(ObjectInput);
* @@ -30,13 +40,13 @@ * both string values match then this testcase passes, otherwise it fails. */ -public class readExternal_Test extends MultiTest +public class readExternal_Test { -public static void main(String argv[]) +@Test +public void testReadExternalTest() { - readExternal_Test lTest = new readExternal_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = readExternalTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status readExternalTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/removeParameter_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/removeParameter_Test.java similarity index 80% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/removeParameter_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/removeParameter_Test.java index 0404d95..65b120d 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/removeParameter_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/removeParameter_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call removeParameter() method with @@ -27,14 +30,14 @@ * (since it has been deleted), then this test passes otherwise it fails. */ -public class removeParameter_Test extends MultiTest +public class removeParameter_Test { -public static void main(String argv[]) +@Test +public void testRemoveParameterTest() { - removeParameter_Test lTest = new removeParameter_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = removeParameterTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status removeParameterTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setParameter_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setParameter_Test.java similarity index 80% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setParameter_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setParameter_Test.java index d2455a4..1a54683 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setParameter_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setParameter_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call setParameter() method @@ -27,13 +30,13 @@ * values are equal, then this test passes otherwise it fails. */ -public class setParameter_Test extends MultiTest +public class setParameter_Test { -public static void main(String argv[]) +@Test +public void testSetParameterTest() { - setParameter_Test lTest = new setParameter_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = setParameterTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status setParameterTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setPrimaryType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setPrimaryType_Test.java similarity index 81% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setPrimaryType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setPrimaryType_Test.java index c48e20e..4ccd332 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setPrimaryType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setPrimaryType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call setPrimaryType() method @@ -27,13 +30,13 @@ * set/get values are equal, then this test passes otherwise it fails. */ -public class setPrimaryType_Test extends MultiTest +public class setPrimaryType_Test { -public static void main(String argv[]) +@Test +public void testSetPrimaryTypeTest() { - setPrimaryType_Test lTest = new setPrimaryType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = setPrimaryTypeTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status setPrimaryTypeTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setSubType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setSubType_Test.java similarity index 79% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setSubType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setSubType_Test.java index 0163509..8f8c1a2 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/setSubType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/setSubType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call setSubType() method @@ -27,13 +30,13 @@ * value is equal, then this test passes otherwise it fails. */ -public class setSubType_Test extends MultiTest +public class setSubType_Test { -public static void main(String argv[]) +@Test +public void testSetSubTypeTest() { - setSubType_Test lTest = new setSubType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = setSubTypeTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status setSubTypeTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/toString_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/toString_Test.java similarity index 79% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/toString_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/toString_Test.java index e7914f3..1d796da 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/toString_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/toString_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** * Create a MimeType instance, use it to call toString() method, @@ -27,13 +30,13 @@ * object, then this test passes otherwise it fails. */ -public class toString_Test extends MultiTest +public class toString_Test { -public static void main(String argv[]) +@Test +public void testToStringTest1() { - toString_Test lTest = new toString_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = toStringTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status toStringTest1() @@ -55,6 +58,13 @@ public Status toStringTest1() return Status.passed("toString(void) test succeeded"); } +@Test +public void testToStringTest2() +{ + Status s = toStringTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status toStringTest2() { try { diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/writeExternal_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/writeExternal_Test.java similarity index 77% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/writeExternal_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/writeExternal_Test.java index 88973a7..d8fdd14 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeType/writeExternal_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeType/writeExternal_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,18 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeType; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.FileOutputStream; +import java.io.ObjectOutput; +import java.io.ObjectOutputStream; +import java.io.OutputStream; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; /** Test: writeExternal(ObjectOutput);
* @@ -29,13 +37,13 @@ * and arrays. If this invocation is successfull then this test passes. */ -public class writeExternal_Test extends MultiTest +public class writeExternal_Test { -public static void main(String argv[]) +@Test +public void testWriteExternalTest() { - writeExternal_Test lTest = new writeExternal_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = writeExternalTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status writeExternalTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/MimeTypeParameterList_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/MimeTypeParameterList_Test.java similarity index 75% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/MimeTypeParameterList_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/MimeTypeParameterList_Test.java index d08b7b0..ea84269 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/MimeTypeParameterList_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/MimeTypeParameterList_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParameterList; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import java.net.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParameterList; /** * Create MimeTypeParameterList objects using constructors listed below:
@@ -33,14 +33,14 @@ * If this operation is successfull then this testcase passes, otherwise it fails. */ -public class MimeTypeParameterList_Test extends MultiTest +public class MimeTypeParameterList_Test { -public static void main(String argv[]) +@Test +public void testMimeTypeParameterListTest() { - MimeTypeParameterList_Test lTest = new MimeTypeParameterList_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = mimeTypeParameterListTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status mimeTypeParameterListTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/getNames_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/getNames_Test.java similarity index 75% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/getNames_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/getNames_Test.java index f4e61a1..415ae3b 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/getNames_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/getNames_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,14 +16,15 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParameterList; -import java.beans.*; -import java.io.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.util.Enumeration; -import jakarta.activation.*; -import java.net.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParameterList; /** * Create an instance of MimeTypeParameterList, then use it to call getNames() method, @@ -31,13 +32,13 @@ * passes, otherwise it fails. */ -public class getNames_Test extends MultiTest +public class getNames_Test { -public static void main(String argv[]) +@Test +public void testGetNamesTest() { - getNames_Test lTest = new getNames_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getNamesTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getNamesTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/get_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/get_Test.java similarity index 78% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/get_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/get_Test.java index e69e9f1..18520c8 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/get_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/get_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParameterList; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import java.net.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParameterList; /** * Create an instance of MimeTypeParameterList, then use it to call get() method, @@ -30,13 +30,13 @@ * passed in argument, then this test passes, otherwise it fails. */ -public class get_Test extends MultiTest +public class get_Test { -public static void main(String argv[]) +@Test +public void testGetTest() { - get_Test lTest = new get_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = getTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status getTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/isEmpty_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/isEmpty_Test.java similarity index 76% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/isEmpty_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/isEmpty_Test.java index 0de0b96..3cfe5e8 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/isEmpty_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/isEmpty_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParameterList; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import java.net.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParameterList; /** * Create an instance of MimeTypeParameterList, then use it to call isEmpty() method, @@ -30,13 +30,13 @@ * it fails. */ -public class isEmpty_Test extends MultiTest +public class isEmpty_Test { -public static void main(String argv[]) +@Test +public void testIsEmptyTest() { - isEmpty_Test lTest = new isEmpty_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = isEmptyTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status isEmptyTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/remove_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/remove_Test.java similarity index 76% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/remove_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/remove_Test.java index 9b415d7..33cd511 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/remove_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/remove_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParameterList; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import java.net.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParameterList; /** TEST: remove(string);
* @@ -31,13 +31,13 @@ * calling get(name)], then this testcase passes, otherwise it fails. */ -public class remove_Test extends MultiTest +public class remove_Test { -public static void main(String argv[]) +@Test +public void testRemoveTest() { - remove_Test lTest = new remove_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = removeTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status removeTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/set_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/set_Test.java similarity index 77% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/set_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/set_Test.java index 1628f1e..bc630c1 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/set_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/set_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParameterList; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import java.net.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParameterList; /** TEST: set(string name, string value);
* @@ -31,13 +31,13 @@ * then this testcase passes, otherwise it fails. */ -public class set_Test extends MultiTest +public class set_Test { -public static void main(String argv[]) +@Test +public void testSetTest() { - set_Test lTest = new set_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = setTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status setTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/size_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/size_Test.java similarity index 76% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/size_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/size_Test.java index ad98f0d..ea13725 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/size_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/size_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParameterList; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import java.net.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParameterList; /** * Create an instance of MimeTypeParameterList, then use it to call size() method, @@ -30,13 +30,13 @@ * passes, otherwise it fails. */ -public class size_Test extends MultiTest +public class size_Test { -public static void main(String argv[]) +@Test +public void testSizeTest() { - size_Test lTest = new size_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = sizeTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status sizeTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/toString_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/toString_Test.java similarity index 77% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/toString_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/toString_Test.java index aa9e1e7..d32a191 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParameterList/toString_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParameterList/toString_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,13 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParameterList; -import java.beans.*; -import java.io.*; -import jakarta.activation.*; -import java.net.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; -import javasoft.sqe.tests.api.jakarta.activation.TestClasses.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParameterList; /** * Create an instance of MimeTypeParameterList, then use it to call toString() method, @@ -30,13 +30,13 @@ * otherwise it fails. */ -public class toString_Test extends MultiTest +public class toString_Test { -public static void main(String argv[]) +@Test +public void testToStringTest() { - toString_Test lTest = new toString_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = toStringTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } public Status toStringTest() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParseException/MimeTypeParseException_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParseException/MimeTypeParseException_Test.java similarity index 80% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParseException/MimeTypeParseException_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParseException/MimeTypeParseException_Test.java index accde9d..d4850d6 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimeTypeParseException/MimeTypeParseException_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimeTypeParseException/MimeTypeParseException_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,13 @@ package javasoft.sqe.tests.api.jakarta.activation.MimeTypeParseException; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeTypeParseException; /** * We test this execption by invoking the two constructors for this class. @@ -27,20 +30,19 @@ * passes, otherwise it fails. */ -public class MimeTypeParseException_Test extends MultiTest { +public class MimeTypeParseException_Test { String msg = "MimeType parse Exception caught!"; - // main - public static void main(String[] args) + @Test + public void testMimeTypeParseEx() { - Test t = new MimeTypeParseException_Test(); - Status s = t.run(args, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - s.exit(); + Status s = test(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } // Tests for equals: - public Status testMimeTypeParseEx() + public Status test() { // We will call a method that always throws an // USDTE and look at the message diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/MimetypesFileTypeMap_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/MimetypesFileTypeMap_Test.java similarity index 86% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/MimetypesFileTypeMap_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/MimetypesFileTypeMap_Test.java index e039abd..e0a654d 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/MimetypesFileTypeMap_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/MimetypesFileTypeMap_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,11 +16,23 @@ package javasoft.sqe.tests.api.jakarta.activation.MimetypesFileTypeMap; -import java.io.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.nio.charset.StandardCharsets; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; +import jakarta.activation.MimeTypeParseException; +import jakarta.activation.MimetypesFileTypeMap; /** Test: MimetypesFileTypeMap() ; default constructor
@@ -31,7 +43,7 @@ then this testcase passes, otherwise it fails. */ -public class MimetypesFileTypeMap_Test extends MultiTest +public class MimetypesFileTypeMap_Test { private final static String kRefFilename = "test.txt"; private final static String kAltFilename = "test.text"; @@ -50,11 +62,11 @@ public class MimetypesFileTypeMap_Test extends MultiTest private String message = null; private String refType = null; -public static void main(String argv[]) +@Test +public void testMimetypesFileTypeMapTest1() { - MimetypesFileTypeMap_Test lTest = new MimetypesFileTypeMap_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = MimetypesFileTypeMapTest1(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } private boolean setUpReference() @@ -139,6 +151,13 @@ public Status MimetypesFileTypeMapTest1() return Status.passed("MimetypesFileTypeMap() test succeeded"); } +@Test +public void testMimetypesFileTypeMapTest2() throws IOException +{ + Status s = MimetypesFileTypeMapTest2(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status MimetypesFileTypeMapTest2() throws IOException { if (!setUpReference()) @@ -176,6 +195,13 @@ public Status MimetypesFileTypeMapTest2() throws IOException return Status.passed("MimetypesFileTypeMap(String) test succeeded"); } +@Test +public void testMimetypesFileTypeMapTest3() throws IOException +{ + Status s = MimetypesFileTypeMapTest3(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); +} + public Status MimetypesFileTypeMapTest3() throws FileNotFoundException, IOException { if (!setUpReference()) diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/addMimeTypes_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/addMimeTypes_Test.java similarity index 85% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/addMimeTypes_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/addMimeTypes_Test.java index 798233e..2a308df 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/addMimeTypes_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/addMimeTypes_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,17 @@ package javasoft.sqe.tests.api.jakarta.activation.MimetypesFileTypeMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; +import jakarta.activation.MimeTypeParseException; +import jakarta.activation.MimetypesFileTypeMap; /** * Create an instance of MimetypesFileTypeMap then call addMimeTypes() method @@ -27,18 +34,18 @@ * otherwise it fails. */ -public class addMimeTypes_Test extends MultiTest +public class addMimeTypes_Test { private final static String kRefFilename = "test.txt"; private MimetypesFileTypeMap typesMap = null; private String message = null; private String refType = null; -public static void main(String argv[]) +@Test +public void testAddMimeTypesTest() { - addMimeTypes_Test lTest = new addMimeTypes_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = addMimeTypesTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } private boolean setUpReference() diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/getContentType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/getContentType_Test.java similarity index 84% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/getContentType_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/getContentType_Test.java index 13865c0..4e2955e 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/getContentType_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/getContentType_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,10 +16,17 @@ package javasoft.sqe.tests.api.jakarta.activation.MimetypesFileTypeMap; -import java.io.*; -import jakarta.activation.*; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; + +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimeType; +import jakarta.activation.MimeTypeParseException; +import jakarta.activation.MimetypesFileTypeMap; /** * Create an instance of MimetypesFileTypeMap then call getContentType() method @@ -27,7 +34,7 @@ * then this test passes, otherwise it fails. */ -public class getContentType_Test extends MultiTest +public class getContentType_Test { private final static String kRefFilename = "test.txt"; private MimetypesFileTypeMap typesMap = null; @@ -35,11 +42,11 @@ public class getContentType_Test extends MultiTest private String message = null; private String refType = null; -public static void main(String argv[]) +@Test +public void getContentTypeTest() { - getContentType_Test lTest = new getContentType_Test(); - Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - lStatus.exit(); + Status s = run(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } private boolean setUpReference() @@ -81,7 +88,7 @@ private String validateType(String fName, String expectedType) return res1; } -public Status getContentTypeTest() +public Status run() { if (!setUpReference()) return Status.failed(message); diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/loadFromConf_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/loadFromConf_Test.java similarity index 84% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/loadFromConf_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/loadFromConf_Test.java index c6b1c07..a9981cf 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/loadFromConf_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/loadFromConf_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,19 @@ package javasoft.sqe.tests.api.jakarta.activation.MimetypesFileTypeMap; -import java.util.*; -import java.io.*; -import jakarta.activation.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; import java.nio.file.Files; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimetypesFileTypeMap; /** * This class tests that resource files are loaded as expected.
@@ -30,7 +37,7 @@ * how2test: Create a MimetypesFileTypeMap */ -public class loadFromConf_Test extends MultiTest { +public class loadFromConf_Test { private boolean skip = false; @@ -40,11 +47,11 @@ public class loadFromConf_Test extends MultiTest { private static final String entry1 = mimeType1 + " " + ext; private static final String entry2 = mimeType2 + " " + ext; - public static void main( String argv[] ) + @Test + public void getContentTypeTest() { - loadFromConf_Test test = new loadFromConf_Test(); - Status s = test.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true)); - s.exit(); + Status s = loadFromConfTest(); + assertEquals(Status.PASSED, s.getType(), "Status " + s); } /** @@ -52,7 +59,8 @@ public static void main( String argv[] ) * create a fake java.home and point the System property * to it. */ - public void init() throws SetupException + @BeforeEach + public void init() { try { File home = File.createTempFile("javahome", "conf"); @@ -96,7 +104,7 @@ public void init() throws SetupException pw.println(entry2); pw.close(); } catch (IOException ioex) { - throw new SetupException(ioex.toString()); + throw new IllegalStateException(ioex.toString()); } } diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/loadFromLib_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/loadFromLib_Test.java similarity index 82% rename from tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/loadFromLib_Test.java rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/loadFromLib_Test.java index 62984cd..c92dc10 100644 --- a/tests/api/javasoft/sqe/tests/jakarta/activation/MimetypesFileTypeMap/loadFromLib_Test.java +++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/MimetypesFileTypeMap/loadFromLib_Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -16,12 +16,19 @@ package javasoft.sqe.tests.api.jakarta.activation.MimetypesFileTypeMap; -import java.util.*; -import java.io.*; -import jakarta.activation.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; import java.nio.file.Files; -import com.sun.javatest.*; -import com.sun.javatest.lib.MultiTest; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import com.sun.javatest.Status; + +import jakarta.activation.MimetypesFileTypeMap; /** * This class tests that resource files are loaded as expected.
@@ -30,7 +37,7 @@
* how2test: Create a MimetypesFileTypeMap
*/
-public class loadFromLib_Test extends MultiTest {
+public class loadFromLib_Test {
private boolean skip = false;
@@ -38,11 +45,11 @@ public class loadFromLib_Test extends MultiTest {
private static final String ext = "xyz";
private static final String entry = mimeType + " " + ext;
- public static void main( String argv[] )
+ @Test
+ public void loadFromLibTest()
{
- loadFromLib_Test test = new loadFromLib_Test();
- Status s = test.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true));
- s.exit();
+ Status s = run();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
/**
@@ -50,7 +57,8 @@ public static void main( String argv[] )
* create a fake java.home and point the System property
* to it.
*/
- public void init() throws SetupException
+ @BeforeEach
+ public void init()
{
try {
File home = File.createTempFile("javahome", "conf");
@@ -83,11 +91,11 @@ public void init() throws SetupException
pw.println(entry);
pw.close();
} catch (IOException ioex) {
- throw new SetupException(ioex.toString());
+ throw new IllegalStateException(ioex.toString());
}
}
- public Status loadFromLibTest()
+ public Status run()
{
if (skip)
return Status.passed("loadFromLib skipped");
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/Module/UnnamedModule_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/Module/UnnamedModule_Test.java
similarity index 55%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/Module/UnnamedModule_Test.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/Module/UnnamedModule_Test.java
index aa5b511..98f72fb 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/Module/UnnamedModule_Test.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/Module/UnnamedModule_Test.java
@@ -13,10 +13,13 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
-package javasoft.sqe.tests.jakarta.activation.Module;
+package javasoft.sqe.tests.api.jakarta.activation.Module;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
import com.sun.javatest.Status;
-import com.sun.javatest.lib.MultiTest;
import jakarta.activation.DataSource;
@@ -24,22 +27,26 @@
* Verify that API on module path is able to find and use an implementation,
* which is provided on the classpath.
*/
-public class UnnamedModule_Test extends MultiTest {
+public class UnnamedModule_Test {
private static final String ACTIVATION_API_MODULE = "jakarta.activation";
- public static void main(String argv[]) {
- UnnamedModule_Test lTest = new UnnamedModule_Test();
- Status lStatus = lTest.test();
- lStatus.exit();
+ @Test
+ public void test() {
+ Status s = run();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
- public Status test() {
- String moduleName = DataSource.class.getModule().getName();
- if (ACTIVATION_API_MODULE.equals(moduleName)) {
- return Status.passed(moduleName);
- } else {
- return Status.failed(ACTIVATION_API_MODULE + " is not visible");
+ public Status run() {
+ if (DataSource.class.getModule().isNamed()) {
+ String moduleName = DataSource.class.getModule().getName();
+ if (ACTIVATION_API_MODULE.equals(moduleName)) {
+ return Status.passed(moduleName);
+ } else {
+ return Status.failed(ACTIVATION_API_MODULE + " is not visible ");
+ }
+ } else {
+ return Status.passed("Skipping test because it is not running in modules");
}
}
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestActivationDataFlavor.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestActivationDataFlavor.java
similarity index 94%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestActivationDataFlavor.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestActivationDataFlavor.java
index 5446c87..f70fc9c 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestActivationDataFlavor.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestActivationDataFlavor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestCommandMap.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestCommandMap.java
similarity index 97%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestCommandMap.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestCommandMap.java
index d0858ed..815a42f 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestCommandMap.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestCommandMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestCommandObject.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestCommandObject.java
similarity index 94%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestCommandObject.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestCommandObject.java
index 8d330c9..adbffca 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestCommandObject.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestCommandObject.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDCH.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDCH.java
similarity index 96%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDCH.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDCH.java
index 0ed480b..142b71f 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDCH.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDCH.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDCHFactory.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDCHFactory.java
similarity index 94%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDCHFactory.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDCHFactory.java
index 3c87119..3cd4459 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDCHFactory.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDCHFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDataSource.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDataSource.java
similarity index 94%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDataSource.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDataSource.java
index 4856877..7273171 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestDataSource.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestDataSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestFileTypeMap.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestFileTypeMap.java
similarity index 93%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestFileTypeMap.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestFileTypeMap.java
index 8e41a11..01644e7 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestFileTypeMap.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestFileTypeMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestNoBeans.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestNoBeans.java
similarity index 93%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestNoBeans.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestNoBeans.java
index 9ceecbe..8070288 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/TestClasses/TestNoBeans.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/TestClasses/TestNoBeans.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/URLDataSource_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/URLDataSource_Test.java
similarity index 75%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/URLDataSource_Test.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/URLDataSource_Test.java
index 167eb00..b87b07a 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/URLDataSource_Test.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/URLDataSource_Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,11 +16,17 @@
package javasoft.sqe.tests.api.jakarta.activation.URLDataSource;
-import java.net.*;
-import java.io.*;
-import jakarta.activation.*;
-import com.sun.javatest.*;
-import com.sun.javatest.lib.MultiTest;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.junit.jupiter.api.Test;
+
+import com.sun.javatest.Status;
+
+import jakarta.activation.URLDataSource;
/**
* Create instances of URLDataSource, using the constructors of this class.
@@ -28,17 +34,17 @@
* otherwise it fails.
*/
-public class URLDataSource_Test extends MultiTest
+public class URLDataSource_Test
{
private static final String fileURLSpec = "file:test.txt";
private static final String httpURLSpec = "http://www.sun.com/index.html";
private static final String badURLSpec = "http://www.nonexistentdomain.com";
-public static void main(String argv[])
+@Test
+public void testURLDataSourceTest1() throws MalformedURLException, IOException
{
- URLDataSource_Test lTest = new URLDataSource_Test();
- Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true));
- lStatus.exit();
+ Status s = URLDataSourceTest1();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
public Status URLDataSourceTest1() throws IOException, MalformedURLException
@@ -61,6 +67,13 @@ public Status URLDataSourceTest1() throws IOException, MalformedURLException
return Status.passed("URLDataSource(URL http) test succeeded");
}
+@Test
+public void testURLDataSourceTest2() throws MalformedURLException, IOException
+{
+ Status s = URLDataSourceTest2();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
+}
+
public Status URLDataSourceTest2() throws IOException, MalformedURLException
{
URL goodURL = new URL(fileURLSpec);
@@ -72,6 +85,13 @@ public Status URLDataSourceTest2() throws IOException, MalformedURLException
return Status.passed("URLDataSource(URL goodURL) test succeeded");
}
+@Test
+public void testURLDataSourceTest3() throws MalformedURLException, IOException
+{
+ Status s = URLDataSourceTest3();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
+}
+
public Status URLDataSourceTest3() throws IOException, MalformedURLException
{
URL badURL = new URL(badURLSpec);
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getContentType_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getContentType_Test.java
similarity index 82%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getContentType_Test.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getContentType_Test.java
index 3fa89d0..09a6081 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getContentType_Test.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getContentType_Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,11 +16,19 @@
package javasoft.sqe.tests.api.jakarta.activation.URLDataSource;
-import java.net.*;
-import java.io.*;
-import jakarta.activation.*;
-import com.sun.javatest.*;
-import com.sun.javatest.lib.MultiTest;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.junit.jupiter.api.Test;
+
+import com.sun.javatest.Status;
+
+import jakarta.activation.URLDataSource;
// Returns the value of the content-type header field of the URL.
@@ -30,17 +38,18 @@
* it fails.
*/
-public class getContentType_Test extends MultiTest
+public class getContentType_Test
{
private static final String badURLSpec = "http://www.xyznonexistentdomain.com";
-public static void main(String argv[])
+@Test
+public void testGetContentTypeTest1() throws MalformedURLException, IOException
{
- getContentType_Test lTest = new getContentType_Test();
- Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true));
- lStatus.exit();
+ Status s = getContentTypeTest1();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
+
@SuppressWarnings("deprecation")
public Status getContentTypeTest1() throws IOException, MalformedURLException
{
@@ -86,6 +95,13 @@ public Status getContentTypeTest1() throws IOException, MalformedURLException
return Status.passed("getContentType() test succeeded");
}
+@Test
+public void testGetContentTypeTest2() throws MalformedURLException, IOException
+{
+ Status s = getContentTypeTest2();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
+}
+
public Status getContentTypeTest2() throws IOException, MalformedURLException
{
URL badURL = new URL(badURLSpec);
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getInputStream_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getInputStream_Test.java
similarity index 77%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getInputStream_Test.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getInputStream_Test.java
index e68c390..72e8a11 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getInputStream_Test.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getInputStream_Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,11 +16,20 @@
package javasoft.sqe.tests.api.jakarta.activation.URLDataSource;
-import java.net.*;
-import java.io.*;
-import jakarta.activation.*;
-import com.sun.javatest.*;
-import com.sun.javatest.lib.MultiTest;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.junit.jupiter.api.Test;
+
+import com.sun.javatest.Status;
+
+import jakarta.activation.URLDataSource;
/**
* Create an instance of URLDataSource, use it call getInputStream() api, if
@@ -28,16 +37,16 @@
* otherwise it fails.
*/
-public class getInputStream_Test extends MultiTest {
+public class getInputStream_Test {
private static final String fileName = "test.txt1";
private static final String badURLSpec = "http://www.adfkasdklfjdsaf.com/";
-public static void main(String argv[])
+@Test
+public void testGetInputStreamTest1() throws MalformedURLException, IOException
{
- getInputStream_Test lTest = new getInputStream_Test();
- Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true));
- lStatus.exit();
+ Status s = getInputStreamTest1();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
@SuppressWarnings("deprecation")
@@ -59,6 +68,13 @@ public Status getInputStreamTest1() throws IOException, MalformedURLException
return Status.passed("getInputStream() test succeeded");
}
+@Test
+public void testGetInputStreamTest2() throws MalformedURLException, IOException
+{
+ Status s = getInputStreamTest2();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
+}
+
public Status getInputStreamTest2() throws IOException, MalformedURLException
{
URL badURL = new URL(badURLSpec);
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getName_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getName_Test.java
similarity index 80%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getName_Test.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getName_Test.java
index 97dff23..52108ba 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getName_Test.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getName_Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,11 +16,17 @@
package javasoft.sqe.tests.api.jakarta.activation.URLDataSource;
-import java.net.*;
-import java.io.*;
-import jakarta.activation.*;
-import com.sun.javatest.*;
-import com.sun.javatest.lib.MultiTest;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.junit.jupiter.api.Test;
+
+import com.sun.javatest.Status;
+
+import jakarta.activation.URLDataSource;
// Calls the getFile method on the URL used to instantiate the object.
@@ -29,16 +35,16 @@
* returns a non-null expected string, then this testcase passes, otherwise it fails.
*/
-public class getName_Test extends MultiTest
+public class getName_Test
{
private static final String httpURLSpec = "http://www.sun.com/index.html";
private static final String badURLSpec = "http://www.nonexistentdomain.com";
-public static void main(String argv[])
+@Test
+public void testGetName_Test() throws MalformedURLException, IOException
{
- getName_Test lTest = new getName_Test();
- Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true));
- lStatus.exit();
+ Status s = getName_Test();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
public Status getName_Test() throws IOException, MalformedURLException
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getOutputStream_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getOutputStream_Test.java
similarity index 78%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getOutputStream_Test.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getOutputStream_Test.java
index 317d386..b2c3cfd 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getOutputStream_Test.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getOutputStream_Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,11 +16,21 @@
package javasoft.sqe.tests.api.jakarta.activation.URLDataSource;
-import java.net.*;
-import java.io.*;
-import jakarta.activation.*;
-import com.sun.javatest.*;
-import com.sun.javatest.lib.MultiTest;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.UnknownServiceException;
+
+import org.junit.jupiter.api.Test;
+
+import com.sun.javatest.Status;
+
+import jakarta.activation.URLDataSource;
/**
* Create an instance of URLDataSource, use it call getOutputStream() api, if
@@ -28,15 +38,15 @@
* otherwise it fails.
*/
-public class getOutputStream_Test extends MultiTest {
+public class getOutputStream_Test {
private static final String badURLSpec = "http://www.adfkasdklfjdsaf.com/";
-public static void main(String argv[])
+@Test
+public void testGetOutputStreamTest1() throws MalformedURLException, IOException
{
- getOutputStream_Test lTest = new getOutputStream_Test();
- Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true));
- lStatus.exit();
+ Status s = getOutputStreamTest1();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
@SuppressWarnings("deprecation")
@@ -55,6 +65,13 @@ public Status getOutputStreamTest1() throws IOException, MalformedURLException
return Status.passed("getOutputStream() test succeeded");
}
+@Test
+public void testGetOutputStreamTest2() throws MalformedURLException, IOException
+{
+ Status s = getOutputStreamTest2();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
+}
+
public Status getOutputStreamTest2() throws IOException, MalformedURLException
{
URL badURL = new URL(badURLSpec);
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getURL_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getURL_Test.java
similarity index 74%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getURL_Test.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getURL_Test.java
index efbdc24..5adc2ef 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/URLDataSource/getURL_Test.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/URLDataSource/getURL_Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,11 +16,17 @@
package javasoft.sqe.tests.api.jakarta.activation.URLDataSource;
-import java.net.*;
-import java.io.*;
-import jakarta.activation.*;
-import com.sun.javatest.*;
-import com.sun.javatest.lib.MultiTest;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.junit.jupiter.api.Test;
+
+import com.sun.javatest.Status;
+
+import jakarta.activation.URLDataSource;
/**
* Create an instance of URLDataSource, use it call getURL() api, if it
@@ -28,16 +34,16 @@
* otherwise it fails.
*/
-public class getURL_Test extends MultiTest
+public class getURL_Test
{
private static final String httpURLSpec = "http://www.sun.com/index.html";
private static final String badURLSpec = "http://www.nonexistentdomain.com";
-public static void main(String argv[])
+@Test
+public void testGetURL_Test() throws MalformedURLException, IOException
{
- getURL_Test lTest = new getURL_Test();
- Status lStatus = lTest.run(argv, new PrintWriter(System.err, true), new PrintWriter(System.out, true));
- lStatus.exit();
+ Status s = getURL_Test();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
public Status getURL_Test() throws IOException, MalformedURLException
diff --git a/tests/api/javasoft/sqe/tests/jakarta/activation/UnsupportedDataTypeException/UnsupportedDTException_Test.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/UnsupportedDataTypeException/UnsupportedDTException_Test.java
similarity index 80%
rename from tests/api/javasoft/sqe/tests/jakarta/activation/UnsupportedDataTypeException/UnsupportedDTException_Test.java
rename to tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/UnsupportedDataTypeException/UnsupportedDTException_Test.java
index da5ed25..144edea 100644
--- a/tests/api/javasoft/sqe/tests/jakarta/activation/UnsupportedDataTypeException/UnsupportedDTException_Test.java
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/UnsupportedDataTypeException/UnsupportedDTException_Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,10 +16,13 @@
package javasoft.sqe.tests.api.jakarta.activation.UnsupportedDataTypeException;
-import java.io.*;
-import jakarta.activation.*;
-import com.sun.javatest.*;
-import com.sun.javatest.lib.MultiTest;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+
+import com.sun.javatest.Status;
+
+import jakarta.activation.UnsupportedDataTypeException;
/**
* We test this execption by invoking the two constructors for this class.
@@ -27,21 +30,20 @@
* passes, otherwise it fails.
*/
-public class UnsupportedDTException_Test extends MultiTest {
+public class UnsupportedDTException_Test {
String msg = "unsupported data type exception";
- // main
- public static void main(String[] args)
+ @Test
+ public void testUnsupportedDTEx()
{
- Test t = new UnsupportedDTException_Test();
- Status s = t.run(args, new PrintWriter(System.err, true), new PrintWriter(System.out, true));
- s.exit();
+ Status s = run();
+ assertEquals(Status.PASSED, s.getType(), "Status " + s);
}
// Tests for equals:
- public Status testUnsupportedDTEx()
+ public Status run()
{
// We will call a method that always throws an
// USDTE and look at the message
diff --git a/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/sigtest/SignatureTest.java b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/sigtest/SignatureTest.java
new file mode 100644
index 0000000..8cc49d4
--- /dev/null
+++ b/tck/tck-tests/src/main/java/javasoft/sqe/tests/api/jakarta/activation/sigtest/SignatureTest.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+package javasoft.sqe.tests.api.jakarta.activation.sigtest;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Executes the signature test.
+ *
+ */
+public class SignatureTest extends com.sun.tdk.signaturetest.SignatureTest {
+
+ private static final String SIG_FILE_NAME = System.getProperty("sigtest", "/jakarta.activation_2.0_java_11.sig");
+ private static final String[] EXCLUDE_CLASSES = {
+ "java.util.Map",
+ "java.lang.Object",
+ "java.io.ByteArrayInputStream",
+ "java.io.InputStream",
+ "java.lang.Deprecated",
+ "java.io.Writer",
+ "java.io.OutputStream",
+ "java.util.List",
+ "java.util.Collection",
+ "java.lang.instrument.IllegalClassFormatException",
+ "javax.transaction.xa.XAException",
+ "java.lang.annotation.Repeatable",
+ "java.lang.InterruptedException",
+ "java.lang.CloneNotSupportedException",
+ "java.lang.Throwable",
+ "java.lang.Thread",
+ "java.lang.Enum"
+ };
+
+ @Test
+ public void test() throws IOException {
+ File file = new File(System.getProperty("java.io.tmpdir") + SIG_FILE_NAME);
+ file.deleteOnExit();
+ try (InputStream inputStream = SignatureTest.class.getResourceAsStream(SIG_FILE_NAME)) {
+ Files.copy(inputStream, file.toPath());
+ }
+ List This test is version specific. The current version is 2.0
-
-Jakarta Activation API Signature Test
-
-
-This is the API signature test for the entire jakarta.activation.* package. This
-test verifies the existence of all expected public classes and interfaces. In
-those public classes and interfaces it verifies the existence, correct
-modifiers, arguments, and throws clauses of public constructors and methods.
-It also verifies the existence and correct modifiers of public fields.
-
-
-
-
-title API Signature verification
- name Activation_SigTest
- source SignatureTest.java
- executeClass com.sun.tdk.signaturetest.SignatureTest
- executeArgs -TestURL $testURL
- -Package jakarta.activation
- -FileName jakarta.activation_2.0_java_${java.specification.version}.sig
- keywords compile execute jaf extensionAPI
-
-
-© 2002-2019 Oracle and/or its affiliates. All Rights Reserved
-
-