![]() |
![]() |
![]() |
![]() |
![]() |
||||||
![]() |
Index | News | FAQ | Download | Lists | Issues![]() |
![]() |
||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
||||||
OverviewAn error occurred: http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/counter-stateful-pojo/README.txt. The system administrator has been notified.The CodeIn this example we develop a simple counter stateful session EJB. Local business interface
Remote business interfaceAn error occurred: http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/counter-stateful-pojo/src/main/java/org/apache/openejb/examples/counter/CounterRemote.java. The system administrator has been notified.BeanAn error occurred: http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/counter-stateful-pojo/src/main/java/org/apache/openejb/examples/counter/CounterImpl.java. The system administrator has been notified.Writing a unit test for the exampleWriting an unit test for the stateful session EJB is quite simple. We need just to write a setup method to create and initialize the InitialContext, and then write our test methods setUpAn error occurred: http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/counter-stateful-pojo/src/test/java/org/apache/openejb/examples/counter/CounterImplTest.java. The system administrator has been notified.Note the "openejb.deployments.classpath.include" parameter, which tells the ejb container to search for EJBs in the classpath, and specifies in which java packages they are to be located. Test the local business interfaceAn error occurred: http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/counter-stateful-pojo/src/test/java/org/apache/openejb/examples/counter/CounterImplTest.java. The system administrator has been notified.Test the remote business interfaceAn error occurred: http://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/counter-stateful-pojo/src/test/java/org/apache/openejb/examples/counter/CounterImplTest.java. The system administrator has been notified.RunningRunning the example is fairly simple, just run: $ cd counter-stateful-pojo Which should create output like the following. ------------------------------------------------------- T E S T S ------------------------------------------------------- [OPENEJB:surefire] Running org.apache.openejb.examples.counter.CounterImplTest log4j:WARN No appenders could be found for logger (OpenEJB). log4j:WARN Please initialize the log4j system properly. Apache OpenEJB 3.0-incubating-SNAPSHOT build: 20070105-12:45 http://incubator.apache.org/openejb OpenEJB ready. [OPENEJB:surefire] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 1.943 sec [OPENEJB:INFO] [jar:jar] [OPENEJB:INFO] Building jar: openejb3/examples/counter-stateful-pojo/target/simple-counter-statefuls-1.0-SNAPSHOT.jar [OPENEJB:INFO] [install:install] [OPENEJB:INFO] Installing openejb3/examples/counter-stateful-pojo/target/simple-counter-statefuls-1.0-SNAPSHOT.jar ... [OPENEJB:INFO] ------------------------------------------------------------------------ [OPENEJB:INFO] BUILD SUCCESSFUL [OPENEJB:INFO] ------------------------------------------------------------------------ |
![]() |
|||||||||
![]()
|
![]() |