[jboss-cvs] JBossAS SVN: r101716 - in projects/ejb-book/trunk/ch05-encryption/src/test: resources and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 2 09:59:47 EST 2010


Author: ALRubinger
Date: 2010-03-02 09:59:47 -0500 (Tue, 02 Mar 2010)
New Revision: 101716

Removed:
   projects/ejb-book/trunk/ch05-encryption/src/test/resources/jndi.properties
Modified:
   projects/ejb-book/trunk/ch05-encryption/src/test/java/org/jboss/ejb3/examples/ch05/encryption/EncryptionIntegrationTestCase.java
Log:
[EJBBOOK-20] Inject @EJB into the Encryption integration tests

Modified: projects/ejb-book/trunk/ch05-encryption/src/test/java/org/jboss/ejb3/examples/ch05/encryption/EncryptionIntegrationTestCase.java
===================================================================
--- projects/ejb-book/trunk/ch05-encryption/src/test/java/org/jboss/ejb3/examples/ch05/encryption/EncryptionIntegrationTestCase.java	2010-03-02 13:33:52 UTC (rev 101715)
+++ projects/ejb-book/trunk/ch05-encryption/src/test/java/org/jboss/ejb3/examples/ch05/encryption/EncryptionIntegrationTestCase.java	2010-03-02 14:59:47 UTC (rev 101716)
@@ -25,8 +25,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 
-import javax.naming.Context;
-import javax.naming.InitialContext;
+import javax.ejb.EJB;
 
 import junit.framework.TestCase;
 
@@ -35,7 +34,6 @@
 import org.jboss.logging.Logger;
 import org.jboss.shrinkwrap.api.Archives;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -60,22 +58,12 @@
    private static final Logger log = Logger.getLogger(EncryptionIntegrationTestCase.class);
 
    /**
-    * The JNDI Naming Context
-    */
-   private static Context namingContext;
-
-   /**
     * The EJB 3.x local business view of the EncryptionEJB
     */
+   @EJB
    private static EncryptionLocalBusiness encryptionLocalBusiness;
 
    /**
-    * JNDI Name of the Business Reference
-    */
-   //TODO Use Global JNDI Syntax or injection
-   private static final String JNDI_NAME_ENCRYPTION_LOCAL_BUSINESS = EncryptionBean.EJB_NAME + "Local";
-
-   /**
     * Correlates to the env-entry within ejb-jar.xml, to be used as an override from the default 
     */
    private static final String EXPECTED_CIPHERS_PASSPHRASE = "OverriddenPassword";
@@ -102,20 +90,6 @@
    }
 
    // ---------------------------------------------------------------------------||
-   // Lifecycle Methods ---------------------------------------------------------||
-   // ---------------------------------------------------------------------------||
-
-   @BeforeClass
-   public static void beforeClass() throws Throwable
-   {
-      // Create the naming context, using jndi.properties on the CP
-      namingContext = new InitialContext();
-
-      // Obtain EJB 3.x Business Reference
-      encryptionLocalBusiness = (EncryptionLocalBusiness) namingContext.lookup(JNDI_NAME_ENCRYPTION_LOCAL_BUSINESS);
-   }
-
-   // ---------------------------------------------------------------------------||
    // Tests ---------------------------------------------------------------------||
    // ---------------------------------------------------------------------------||
 

Deleted: projects/ejb-book/trunk/ch05-encryption/src/test/resources/jndi.properties
===================================================================
--- projects/ejb-book/trunk/ch05-encryption/src/test/resources/jndi.properties	2010-03-02 13:33:52 UTC (rev 101715)
+++ projects/ejb-book/trunk/ch05-encryption/src/test/resources/jndi.properties	2010-03-02 14:59:47 UTC (rev 101716)
@@ -1,2 +0,0 @@
-# JNDI Properties for Local interaction with OpenEJB Naming Provider 
-java.naming.factory.initial=org.apache.openejb.client.LocalInitialContextFactory
\ No newline at end of file




More information about the jboss-cvs-commits mailing list