Skip to content

Commit

Permalink
format and organize imports.
Browse files Browse the repository at this point in the history
Signed-off-by: Gurunandan Rao <[email protected]>
  • Loading branch information
gurunrao committed Aug 1, 2023
1 parent c9f7ac2 commit a521ad9
Show file tree
Hide file tree
Showing 101 changed files with 237 additions and 128 deletions.
2 changes: 1 addition & 1 deletion glassfish-runner/jms-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@
</excludes>
<additionalClasspathElements>
<additionalClasspathElement>${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jakarta.jms-api.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/jms-core.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${glassfish.toplevel.dir}/glassfish/modules/glassfish-corba-omgapi.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derbyclient.jar</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/${glassfish.toplevel.dir}/javadb/lib/derby.jar</additionalClasspathElement>
Expand All @@ -552,6 +551,7 @@
<webServerHost>localhost</webServerHost>
<webServerPort>8080</webServerPort>
<vehicle>standalone</vehicle>
<user.dir>/tmp</user.dir>
</systemPropertyVariables>
<environmentVariables>
<GLASSFISH_HOME>${project.build.directory}/${glassfish.toplevel.dir}</GLASSFISH_HOME>
Expand Down
8 changes: 8 additions & 0 deletions glassfish-runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
<properties>
<glassfish-artifact-id>glassfish</glassfish-artifact-id>

<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>

<jsonb.tck.version>3.0.0</jsonb.tck.version>
<json.tck.version>2.1.0</json.tck.version>
<jakarta.rest.version>3.1.0</jakarta.rest.version>
<tck.artifactId>jakarta-restful-ws-tck</tck.artifactId>

<glassfish.container.version>7.0.0</glassfish.container.version>
<glassfish.toplevel.dir>glassfish7</glassfish.toplevel.dir>
<jakarta.rest.version>3.1.0</jakarta.rest.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@

package com.sun.ts.lib.implementation.sun.jms;

import java.util.*;
import java.io.*;
import javax.naming.*;
import jakarta.jms.*;
import com.sun.ts.lib.util.*;
import com.sun.ts.lib.porting.*;
import javax.naming.Context;
import javax.naming.InitialContext;

import com.sun.ts.lib.porting.TSJMSObjectsInterface;
import com.sun.ts.lib.util.TestUtil;

import jakarta.jms.ConnectionFactory;
import jakarta.jms.QueueConnectionFactory;
import jakarta.jms.Topic;
import jakarta.jms.TopicConnectionFactory;

/**
* This is an implementation of the TSJMSObjectsInterface. An implementation of
Expand All @@ -32,118 +36,116 @@
*/

public class SunRIJMSObjects implements TSJMSObjectsInterface {
private static Context jndiContext = null;

private static QueueConnectionFactory qcf = null;

private static TopicConnectionFactory tcf = null;

private static ConnectionFactory cf = null;

private jakarta.jms.Topic testTopic = null;

private jakarta.jms.Queue testQueue = null;

private void getJNDIContext() throws Exception {

if (jndiContext == null) {
try {
TestUtil.logTrace("Getting initial context");
jndiContext = new InitialContext();
} catch (javax.naming.NamingException ne) {
TestUtil.logErr("Could not create JNDI context because: ", ne);
TestUtil.printStackTrace(ne);
throw ne;
}
}
}

/**
* This method allows individual implementation to get the Queue
*/

public jakarta.jms.Queue getQueue(String name) throws Exception {
getJNDIContext();

try {
testQueue = (jakarta.jms.Queue) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup Queue");
TestUtil.printStackTrace(e);
throw e;
}
return testQueue;
}

/**
* This method allows individual implementation to get the Topic
*/

public Topic getTopic(String name) throws Exception {
getJNDIContext();

try {
testTopic = (Topic) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup Topic");
TestUtil.printStackTrace(e);
throw e;
}
return testTopic;
}

/**
* This method allows individual implementation to get the
* QueueConnectionFactory
*/

public QueueConnectionFactory getQueueConnectionFactory(String name)
throws Exception {
getJNDIContext();

try {
qcf = (QueueConnectionFactory) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup QueueConnectionFactory");
TestUtil.printStackTrace(e);
throw e;
}
return qcf;
}

/**
* This method allows individual implementation to get the
* TopicConnectionFactory
*/

public TopicConnectionFactory getTopicConnectionFactory(String name)
throws Exception {
getJNDIContext();

try {
tcf = (TopicConnectionFactory) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup TopicConnectionFactory");
TestUtil.printStackTrace(e);
throw e;
}
return tcf;
}

/**
* This method allows individual implementation to get the ConnectionFactory
*/

public ConnectionFactory getConnectionFactory(String name) throws Exception {
getJNDIContext();

try {
cf = (ConnectionFactory) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup ConnectionFactory");
TestUtil.printStackTrace(e);
throw e;
}
return cf;
}
private static Context jndiContext = null;

private static QueueConnectionFactory qcf = null;

private static TopicConnectionFactory tcf = null;

private static ConnectionFactory cf = null;

private jakarta.jms.Topic testTopic = null;

private jakarta.jms.Queue testQueue = null;

private void getJNDIContext() throws Exception {

if (jndiContext == null) {
try {
TestUtil.logTrace("Getting initial context");
jndiContext = new InitialContext();
} catch (javax.naming.NamingException ne) {
TestUtil.logErr("Could not create JNDI context because: ", ne);
TestUtil.printStackTrace(ne);
throw ne;
}
}
}

/**
* This method allows individual implementation to get the Queue
*/

public jakarta.jms.Queue getQueue(String name) throws Exception {
getJNDIContext();

try {
testQueue = (jakarta.jms.Queue) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup Queue");
TestUtil.printStackTrace(e);
throw e;
}
return testQueue;
}

/**
* This method allows individual implementation to get the Topic
*/

public Topic getTopic(String name) throws Exception {
getJNDIContext();

try {
testTopic = (Topic) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup Topic");
TestUtil.printStackTrace(e);
throw e;
}
return testTopic;
}

/**
* This method allows individual implementation to get the
* QueueConnectionFactory
*/

public QueueConnectionFactory getQueueConnectionFactory(String name) throws Exception {
getJNDIContext();

try {
qcf = (QueueConnectionFactory) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup QueueConnectionFactory");
TestUtil.printStackTrace(e);
throw e;
}
return qcf;
}

/**
* This method allows individual implementation to get the
* TopicConnectionFactory
*/

public TopicConnectionFactory getTopicConnectionFactory(String name) throws Exception {
getJNDIContext();

try {
tcf = (TopicConnectionFactory) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup TopicConnectionFactory");
TestUtil.printStackTrace(e);
throw e;
}
return tcf;
}

/**
* This method allows individual implementation to get the ConnectionFactory
*/

public ConnectionFactory getConnectionFactory(String name) throws Exception {
getJNDIContext();

try {
cf = (ConnectionFactory) jndiContext.lookup(name);
} catch (Exception e) {
TestUtil.logErr("Failed to lookup ConnectionFactory");
TestUtil.printStackTrace(e);
throw e;
}
return cf;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
/**
* JMS TS tests. Testing method calls on closed QueueConnection objects.
*/

public class ClosedQueueConnectionTestsIT {
private static final String TestName = "com.sun.ts.tests.jms.core.appclient.closedQueueConnection.ClosedQueueConnectionTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import jakarta.jms.Message;
import jakarta.jms.MessageListener;


public class ClosedQueueReceiverIT {
private static final String TestName = "com.sun.ts.tests.jms.core.appclient.closedQueueReceiver.ClosedQueueReceiverTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
/**
* JMS TS tests. Testing method calls on closed QueueSession objects.
*/

public class ClosedQueueSessionTestsIT {
private static final String TestName = "com.sun.ts.tests.jms.core.appclient.closedQueueSession.ClosedQueueSessionTests";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/**
* JMS product tests. Testing method calls on closed TopicConnection objects.
*/

public class ClosedTopicConnectionTestsIT {
private static final String TestName = "com.sun.ts.tests.jms.core.appclient.closedTopicConnection.ClosedTopicConnectionTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import jakarta.jms.Message;
import jakarta.jms.MessageListener;


public class ClosedTopicSessionTestsIT {
private static final String testName = "com.sun.ts.tests.jms.ee.ejbjspservlet.closedTopicSession.ClosedTopicSessionTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import jakarta.jms.Session;
import jakarta.jms.Topic;


public class InvalidDestTestsIT {
private static final String testName = "com.sun.ts.tests.jms.core.appclient.invalidDest.InvalidDestTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import jakarta.jms.Session;
import jakarta.jms.TextMessage;


public class QueueConnTestsIT {
private static final String testName = "com.sun.ts.tests.jms.core.appclient.queueconn.QueueConnTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import jakarta.jms.TextMessage;
import jakarta.jms.TopicConnection;


public class QueueTestsIT {
private static final String testName = "com.sun.ts.tests.jms.core.appclient.queuetests.QueueTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import jakarta.jms.TopicSession;
import jakarta.jms.TopicSubscriber;


public class TopicTestsIT {
private static final String testName = "com.sun.ts.tests.jms.core.appclient.topictests.TopicTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import jakarta.jms.TopicSession;
import jakarta.jms.TopicSubscriber;


public class TxTopicTestsIT {
private static final String testName = "com.sun.ts.tests.jms.ee.ejbjspservlet.txtopictests.TxTopicTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import jakarta.jms.BytesMessage;
import jakarta.jms.MessageNotWriteableException;


public class BytesMsgQueueTestsIT {
private static final String testName = "com.sun.ts.tests.jms.core.bytesMsgQueue.BytesMsgQueueTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import jakarta.jms.BytesMessage;
import jakarta.jms.MessageNotWriteableException;


public class BytesMsgTopicTestsIT {
private static final String testName = "com.sun.ts.tests.jms.core.bytesMsgTopic.BytesMsgTopicTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
/**
* JMS TS tests. Testing method calls on closed QueueConnection objects.
*/

public class ClosedQueueConnectionTestsIT {
private static final String TestName = "com.sun.ts.tests.jms.core.closedQueueConnection.ClosedQueueConnectionTestsIT";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
/**
* JMS TS tests. Testing method calls on closed QueueReceiver objects.
*/

public class ClosedQueueReceiverTestsIT {
private static final String TestName = "com.sun.ts.tests.jms.core.closedQueueReceiver.ClosedQueueReceiverTestsIT";

Expand Down
Loading

0 comments on commit a521ad9

Please sign in to comment.