Skip to content

Commit

Permalink
from SOP to logging.
Browse files Browse the repository at this point in the history
Signed-off-by: gurunrao <[email protected]>
  • Loading branch information
gurunrao committed Apr 14, 2023
1 parent 0fb8e79 commit a323f8b
Show file tree
Hide file tree
Showing 240 changed files with 1,627 additions and 626 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class SunRIDeployment extends SunRIDeployment14
*/
public void init(PrintWriter out) {
try {
System.out.println("SunRIDeployment: in init");
logger.info("SunRIDeployment: in init");
PropertyManagerInterface propMgr = DeliverableFactory
.getDeliverableInstance().getPropertyManager();
init(out, "", propMgr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ protected String[] setRunTimeInfo(String s, String sApp)
Log.print("*****************??????");
Log.print(t.getMessage());
Log.print("*****************??????");
System.out.println("*****************??????");
logger.info("*****************??????");
t.printStackTrace(Log);
t.printStackTrace();
System.out.println("Exception = " + t.getMessage());
System.out.println("*****************??????");
logger.info("Exception = " + t.getMessage());
logger.info("*****************??????");
Log.print("Warning: Failed to set runtime info in " + sRunTimeFiles[ii]
+ " for application, " + sApp);
throw new TSDeploymentException(t.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ public class TSWebConfiguration {
static List<String> props_name = Arrays.asList("servlet_adaptor");

public TSWebConfiguration() {
System.out.println("Dummy TSWebConfiguration Conctructor");
logger.info("Dummy TSWebConfiguration Conctructor");
}

public static void main(String[] args) {

TSWebConfiguration webconfig = new TSWebConfiguration();

implementation_name = webconfig.findProps(implementation_name);
System.out.println("++++++++++++=" + implementation_name);
logger.info("++++++++++++=" + implementation_name);

servlet_adaptor = webconfig.findProps(servlet_adaptor);
servlet_adaptor = servlet_adaptor.replace(".class", "").replace("/", ".");
Expand All @@ -104,13 +104,13 @@ public static void main(String[] args) {
try {
String line = null; // not declared within while loop
while ((line = input.readLine()) != null) {
System.out.println("Processing file " + line);
logger.info("Processing file " + line);
File file = new File(
System.getProperty("TS_HOME") + File.separator + line);
try {
htReplacementProps.put("servlet_adaptor", servlet_adaptor);
webconfig.sweepwebFile(file);
System.out.println("Done with file " + file.toString());
logger.info("Done with file " + file.toString());
} catch (Exception e) {
e.printStackTrace();
System.out
Expand All @@ -128,7 +128,7 @@ public static void main(String[] args) {
}

String findProps(String prop) {
System.out.println("Processing jte file");
logger.info("Processing jte file");
String replace = null;

try {
Expand Down Expand Up @@ -227,7 +227,7 @@ public String replace(File file, Hashtable htStrings,
}
// reader of the file that we're searching
fReader = new BufferedReader(new FileReader(file));
System.out.println("File to read: " + file.getAbsolutePath());
logger.info("File to read: " + file.getAbsolutePath());
StringWriter sWriter = new StringWriter();
// stores new file contents

Expand All @@ -248,7 +248,7 @@ public String replace(File file, Hashtable htStrings,
if (c != '.') {
// hold the dot and let the old processing happen
sHold = new String((new Character(c)).toString());
System.out.println("sHold = " + sHold);
logger.info("sHold = " + sHold);
} else {
sFoundBuffer.append(c);
bCheckForDot = false;
Expand Down Expand Up @@ -280,7 +280,7 @@ public String replace(File file, Hashtable htStrings,
// what if we have a substring of another string that
// we are searching for?

System.out.println(
logger.info(
"REPLACER:MATCH found: " + ri.sFind + " matches " + sTemp);
ri.foundOccurance();
bSomethingWasReplaced = true;
Expand Down Expand Up @@ -315,7 +315,7 @@ public String replace(File file, Hashtable htStrings,
if (bSomethingWasReplaced) {
sNewFileName = sTempDir + File.separator + "web.xml."
+ implementation_name;
System.out.println("New filename:" + sNewFileName);
logger.info("New filename:" + sNewFileName);
fNewWriter = new BufferedWriter(
new FileWriter(new File(sNewFileName)));
fNewWriter.write(sWriter.toString());
Expand Down Expand Up @@ -353,7 +353,7 @@ class ReplacementInfo {
public void foundOccurance() {
iFoundOccurances++;
if (TestUtil.harnessDebug) {
System.out.println("we found an occurance #" + iFoundOccurances
logger.info("we found an occurance #" + iFoundOccurances
+ " of '" + sFind + "'");
}
}
Expand All @@ -379,7 +379,7 @@ private Hashtable replaceOnWebInfoStrings(Hashtable extras) {
String buff = null;
int startPos = 0;
for (int i = 0; i < searchFor.length; i++) {
System.out.println("\n###Searching for=" + searchFor[i]);
logger.info("\n###Searching for=" + searchFor[i]);
if ((startPos = val.lastIndexOf(searchFor[i])) != -1) {
changeIt = true;
String startBuff = val.substring(0, startPos);
Expand All @@ -390,7 +390,7 @@ private Hashtable replaceOnWebInfoStrings(Hashtable extras) {
}
if (changeIt) {
extras.put((String) sKey, val);
System.out.println(
logger.info(
"\n###\nold webInfo Val=" + oldJndi + "\nNew webInfo Val = " + val);
}
}
Expand Down
31 changes: 14 additions & 17 deletions websocket/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
<artifactId>websocket-tck</artifactId>
<packaging>jar</packaging>

<name>WEBSOCKET</name>
<description>WEBSOCKET</description>
<name>websocket</name>
<description>websocket tck tests</description>

<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<tck.version>${project.version}</tck.version>
<junit.jupiter.version>5.9.1</junit.jupiter.version>
<arquillian.junit>1.7.0.Alpha14</arquillian.junit>
Expand All @@ -53,26 +55,21 @@
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.jupiter.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-core</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-core</artifactId>
<version>${arquillian.junit}</version>
</dependency>
<dependency>
<groupId>jakartatck</groupId>
<artifactId>common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import jakarta.websocket.HandshakeResponse;

public class WSClientIT {

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

/* Run test */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
import jakarta.websocket.CloseReason.CloseCodes;

public class WSClientIT {

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

final CloseCodes[] codes = { CloseReason.CloseCodes.CANNOT_ACCEPT, CloseReason.CloseCodes.CLOSED_ABNORMALLY,
CloseReason.CloseCodes.GOING_AWAY, CloseReason.CloseCodes.NORMAL_CLOSURE,
Expand Down Expand Up @@ -152,8 +151,8 @@ public void valuesTest() throws Exception {
}
}
passed_array[i] = true;
System.out.println("Expected CloseCodes " + codes[i] + " returned");
System.out.println("Expected CloseCodes " + codes[i] + " returned");
logger.info("Expected CloseCodes " + codes[i] + " returned");
logger.info("Expected CloseCodes " + codes[i] + " returned");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
import jakarta.websocket.DecodeException;

public class WSClientIT {

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

/* Run test */
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@
import jakarta.websocket.DeploymentException;

public class WSClientIT {

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

/* Run test */
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
import jakarta.websocket.EncodeException;

public class WSClientIT {

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

/* Run test */
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@
*/
package com.sun.ts.tests.websocket.api.jakarta.websocket.server.serverendpointconfig;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import jakarta.websocket.Endpoint;
import jakarta.websocket.EndpointConfig;
import jakarta.websocket.Session;

public class TCKEndpoint extends Endpoint {

private static final Logger logger = LoggerFactory.getLogger(TCKEndpoint.class.getName());

@Override
public void onOpen(Session session, EndpointConfig config) {
System.out.println("========TCKEndpoint");
logger.info("========TCKEndpoint");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@

@ExtendWith(ArquillianExtension.class)
public class WSClientIT {

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

private static final Logger logger = LoggerFactory.getLogger(WSClientIT.class.getName());

@Deployment(testable = false)
public static WebArchive createDeployment() throws IOException {
Expand Down Expand Up @@ -115,7 +114,7 @@ public void constructortest() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed");
Expand Down Expand Up @@ -174,7 +173,7 @@ public void subprotocolsTest() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());
if (passed == false) {
throw new Exception("Test failed: " + log.toString());
}
Expand Down Expand Up @@ -251,7 +250,7 @@ public void extensionsTest() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());
if (passed == false) {
throw new Exception("Test failed: " + log.toString());
}
Expand Down Expand Up @@ -365,7 +364,7 @@ public void constructorTest1() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -427,7 +426,7 @@ public void encodersTest() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -490,7 +489,7 @@ public void decodersTest() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -637,7 +636,7 @@ public void constructorTest2() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -820,7 +819,7 @@ public void constructorTest3() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -860,7 +859,7 @@ public void configuratorTest() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -928,7 +927,7 @@ public void constructorTest4() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -964,7 +963,7 @@ public void getEndpointClassTest() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -1000,7 +999,7 @@ public void getPathTest() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down Expand Up @@ -1187,7 +1186,7 @@ public void constructorTest5() throws Exception {
passed = false;
}

System.out.println(log.toString());
logger.info(log.toString());

if (passed == false) {
throw new Exception("Test failed: " + log.toString());
Expand Down
Loading

0 comments on commit a323f8b

Please sign in to comment.