User: schaefera
Date: 02/04/14 21:28:15
Modified: src/main/org/jboss/test/banknew/test Tag: Branch_2_4
BankMarathonTestCase.java BankStressTestCase.java
Log:
Minor fixes regarding to the JNDI names of the beans.
Revision Changes Path
No revision
No revision
1.1.2.2 +33 -21
jbosstest/src/main/org/jboss/test/banknew/test/Attic/BankMarathonTestCase.java
Index: BankMarathonTestCase.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/banknew/test/Attic/BankMarathonTestCase.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- BankMarathonTestCase.java 15 Apr 2002 02:32:26 -0000 1.1.2.1
+++ BankMarathonTestCase.java 15 Apr 2002 04:28:15 -0000 1.1.2.2
@@ -9,7 +9,19 @@
import javax.ejb.*;
import javax.naming.*;
import javax.management.*;
-import org.jboss.test.bank.interfaces.*;
+import org.jboss.test.banknew.ejbeans.AccountBean;
+import org.jboss.test.banknew.ejbeans.BankBean;
+import org.jboss.test.banknew.ejbeans.CustomerBean;
+import org.jboss.test.banknew.ejbeans.TellerBean;
+import org.jboss.test.banknew.interfaces.Account;
+import org.jboss.test.banknew.interfaces.AccountData;
+import org.jboss.test.banknew.interfaces.AccountHome;
+import org.jboss.test.banknew.interfaces.Bank;
+import org.jboss.test.banknew.interfaces.BankHome;
+import org.jboss.test.banknew.interfaces.Customer;
+import org.jboss.test.banknew.interfaces.CustomerHome;
+import org.jboss.test.banknew.interfaces.Teller;
+import org.jboss.test.banknew.interfaces.TellerHome;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -23,7 +35,7 @@
*
* @see <related>
* @author Author: d_jencks among many others
- * @version $Revision: 1.1.2.1 $
+ * @version $Revision: 1.1.2.2 $
*/
public class BankMarathonTestCase
extends JBossTestCase
@@ -52,10 +64,10 @@
throws Exception
{
System.out.println( "AS testTeller()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
Teller teller = home.create();
- BankHome bankHome = (BankHome)new InitialContext().lookup(BankHome.JNDI_NAME);
+ BankHome bankHome = (BankHome)new InitialContext().lookup( BankBean.JNDI_NAME
);
Bank bank = bankHome.create();
log.info("Acquire customers");
@@ -80,14 +92,14 @@
getLog().info("Average call time: "+((end - start) / (iter*6)));
log.info("Show balance");
- AccountHome accountHome = (AccountHome)new
InitialContext().lookup(AccountHome.JNDI_NAME);
+ AccountHome accountHome = (AccountHome)new InitialContext().lookup(
AccountBean.JNDI_NAME );
Collection accts = accountHome.findAll();
Iterator enum = accts.iterator();
while(enum.hasNext())
{
Account acct = (Account)enum.next();
AccountData data = acct.getData();
-
log.info(data.getId()+"("+data.getOwner().getName()+"):"+data.getBalance());
+ log.info(data.getId()+"("+data.getOwnerId()+"):"+data.getBalance());
acct.withdraw(data.getBalance()); // Clear
}
@@ -100,7 +112,7 @@
{
System.out.println( "AS testBank()" );
log.info("Get code");
- BankHome bankHome = (BankHome)new InitialContext().lookup(BankHome.JNDI_NAME);
+ BankHome bankHome = (BankHome)new InitialContext().lookup( BankBean.JNDI_NAME
);
Bank bank = bankHome.create();
@@ -115,7 +127,7 @@
log.info("Customer test----------------------------------");
log.info("Create Customer");
- CustomerHome customerHome = (CustomerHome)new
InitialContext().lookup("Customer");
+ CustomerHome customerHome = (CustomerHome)new InitialContext().lookup(
"Customer");
Account from, to;
try
{
@@ -139,7 +151,7 @@
log.info(to.getPrimaryKey()+":"+to.getBalance());
log.info("Transfer money");
- TellerHome home = (TellerHome)new InitialContext().lookup("Teller");
+ TellerHome home = (TellerHome)new InitialContext().lookup( "Teller");
Teller teller = home.create();
long start = System.currentTimeMillis();
@@ -164,7 +176,7 @@
{
System.out.println( "AS BankMarathonTestCase.testEntityCreation()" );
- TellerHome lHome = (TellerHome) new InitialContext().lookup(
TellerHome.JNDI_NAME );
+ TellerHome lHome = (TellerHome) new InitialContext().lookup(
TellerBean.JNDI_NAME );
final Teller lTeller = lHome.create();
final Object lLock = new Object();
@@ -268,7 +280,7 @@
throws Exception
{
System.out.println( "AS testMultiThread2()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
final Teller teller = home.create();
log.info("Acquire customers");
@@ -344,7 +356,7 @@
throws Exception
{
System.out.println( "AS testTransaction()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
Teller teller = home.create();
log.info("Acquire customers");
@@ -366,8 +378,8 @@
log.info("Transfer done");
log.info("Show balance");
-
log.info(from.getPrimaryKey()+"("+from.getOwner().getName()+"):"+from.getBalance());
- log.info(to.getPrimaryKey()+"("+to.getOwner().getName()+"):"+to.getBalance());
+ log.info(from.getPrimaryKey()+"("+from.getOwnerId()+"):"+from.getBalance());
+ log.info(to.getPrimaryKey()+"("+to.getOwnerId()+"):"+to.getBalance());
teller.remove();
@@ -379,7 +391,7 @@
{
System.out.println( "AS testTransfer()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
Teller teller = home.create();
log.info("Acquire customers");
@@ -417,7 +429,7 @@
{
System.out.println( "AS testReadOnly()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
Teller teller = home.create();
log.info("Acquire customers");
@@ -455,7 +467,7 @@
System.out.println( "AS testPassivation()" );
// Create a bunch of customers, to test passivation
- CustomerHome home = (CustomerHome)new
InitialContext().lookup(CustomerHome.JNDI_NAME);
+ CustomerHome home = (CustomerHome)new InitialContext().lookup(
CustomerBean.JNDI_NAME );
getLog().info("Create customers");
@@ -472,14 +484,14 @@
System.out.println( "AS testFinder()" );
//create some accounts
testPassivation();
- AccountHome home = (AccountHome)new
InitialContext().lookup(AccountHome.JNDI_NAME);
+ AccountHome home = (AccountHome)new InitialContext().lookup(
AccountBean.JNDI_NAME );
getLog().info("Get large accounts");
Iterator enum = home.findLargeAccounts(-1).iterator();
while (enum.hasNext())
{
Account acct = (Account)enum.next();
- log.info(acct.getOwner().getName()+":"+acct.getBalance());
+ log.info(acct.getOwnerId()+":"+acct.getBalance());
}
System.out.println( "AS testFinder() ends" );
}
@@ -490,7 +502,7 @@
System.out.println( "AS setUp()" );
getLog().info("Remove accounts");
{
- AccountHome home = (AccountHome)new
InitialContext().lookup(AccountHome.JNDI_NAME);
+ AccountHome home = (AccountHome)new InitialContext().lookup(
AccountBean.JNDI_NAME );
Collection accounts = home.findAll();
Iterator enum = accounts.iterator();
while(enum.hasNext())
@@ -502,7 +514,7 @@
}
getLog().info("Remove customers");
{
- CustomerHome home = (CustomerHome)new
InitialContext().lookup(CustomerHome.JNDI_NAME);
+ CustomerHome home = (CustomerHome)new InitialContext().lookup(
CustomerBean.JNDI_NAME );
Collection customers = home.findAll();
Iterator enum = customers.iterator();
while(enum.hasNext())
1.1.2.2 +27 -18
jbosstest/src/main/org/jboss/test/banknew/test/Attic/BankStressTestCase.java
Index: BankStressTestCase.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/banknew/test/Attic/BankStressTestCase.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- BankStressTestCase.java 15 Apr 2002 02:32:26 -0000 1.1.2.1
+++ BankStressTestCase.java 15 Apr 2002 04:28:15 -0000 1.1.2.2
@@ -9,7 +9,19 @@
import javax.ejb.*;
import javax.naming.*;
import javax.management.*;
-import org.jboss.test.banknew.interfaces.*;
+import org.jboss.test.banknew.ejbeans.AccountBean;
+import org.jboss.test.banknew.ejbeans.BankBean;
+import org.jboss.test.banknew.ejbeans.CustomerBean;
+import org.jboss.test.banknew.ejbeans.TellerBean;
+import org.jboss.test.banknew.interfaces.Account;
+import org.jboss.test.banknew.interfaces.AccountData;
+import org.jboss.test.banknew.interfaces.AccountHome;
+import org.jboss.test.banknew.interfaces.Bank;
+import org.jboss.test.banknew.interfaces.BankHome;
+import org.jboss.test.banknew.interfaces.Customer;
+import org.jboss.test.banknew.interfaces.CustomerHome;
+import org.jboss.test.banknew.interfaces.Teller;
+import org.jboss.test.banknew.interfaces.TellerHome;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -23,11 +35,10 @@
*
* @see <related>
* @author Author: d_jencks among many others
- * @version $Revision: 1.1.2.1 $
+ * @version $Revision: 1.1.2.2 $
*/
public class BankStressTestCase
extends JBossTestCase
-//AS extends TestCase
{
// Constants -----------------------------------------------------
@@ -50,10 +61,10 @@
throws Exception
{
System.out.println( "AS testTeller()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
Teller teller = home.create();
- BankHome bankHome = (BankHome)new InitialContext().lookup(BankHome.JNDI_NAME);
+ BankHome bankHome = (BankHome)new InitialContext().lookup( BankBean.JNDI_NAME
);
Bank bank = bankHome.create();
log.info("Acquire customers");
@@ -78,7 +89,7 @@
getLog().info("Average call time: "+((end - start) / (iter*6)));
log.info("Show balance");
- AccountHome accountHome = (AccountHome)new
InitialContext().lookup(AccountHome.JNDI_NAME);
+ AccountHome accountHome = (AccountHome)new InitialContext().lookup(
AccountBean.JNDI_NAME );
Collection accts = accountHome.findAll();
Iterator enum = accts.iterator();
while(enum.hasNext())
@@ -98,7 +109,7 @@
{
System.out.println( "AS testBank()" );
log.info("Get code");
- BankHome bankHome = (BankHome)new InitialContext().lookup(BankHome.JNDI_NAME);
+ BankHome bankHome = (BankHome)new InitialContext().lookup( BankBean.JNDI_NAME
);
Bank bank = bankHome.create();
@@ -161,7 +172,7 @@
throws Exception
{
System.out.println( "AS testMultiThread()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
final Teller teller = home.create();
log.info("Acquire customers");
@@ -255,7 +266,7 @@
throws Exception
{
System.out.println( "AS testMultiThread2()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
final Teller teller = home.create();
log.info("Acquire customers");
@@ -331,7 +342,7 @@
throws Exception
{
System.out.println( "AS testTransaction()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
Teller teller = home.create();
log.info("Acquire customers");
@@ -366,7 +377,7 @@
{
System.out.println( "AS testTransfer()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
Teller teller = home.create();
log.info("Acquire customers");
@@ -404,7 +415,7 @@
{
System.out.println( "AS testReadOnly()" );
- TellerHome home = (TellerHome)new
InitialContext().lookup(TellerHome.JNDI_NAME);
+ TellerHome home = (TellerHome)new InitialContext().lookup(
TellerBean.JNDI_NAME );
Teller teller = home.create();
log.info("Acquire customers");
@@ -442,7 +453,7 @@
System.out.println( "AS testPassivation()" );
// Create a bunch of customers, to test passivation
- CustomerHome home = (CustomerHome)new
InitialContext().lookup(CustomerHome.JNDI_NAME);
+ CustomerHome home = (CustomerHome)new InitialContext().lookup(
CustomerBean.JNDI_NAME );
getLog().info("Create customers");
@@ -459,7 +470,7 @@
System.out.println( "AS testFinder()" );
//create some accounts
testPassivation();
- AccountHome home = (AccountHome)new
InitialContext().lookup(AccountHome.JNDI_NAME);
+ AccountHome home = (AccountHome)new InitialContext().lookup(
AccountBean.JNDI_NAME );
getLog().info("Get large accounts");
Iterator enum = home.findLargeAccounts(-1).iterator();
@@ -477,7 +488,7 @@
System.out.println( "AS setUp()" );
getLog().info("Remove accounts");
{
- AccountHome home = (AccountHome)new
InitialContext().lookup(AccountHome.JNDI_NAME);
+ AccountHome home = (AccountHome)new InitialContext().lookup(
AccountBean.JNDI_NAME );
Collection accounts = home.findAll();
Iterator enum = accounts.iterator();
while(enum.hasNext())
@@ -489,7 +500,7 @@
}
getLog().info("Remove customers");
{
- CustomerHome home = (CustomerHome)new
InitialContext().lookup(CustomerHome.JNDI_NAME);
+ CustomerHome home = (CustomerHome)new InitialContext().lookup(
CustomerBean.JNDI_NAME );
Collection customers = home.findAll();
Iterator enum = customers.iterator();
while(enum.hasNext())
@@ -507,7 +518,5 @@
{
return getDeploySetup( BankStressTestCase.class, "banknew.jar");
}
-
-
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development