Skip to content

Commit

Permalink
#23507 Fixed connector tests + compatible with JDK17
Browse files Browse the repository at this point in the history
  • Loading branch information
dmatej committed Mar 3, 2022
1 parent fd1b5a7 commit 05fb554
Show file tree
Hide file tree
Showing 28 changed files with 48 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public int getCoffeeCount() {
iSpec.setFunctionName("COUNTCOFFEE");
RecordFactory rf = cf.getRecordFactory();
IndexedRecord iRec = rf.createIndexedRecord("InputRecord");
Record oRec = ix.execute(iSpec, iRec);
jakarta.resource.cci.Record oRec = ix.execute(iSpec, iRec);
Iterator iterator = ((IndexedRecord)oRec).iterator();
while(iterator.hasNext()) {
Object obj = iterator.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@
package com.sun.s1peqe.connector.cci;

import java.math.BigDecimal;
import java.util.*;
import java.util.Iterator;
import jakarta.ejb.*;
import jakarta.resource.cci.*;
import jakarta.resource.cci.Connection;
import jakarta.resource.cci.ConnectionSpec;
import jakarta.resource.cci.ConnectionFactory;
import jakarta.resource.cci.IndexedRecord;
import jakarta.resource.cci.Interaction;
import jakarta.resource.cci.RecordFactory;
import jakarta.resource.ResourceException;
import javax.naming.*;

import com.sun.connector.cciblackbox.*;

public class CoffeeBean implements SessionBean {
Expand All @@ -38,7 +44,7 @@ public void ejbCreate() throws CreateException {
public void setSessionContext(SessionContext sc) {
try {
this.sc = sc;
Context ic = new InitialContext();
InitialContext ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
cf = (jakarta.resource.cci.ConnectionFactory) ic.lookup("java:comp/env/eis/CCIEIS");
Expand All @@ -58,7 +64,7 @@ public int getCoffeeCount() {
iSpec.setFunctionName("COUNTCOFFEE");
RecordFactory rf = cf.getRecordFactory();
IndexedRecord iRec = rf.createIndexedRecord("InputRecord");
Record oRec = ix.execute(iSpec, iRec);
jakarta.resource.cci.Record oRec = ix.execute(iSpec, iRec);
Iterator iterator = ((IndexedRecord)oRec).iterator();
while(iterator.hasNext()) {
Object obj = iterator.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ admin.domain=domain1
admin.domain.dir=${env.S1AS_HOME}/domains
activeconsumer.maxnum=1
mail.host="ha21sca.sfbay.sun.com"
http.port=8080
http.port=${env.PORT_HTTP}
http.host=localhost
https.host=localhost
https.port=8181
https.port=${env.PORT_HTTPS}
orb.port=3700
admin.password=admin123
master.password=admin123
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
#

execution.mode=pe
admin.port=4848
admin.port=${env.PORT_ADMIN}
admin.user=admin
admin.host=localhost
admin.domain=domain1
admin.domain.dir=${env.S1AS_HOME}/domains
activeconsumer.maxnum=1
mail.host="ha21sca.sfbay.sun.com"
http.port=8080
http.port=${env.PORT_HTTP}
http.host=localhost
https.host=localhost
https.port=8181
https.port=${env.PORT_HTTPS}
orb.port=3700
admin.password=adminadmin
master.password=changeit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS);
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public int getCoffeeCount() {
iSpec.setFunctionName("COUNTCOFFEE");
RecordFactory rf = cf.getRecordFactory();
IndexedRecord iRec = rf.createIndexedRecord("InputRecord");
Record oRec = ix.execute(iSpec, iRec);
jakarta.resource.cci.Record oRec = ix.execute(iSpec, iRec);
Iterator iterator = ((IndexedRecord) oRec).iterator();
while (iterator.hasNext()) {
Object obj = iterator.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS);
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
package com.sun.s1peqe.connector.cci;

import java.math.BigDecimal;
import java.util.*;
import java.util.Iterator;
import jakarta.ejb.*;
import jakarta.resource.cci.*;
import jakarta.resource.cci.Connection;
import jakarta.resource.cci.ConnectionSpec;
import jakarta.resource.cci.ConnectionFactory;
import jakarta.resource.cci.IndexedRecord;
import jakarta.resource.cci.Interaction;
import jakarta.resource.cci.RecordFactory;
import jakarta.resource.ResourceException;
import javax.naming.*;

Expand Down Expand Up @@ -59,7 +64,7 @@ public int getCoffeeCount() {
iSpec.setFunctionName("COUNTCOFFEE");
RecordFactory rf = cf.getRecordFactory();
IndexedRecord iRec = rf.createIndexedRecord("InputRecord");
Record oRec = ix.execute(iSpec, iRec);
jakarta.resource.cci.Record oRec = ix.execute(iSpec, iRec);
Iterator iterator = ((IndexedRecord) oRec).iterator();
while (iterator.hasNext()) {
Object obj = iterator.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
stat.printSummary(TEST_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = Integer.valueOf(portS);
int port = Integer.parseInt(portS);

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
stat.printSummary(TEST_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void main(String args[]) {
String versionToTest = args[3];
versionToTest = versionToTest.trim();

int port = new Integer(portS);
int port = Integer.parseInt(portS);
String name;

int testVersion = Integer.valueOf(versionToTest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void main(String args[]) {

stat.addDescription(TEST_NAME);

int port = Integer.valueOf(portS);
int port = Integer.parseInt(portS);

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
stat.printSummary(TEST_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = Integer.valueOf(portS);
int port = Integer.parseInt(portS);

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
stat.printSummary(TEST_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static void main(String args[]) {
String contextRoot = args[2];
String expectedCount = args[3];

int port = Integer.valueOf(portS);
int port = Integer.parseInt(portS);

goGet(host, port, "TEST", contextRoot + "/SimpleServlet", expectedCount);
stat.printSummary(TEST_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void main(String args[]) {
String versionToTest = args[3];
versionToTest = versionToTest.trim();

int port = new Integer(portS);
int port = Integer.parseInt(portS);
String name;

int testVersion = Integer.valueOf(versionToTest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ test_run(){
echo Running target: ${TARGET}
time ant clean-all start-record ${TARGET} stop-record report | tee ${TEST_RUN_LOG}
antStatus=${?}
cp connector.output tests-run.log
ant stopDomain stopDerby
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@
fork="true"
>
<arg line="${db.driver}" />
<arg line="${http.port}" />
</java>
<antcall target="drop-table" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -33,7 +34,7 @@
public class WebTest {

static String host = "localhost";
static int port = 8080;
static int port;

private static SimpleReporterAdapter status = new SimpleReporterAdapter();

Expand All @@ -44,7 +45,7 @@ public class WebTest {
public static void main(String[] args) {

driver = args[0];

port = Integer.parseInt(args[1]);
status.addDescription("SecurityMap WebTest");
try {
runTests();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void main(String args[]) {
String portS = args[1];
String contextRoot = args[2];

int port = new Integer(portS).intValue();
int port = Integer.parseInt(portS);
String name;

goGet(host, port, "TEST", contextRoot + "/SimpleServlet");
Expand Down

0 comments on commit 05fb554

Please sign in to comment.