- 4.0.0
-
-
- jakartatck
- project
- 10.0.0-SNAPSHOT
-
-
- glassfishtck
- jar
-
- glassfishtck
- glassfishtck
-
-
-
- ${project.groupId}
- runtime
-
-
+
+ 4.0.0
+
+
+ jakartatck
+ project
+ 10.0.0-SNAPSHOT
+
+
+ glassfishtck
+ jar
+
+ glassfishtck
+ glassfishtck
+
+
+
+ ${project.groupId}
+ runtime
+
+
diff --git a/runtime/src/main/java/com/sun/ts/lib/porting/TSURL.java b/runtime/src/main/java/com/sun/ts/lib/porting/TSURL.java
index d5003ca1af..32d4d9db5f 100644
--- a/runtime/src/main/java/com/sun/ts/lib/porting/TSURL.java
+++ b/runtime/src/main/java/com/sun/ts/lib/porting/TSURL.java
@@ -37,6 +37,8 @@ public class TSURL implements TSURLInterface, Serializable {
private TSURLInterface ctsURL = null;
private String sClass = "porting.ts.url.class.1";
+
+ private String portingDefault = "com.sun.ts.lib.porting.implementation.SunRIURL";
public TSURL() {
// we'll initialize the impl when the individual method is called
@@ -66,7 +68,7 @@ public URL getURL(String protocol, String host, int port, String file)
if (ctsURL == null) {
try {
// create and initialize a new instance of TSURLInterface
- Class c = Class.forName(TestUtil.getProperty(sClass));
+ Class c = Class.forName(System.getProperty(sClass, portingDefault));
ctsURL = (TSURLInterface) c.newInstance();
} catch (Exception e) {
e.printStackTrace();
@@ -95,7 +97,7 @@ public String getURLString(String protocol, String host, int port,
if (ctsURL == null) {
try {
// create and initialize a new instance of TSURLInterface
- Class c = Class.forName(TestUtil.getProperty(sClass));
+ Class c = Class.forName(System.getProperty(sClass, portingDefault));
ctsURL = (TSURLInterface) c.newInstance();
} catch (Exception e) {
e.printStackTrace();
@@ -118,7 +120,7 @@ public String getRequest(String request) {
// create and initialize a new instance of TSURLInterface
// Class c = Class.forName(TestUtil.getProperty(sClass));
// Use the system property porting.ts.url.class.1
- Class c = Class.forName(System.getProperty(sClass, "com.sun.ts.tests.jaxrs.lib.implementation.sun.common.SunRIURL"));
+ Class c = Class.forName(System.getProperty(sClass, portingDefault));
ctsURL = (TSURLInterface) c.newInstance();
} catch (Exception e) {
e.printStackTrace();
diff --git a/runtime/src/main/java/com/sun/ts/lib/porting/implementation/SunRIURL.java b/runtime/src/main/java/com/sun/ts/lib/porting/implementation/SunRIURL.java
new file mode 100644
index 0000000000..9686340dd3
--- /dev/null
+++ b/runtime/src/main/java/com/sun/ts/lib/porting/implementation/SunRIURL.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2007, 2023 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 com.sun.ts.lib.porting.implementation;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import com.sun.ts.lib.porting.TSURLInterface;
+
+// import com.sun.ts.lib.porting.TSURLInterface;
+
+/**
+ * This is a J2EE Reference specific implementation of the TSURLInterface which
+ * is to be used for J2EE-TS testing. TS tests use this interface to obtain the
+ * URL String to use to access a given web component. If a given J2EE Server
+ * implmentation requires that URLs be created in a different manner, then this
+ * implementation can be replaced.
+ *
+ * @author Kyle Grucci
+ */
+public class SunRIURL implements TSURLInterface {
+ private URL url = null;
+
+ /**
+ * This method is called by TS tests to get the URL to use to access a given web
+ * component.
+ *
+ * @param protocol - the name of the protocol.
+ * @param host - the name of the host.
+ * @param port - the port number.
+ * @param file - the host file.
+ * @return a valid URL object.
+ */
+ public URL getURL(String protocol, String host, int port, String file) throws MalformedURLException {
+ try {
+ url = new URL(protocol, host, port, file);
+ } catch (MalformedURLException e) {
+ // logger.log(Logger.Level.ERROR,"Failed during URL creation", e);
+ throw e;
+ }
+ return url;
+ }
+
+ /**
+ * This method is called by TS tests to get the URL to use to access a given web
+ * component.
+ *
+ * @param protocol - the name of the protocol.
+ * @param host - the name of the host.
+ * @param port - the port number.
+ * @param file - the host file.
+ * @return a valid URL as a String.
+ */
+ public String getURLString(String protocol, String host, int port, String file) {
+ if (file.startsWith("/"))
+ return protocol + "://" + host + ":" + port + file;
+ else
+ return protocol + "://" + host + ":" + port + "/" + file;
+ }
+
+ /**
+ * This method is called by TS tests to get the request string to use to access
+ * a given web component.
+ *
+ * @param request - the request file.
+ * @return a valid String object.
+ */
+ public String getRequest(String request) {
+ return request;
+ }
+}
diff --git a/saaj/src/main/java/com/sun/ts/tests/saaj/common/Client.java b/saaj/src/main/java/com/sun/ts/tests/saaj/common/Client.java
new file mode 100644
index 0000000000..7be11ced49
--- /dev/null
+++ b/saaj/src/main/java/com/sun/ts/tests/saaj/common/Client.java
@@ -0,0 +1,92 @@
+package com.sun.ts.tests.saaj.common;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.System.Logger;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Properties;
+
+import org.jboss.arquillian.junit5.ArquillianExtension;
+import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import com.sun.ts.lib.porting.TSURL;
+
+@ExtendWith(ArquillianExtension.class)
+public class Client {
+
+ protected static final String PROTOCOL = "http";
+
+ protected static final String HOSTNAME = "localhost";
+
+ protected static final int PORTNUM = 8000;
+
+ public static final String WEBSERVERHOSTPROP = "webServerHost";
+
+ public static final String WEBSERVERPORTPROP = "webServerPort";
+
+ protected TSURL tsurl = new TSURL();
+
+ protected URL url = null;
+
+ protected URLConnection urlConn = null;
+
+ protected Properties props = new Properties();
+
+ protected String hostname = HOSTNAME;
+
+ protected int portnum = PORTNUM;
+
+ private static final Logger logger = (Logger) System.getLogger(Client.class.getName());
+
+ public static void addFilesToArchive(String contentRoot, String[] fileNames, WebArchive archive)
+ throws IOException {
+ for (String fileName : fileNames) {
+ InputStream inStream = Thread.currentThread().getContextClassLoader()
+ .getResourceAsStream(contentRoot + fileName);
+ ByteArrayAsset attach = new ByteArrayAsset(inStream);
+ archive.add(attach, fileName);
+ }
+ }
+
+ /*
+ * @class.setup_props: webServerHost; webServerPort;
+ */
+ @BeforeEach
+ public void setup() throws Exception {
+ boolean pass = true;
+
+ try {
+ hostname = System.getProperty(WEBSERVERHOSTPROP);
+ if (hostname == null)
+ pass = false;
+ else if (hostname.equals(""))
+ pass = false;
+ try {
+ portnum = Integer.parseInt(System.getProperty(WEBSERVERPORTPROP));
+ } catch (Exception e) {
+ pass = false;
+ }
+ } catch (Exception e) {
+ throw new Exception("setup failed:", e);
+ }
+ props.put(WEBSERVERHOSTPROP, hostname);
+ props.put(WEBSERVERPORTPROP, String.valueOf(portnum));
+ if (!pass) {
+ logger.log(Logger.Level.ERROR, "Please specify host & port of web server " + "in config properties: "
+ + WEBSERVERHOSTPROP + ", " + WEBSERVERPORTPROP);
+ throw new Exception("setup failed:");
+ }
+ logger.log(Logger.Level.INFO, "setup ok");
+ }
+
+ @AfterEach
+ public void cleanup() throws Exception {
+ logger.log(Logger.Level.INFO, "cleanup ok");
+ }
+
+}
diff --git a/saaj/src/main/resources/com/sun/ts/tests/saaj/api/jakarta_xml_soap/AttachmentPart/contentRoot/attach.gif b/saaj/src/main/resources/com/sun/ts/tests/saaj/api/jakarta_xml_soap/AttachmentPart/contentRoot/attach.gif
new file mode 100644
index 0000000000..aeb1567ecf
Binary files /dev/null and b/saaj/src/main/resources/com/sun/ts/tests/saaj/api/jakarta_xml_soap/AttachmentPart/contentRoot/attach.gif differ
diff --git a/saaj/src/main/resources/com/sun/ts/tests/saaj/api/jakarta_xml_soap/AttachmentPart/contentRoot/attach.html b/saaj/src/main/resources/com/sun/ts/tests/saaj/api/jakarta_xml_soap/AttachmentPart/contentRoot/attach.html
new file mode 100644
index 0000000000..47a391fe99
--- /dev/null
+++ b/saaj/src/main/resources/com/sun/ts/tests/saaj/api/jakarta_xml_soap/AttachmentPart/contentRoot/attach.html
@@ -0,0 +1,58 @@
+
+
+
+
+Welcome to the JAXM TCK, Version 1.1
+
+
+Your Starting Point
+
+
+Guide to Documentation
+
+The JAXM Copyright provides
+ the copyright information notice for the JAXM TCK, Version 1.1.
+
+
The JAXM ReleaseNotes provide the
+ information that you need to install, set up, and run the JAXM TCK, Version 1.1.
+
+
The Javadoc Assertion List lists all the javadoc assertions that are tested by the JAXM TCK.
+
+
The Specification Assertion List lists all the specification assertions that are tested by the JAXM TCK.
+
+
Additional documentation includes the JavaTest README file, ReleaseNotes
+ file, and user's guide:
+
+
+The README file contains
+ basic information about the JavaTest, Version 3.0.2 harness.
+
+The JavaTest User's Guide,
+ in PDF format, contains information about using the test harness tool.
+
+The ReleaseNotes
+ provide information that is not contained in the JavaTest User's
+ Guide manual, and which supercede any information in the manual.
+
+
+
+
+Copyright (c) 2007, 2018 Oracle and/or its affiliates. All rights reserved.
+
+