Skip to content

Commit

Permalink
Update Remaining TCK Tests to EJB 3.0
Browse files Browse the repository at this point in the history
- Removes all remaining usage of EJBHome/EJBLocalHome from non-optional
  tests
  • Loading branch information
brideck committed May 9, 2024
1 parent 53add1b commit 2e16606
Show file tree
Hide file tree
Showing 226 changed files with 1,012 additions and 4,102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,6 @@ com/sun/ts/tests/ejb30/bb/session/stateful/migration/threetwo/override = javaee_
com/sun/ts/tests/ejb30/bb/session/stateless/migration/threetwo/annotated = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateless/migration/threetwo/descriptor = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateless/migration/threetwo/override = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateful/remove/complement = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateful/remove/annotated = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateful/remove/descriptor = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateful/remove/override = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateless/migration/twothree/annotated = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateless/migration/twothree/descriptor = javaee_optional ejb_2x_optional
com/sun/ts/tests/ejb30/bb/session/stateless/migration/twothree/override = javaee_optional ejb_2x_optional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024 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
Expand All @@ -20,10 +20,12 @@

package com.sun.ts.tests.connector.deployment;

import java.rmi.RemoteException;
import java.util.Properties;

import jakarta.ejb.EJBObject;
public interface Deployment {
public void initialize(Properties props);

public interface Deployment extends EJBObject {
boolean testRarInEar() throws RemoteException;
public boolean testRarInEar();

public void cleanup();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024 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
Expand Down Expand Up @@ -33,8 +33,6 @@ public class DeploymentClient extends EETest {
// Harness requirements
private Deployment hr = null;

private DeploymentHome home = null;

private StringBuffer logData = null;

private Properties props = null;
Expand Down Expand Up @@ -66,9 +64,7 @@ public void setup(String[] args, Properties p) throws Exception {

try {
jc = new TSNamingContext();
logMsg("Looked up home!!");
home = (DeploymentHome) jc.lookup("java:comp/env/ejb/Deployment",
DeploymentHome.class);
hr = (Deployment) jc.lookup("java:comp/env/ejb/Deployment", Deployment.class);
logMsg("Setup ok;");
} catch (Exception e) {
throw new Exception("Setup Failed!", e);
Expand All @@ -90,9 +86,9 @@ public void setup(String[] args, Properties p) throws Exception {
*/
public void testRarInEar() throws Exception {
try {
hr.initialize(props);

hr = home.create(props);

// invoke method on the EJB
boolean result = hr.testRarInEar();

if (result) {
Expand All @@ -101,15 +97,14 @@ public void testRarInEar() throws Exception {
throw new Exception("Embedded resource adapter test failed");
}

// invoke method on the EJB
logMsg("Test passed;");
} catch (Exception e) {
throw new Exception("Test Failed!", e);
}
}

/* cleanup -- none in this case */
public void cleanup() throws Exception {
hr.cleanup();
logMsg("Cleanup ok;");
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024 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
Expand Down Expand Up @@ -28,11 +28,7 @@
import com.sun.ts.tests.common.connector.whitebox.TSDataSource;
import com.sun.ts.tests.connector.util.DBSupport;

import jakarta.ejb.CreateException;
import jakarta.ejb.SessionBean;
import jakarta.ejb.SessionContext;

public class DeploymentEJB implements SessionBean {
public class DeploymentEJB {
private TSNamingContext context = null;

private Properties p = null;
Expand All @@ -56,15 +52,15 @@ public class DeploymentEJB implements SessionBean {
public DeploymentEJB() {
}

public void ejbCreate(Properties props) throws CreateException {
public void initialize(Properties props) {
p = props;
try {
this.context = new TSNamingContext();

TestUtil.logTrace("ejbCreate");
TestUtil.logTrace("initialize");
TestUtil.init(props);

System.out.println("Inside ejbCreate of DeploymentEJB!");
System.out.println("Inside initialize of DeploymentEJB!");

whitebox_tx = p.getProperty("whitebox-embed");

Expand Down Expand Up @@ -129,20 +125,8 @@ public boolean testRarInEar() {
return result;
}

public void setSessionContext(SessionContext sc) {

try {
TestUtil.logTrace("setSessionContext");
// this.context = new TSNamingContext();
} catch (Exception sqle) {
TestUtil.printStackTrace(sqle);
sqle.getMessage();
}

}

public void ejbRemove() {
TestUtil.logTrace("ejbRemove");
public void cleanup() {
TestUtil.logTrace("cleanup");
try {
if (con != null) {
con.close();
Expand All @@ -152,10 +136,4 @@ public void ejbRemove() {
}
}

public void ejbActivate() {
}

public void ejbPassivate() {
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2024 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
Expand All @@ -23,7 +23,6 @@
<ejb-ref>
<ejb-ref-name>ejb/Deployment</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.sun.ts.tests.connector.deployment.DeploymentHome</home>
<remote>com.sun.ts.tests.connector.deployment.Deployment</remote>
</ejb-ref>
</application-client>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2024 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
Expand All @@ -22,8 +22,7 @@
<enterprise-beans>
<session>
<ejb-name>Deployment</ejb-name>
<home>com.sun.ts.tests.connector.deployment.DeploymentHome</home>
<remote>com.sun.ts.tests.connector.deployment.Deployment</remote>
<business-remote>com.sun.ts.tests.connector.deployment.Deployment</business-remote>
<ejb-class>com.sun.ts.tests.connector.deployment.DeploymentEJB</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024 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
Expand All @@ -20,12 +20,11 @@

package com.sun.ts.tests.connector.localTx.transaction.conSharing2;

import java.rmi.RemoteException;
import java.util.Vector;

import jakarta.ejb.EJBObject;
public interface BeanA {
public void initialize();

public interface BeanA extends EJBObject {
// Database methods
/**
* Make a JDBC <code>Connection</code> to the specified database. DataSource
Expand All @@ -34,23 +33,23 @@ public interface BeanA extends EJBObject {
* @param tName
* the name of the table
* @return void
* @exception RemoteException
* @exception EJBException
* If the JDBC <code>Connection</code> could not be made.
*/
public void dbConnectfirst() throws RemoteException;
public void dbConnectfirst();

public void dbConnectsecond() throws RemoteException;
public void dbConnectsecond();

/**
* Creates the specified table.
*
* @param tName
* the name of the table
* @return void
* @exception RemoteException
* @exception EJBException
* If the specified table could not be created.
*/
public void createData() throws RemoteException;
public void createData();

/**
* Add a new row to the specified table, where key is unique.
Expand All @@ -60,10 +59,10 @@ public interface BeanA extends EJBObject {
* @param key
* the unique key id of the new row
* @return boolean <code>true</code> if row was inserted; false otherwise
* @exception RemoteException
* @exception EJBException
* If the new row could not be added.
*/
public boolean insert(String str) throws RemoteException;
public boolean insert(String str);

/**
* Delete a range of rows from the specified table.
Expand All @@ -75,32 +74,32 @@ public interface BeanA extends EJBObject {
* @param toKey
* the end of the range of row
* @return void
* @exception RemoteException
* @exception EJBException
* If the range of rows could not be deleted.
*/
public void delete(String str) throws RemoteException;
public void delete(String str);

/**
* Drop the specified table.
*
* @param tName
* the name of the table
* @return void
* @exception RemoteException
* @exception EJBException
* If the table could not be dropped.
*/
public void destroyData() throws RemoteException;
public void destroyData();

/**
* Closes the JDBC <code>Connection</code> to the RDBMS.
*
* @param tName
* the name of the table
* @return void
* @exception RemoteException
* @exception EJBException
* If the <code>Connection</code> could not be closed.
*/
public void dbUnConnect() throws RemoteException;
public void dbUnConnect();

/**
* Get the results of a row in the specified table.
Expand All @@ -111,10 +110,10 @@ public interface BeanA extends EJBObject {
* the unique key identifer for the row
* @return Vector the Vector contains the row of the specified table in a
* prescribed format.
* @exception RemoteException
* @exception EJBException
* If the table row result could not be obtained.
*/
public Vector getResults() throws RemoteException;
public Vector getResults();

/**
* Required method of the TS test infrastructure. Allows server side logging
Expand All @@ -123,7 +122,7 @@ public interface BeanA extends EJBObject {
* @param p
* the TS environment specific properties
* @return void
* @exception RemoteException
* @exception EJBException
* If the client/server logging relationship could not be
* established.
*/
Expand Down
Loading

0 comments on commit 2e16606

Please sign in to comment.