Skip to content

Commit

Permalink
Clean up EJB TCK buckets that are partially dependent on entity EJBs
Browse files Browse the repository at this point in the history
  • Loading branch information
brideck committed Mar 6, 2024
1 parent a6e8720 commit c161f04
Show file tree
Hide file tree
Showing 154 changed files with 902 additions and 12,210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
archivename="appclient_dep_ejblink_single"
mainclass="com.sun.ts.tests.appclient.deploy.ejblink.single.Client">
<fileset dir="${class.dir}"
includes="${ts.dao.classes.coffee.standard},
com/sun/ts/tests/assembly/util/shared/ejbref/single/TestCode.class,
com/sun/ts/tests/assembly/util/refbean/*Internal.class,
com/sun/ts/tests/assembly/util/refbean/*InternalHome.class,
com/sun/ts/tests/assembly/util/refbean/*External.class,
com/sun/ts/tests/assembly/util/refbean/*ExternalHome.class"/>
includes="com/sun/ts/tests/assembly/util/shared/ejbref/single/TestCode.class,
com/sun/ts/tests/assembly/util/refbean/*Internal.class,
com/sun/ts/tests/assembly/util/refbean/*InternalHome.class,
com/sun/ts/tests/assembly/util/refbean/*External.class,
com/sun/ts/tests/assembly/util/refbean/*ExternalHome.class"/>
</ts.clientjar>

<ts.ear archivename="appclient_dep_ejblink_single"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
archivename="appclient_dep_ejbref_single"
mainclass="com.sun.ts.tests.appclient.deploy.ejbref.single.Client">
<fileset dir="${class.dir}"
includes="${ts.dao.classes.coffee.standard},
com/sun/ts/tests/assembly/util/shared/ejbref/single/TestCode.class,
com/sun/ts/tests/assembly/util/refbean/*Internal.class,
com/sun/ts/tests/assembly/util/refbean/*InternalHome.class,
com/sun/ts/tests/assembly/util/refbean/*External.class,
com/sun/ts/tests/assembly/util/refbean/*ExternalHome.class"/>
includes="com/sun/ts/tests/assembly/util/shared/ejbref/single/TestCode.class,
com/sun/ts/tests/assembly/util/refbean/*Internal.class,
com/sun/ts/tests/assembly/util/refbean/*InternalHome.class,
com/sun/ts/tests/assembly/util/refbean/*External.class,
com/sun/ts/tests/assembly/util/refbean/*ExternalHome.class"/>
</ts.clientjar>

<ts.ear archivename="appclient_dep_ejbref_single"/>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

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 @@ -72,30 +72,6 @@ public void setup(String[] args, Properties p) throws Fault {

/* Run test */

/*
* @testName: test1
*
* @assertion_ids: EJB:SPEC:2.3
*
* @test_Strategy: Create a Message-Driven Bean for a Queue that accesses a
* Local Entity Bean within the same EAR. Deploy the EAR on the J2EE server.
* Verify local access from Message-Driven Bean to a local Entity Bean.(CMP)
*/

public void test1() throws Fault {
String TestCase = "local_access_from_mdb_queue_to_entity_bean_test1";
logTrace("local_access_from_mdb_queue_to_entity_bean_test1");
boolean pass = false;
int TestNum = 1;
try {
pass = doTest(TestNum, TestCase);
} catch (Exception e) {
throw new Fault("test1 failed", e);
}
if (!pass)
throw new Fault("test1 failed");
}

/*
* @testName: test2
*
Expand Down Expand Up @@ -127,29 +103,6 @@ public void test2() throws Fault {
throw new Fault("test2 failed");
}

/*
* @testName: test3
*
* @assertion_ids: EJB:SPEC:2.2
*
* @test_Strategy: Create a Message-Driven Bean for a Queue that accesses a
* Local Session Bean within the same EAR. Deploy the EAR on the J2EE server.
* Verify local access from Message-Driven Bean to a local Entity Bean (BMP).
*/

public void test3() throws Fault {
String TestCase = "local_access_from_mdb_queue_to_session_bean_test3";
boolean pass = false;
int TestNum = 3;
try {
pass = doTest(TestNum, TestCase);
} catch (Exception e) {
throw new Fault("test3 failed", e);
}
if (!pass)
throw new Fault("test3 failed");
}

/*
* @testName: test4
*
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 Down Expand Up @@ -40,62 +40,33 @@ public class TestBeanMDB extends ParentMsgBean {

private Properties harnessProps = null;

// Entity Bean (CMP) A -> Local Interface Only
// Session Bean (SF) B -> Local Interface Only
// Entity Bean (BMP) C -> Local Interface Only
// Session Bean (SL) D -> Local Interface Only

// JNDI Names for A, B, C, D Local Home Interface
private static final String ALocal = "java:comp/env/ejb/AEJBLocal";

// JNDI Names for B, D Local Home Interface
private static final String BLocal = "java:comp/env/ejb/BEJBLocal";

private static final String CLocal = "java:comp/env/ejb/CEJBLocal";

private static final String DLocal = "java:comp/env/ejb/DEJBLocal";

// References to Local Interfaces for Session and Entity Bean A,B,C,D
private ALocal aLocalRef = null;

private ALocalHome aLocalHome = null;

// References to Local Interfaces for Session Bean B,D
private BLocal bLocalRef = null;

private BLocalHome bLocalHome = null;

private CLocal cLocalRef = null;

private CLocalHome cLocalHome = null;

private DLocal dLocalRef = null;

private DLocalHome dLocalHome = null;

// ===========================================================
// private methods

private ALocal createA(int id, String name, int value) throws Exception {
TestUtil.logTrace("createA");
aLocalHome = (ALocalHome) context.lookup(ALocal);
aLocalRef = aLocalHome.createA(id, name, value);
return aLocalRef;
}

private BLocal createB() throws Exception {
TestUtil.logTrace("createB");
bLocalHome = (BLocalHome) context.lookup(BLocal);
bLocalRef = bLocalHome.createB();
return bLocalRef;
}

private CLocal createC(Properties p, int id, String name, int value)
throws Exception {
TestUtil.logTrace("createC");
cLocalHome = (CLocalHome) context.lookup(CLocal);
cLocalRef = cLocalHome.createC(p, id, name, value);
return cLocalRef;
}

private DLocal createD() throws Exception {
TestUtil.logTrace("createD");
dLocalHome = (DLocalHome) context.lookup(DLocal);
Expand All @@ -121,15 +92,9 @@ protected void runTests(Message msg, QueueSession qSession, String testName,

switch (msg.getIntProperty("TestCaseNum")) {

case 1:
result = test1();
break;
case 2:
result = test2();
break;
case 3:
result = test3();
break;
case 4:
result = test4();
break;
Expand Down Expand Up @@ -182,33 +147,6 @@ private void sendResponseToQ(String testcase, QueueSession qSession,
// ===========================================================
// TestBean interface (our business methods)

public boolean test1() {
TestUtil.logTrace("test1");
boolean pass = true;
try {
TestUtil.logMsg("Lookup local home of Entity Bean (CMP) and do create");
aLocalRef = createA(1, "a1", 1);
String s = aLocalRef.whoAmI();
TestUtil.logMsg("Calling local business method: " + s);
if (!s.equals("entity-cmp")) {
TestUtil.logErr(
"Wrong string returned: got: " + s + ", expected: entity-cmp");
pass = false;
}
} catch (Exception e) {
TestUtil.logErr("Caught exception: " + e.getMessage());
TestUtil.printStackTrace(e);
pass = false;
} finally {
try {
aLocalRef.remove();
} catch (Exception e) {
TestUtil.printStackTrace(e);
}
}
return pass;
}

public boolean test2() {
TestUtil.logTrace("test2");
boolean pass = true;
Expand All @@ -230,33 +168,6 @@ public boolean test2() {
return pass;
}

public boolean test3() {
TestUtil.logTrace("test3");
boolean pass = true;
try {
TestUtil.logMsg("Lookup local home of Entity Bean (BMP) and do create");
cLocalRef = createC(p, 1, "c1", 1);
String s = cLocalRef.whoAmI();
TestUtil.logMsg("Calling local business method: " + s);
if (!s.equals("entity-bmp")) {
TestUtil.logErr(
"Wrong string returned: got: " + s + ", expected: entity-bmp");
pass = false;
}
} catch (Exception e) {
TestUtil.logErr("Caught exception: " + e.getMessage());
TestUtil.printStackTrace(e);
pass = false;
} finally {
try {
cLocalRef.remove();
} catch (Exception e) {
TestUtil.printStackTrace(e);
}
}
return pass;
}

public boolean test4() {
TestUtil.logTrace("test4");
boolean pass = true;
Expand Down
Loading

0 comments on commit c161f04

Please sign in to comment.