java - how to look up an EJB in a test class but interfaces are in other maven project? -


Text after "

I work with TestNG on the criteria of an EJB project and using JBoss-Embedded-EJB and I work on one My interface is sound on different projects and implementation projects on which I test and the institutions are part of another project. So I have tree projects:

  1. oap-entities
  2. oap-interface (includes all my interfaces)
  3. oap-Impli (all implementations included Oap-interface project)

All these projects are mavenzed.

I try to use jboss embedded for testing by TestNG but every time I run as Maven, try the following henchmen on the console:

  Test -------------------------------------------------- ------- Running TestSite Warning 22-01 17: 55: 41,764 (Binskeba Binding. Java: Internet 3333) -You should use 2.0 version of microstantner XML xmlns = 'kalash: jboss: bean deployer: 2.0 'View UserTransaction: org.jboss.ejb3.embedded.UserTransactionI Mpl javax.naming.NameNotFoundException: EJB: No bound test run: 2, failures: 2, Errors: 0, left: 0, time passed: 2.408 seconds & lt; & Lt; & Lt; Failure!  

I followed it

OAMP - Interface Project's Pam. In XML, I am creating dependencies of op-model and also the dependency of the op-interface project in the op-intuit project.

Looks like a test class in op-inslog:

  package com.jboss.embedded.testng; Import javax.naming.InitialContext; Import javax.naming.NamingException; Import org.jboss.ejb3.embedded.EJB3Standalone Bootstrap; Import org.jboss.ejb3.embedded.EJB3StandaloneDeployer; Import org.testng.annotations.AfterClass; Import org.testng.annotations.BeforeClass; Import org.testng.annotations.Test; Import com.jboss.embedded.testng.Impl.PersonFact; Import org.oap-interfaces.mine.locals.IPersonLocal; Import org.oap-interfaces.mine.remotes.IPersonRemote; Public category HelloWorldTest {Private Stable Boolean Containering = False; Private EJB 3 Standalone Deproer Deparrier; Private iPSnemote iPSnemote; Private IPSL Local iPSNokal; @BeforeClass Public Zero init () {startupEmbeddedContainer (); Early Continent Initial Contex; Try {initialContext = new InitialContext (); IpsisNocal = (IpsosLocal) Initial Context. Lookup ("port / local"); IPersonFactoryRemote = (iPSNemote) Initial Context. Lookup ("Personal Fact / Remote"); } Hold (naming exception e) {System.out.println ("*** *** can not be seen of EJB" + E); }} @Test Public Zero localTest () {println ("Find **** local customers based on ID =>". + IPersonLocal.findByClient ("1") getFirstName () + "" + iPersonLocal.findByClient ("1") getLastName ()); } @Test Public Zero remoteTest () {println ("**** Remain customer based on Remote ID = & gt;", + IPersonRemote.findByClient ("1") getFirstName () + "+ + + iPersonLocal.findByClient ( "1") getLastName ()). } @AfterClass public sparse ends () throws exception {deployer.stop (); Deployer.destroy (); EJB3StandaloneBootstrap.shutdown (); Containerering = false; } Private Zero Startup Embedded Container (if (Containerring) (EJB3 standbenbutstrip.boot (empty); Deployment = EJB3 standbenbootstrip.accreditor depreciator (); Deployer.getArchivesByResource () ("META-INF / persistence.xml" ) Try; Deployer.create (); deployer.start ();} Hold (Exception e) {System.out .println ("*** Planner can not be created and can not be added persistance.xml *** "+ E);} ContainerRunning = true;}}}  

How does it make errors?


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -