Olá Colegas,
Estou fazendo um curso na revista DevMedia e, está dando erros ao fazer um teste em uma das minhas classes. Se algum colega puder me ajudar ficarei grato.
Segue abaixo a classe UserSessiionTest e a Lista de erros logo abaixo:
*** Classe UserSessionTest ***
package br.com.devmedia.session;
import br.com.devmedia.entity.Address;
import br.com.devmedia.entity.User;
import br.com.devmedia.entity.types.CountryType;
import java.util.List;
import javax.ejb.embeddable.EJBContainer;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
public class UserSessionTest {
public static Integer idOfUser;
private static EJBContainer container;
public UserSessionTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
container = javax.ejb.embeddable.EJBContainer.createEJBContainer();
}
@AfterClass
public static void tearDownClass() throws Exception {
container.close();
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of saveUser method, of class UserSession.
*/
@Test
public void testSaveUser() throws Exception {
System.out.println("saveUser");
// User us = null; antes
User us = new User(); // depois
us.setEmail("dyego.carmo@go-java.com");
us.setName("Dyego Carmo");
us.setUsername("dyego");
us.setPassword("123");
//System.out.println("CONFIGURA ENDEREÇO PARA O USUÁRIO");
// Configura um endereço para o usuário
Address addr = new Address();
addr.setAddress("Rua dos Malvinos");
addr.setCountry(CountryType.BRASIL);
addr.setNumber(0);
addr.setNickname("Principal");
addr.setPostalCode("80240-240");
addr.setStateOfAddress("Parana");
//System.out.println("GRAVA O ENDEREÇO PARA O USUÁRIO");
// Grava endereço acima para o usuário
us.addAddress(addr);
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
// User expResult = null; ANTES
User result = instance.saveUser(us);
System.out.println("FINALIZA SAVEUSER");
// Aqui teremos a certeza que o usuário e o endereço foram adicionados.
idOfUser = result.getId();
assertTrue(result.getId().intValue() > 0); // DEPOIS
assertTrue(result.getAddresses().get(0).getId().intValue() > 0); // DEPOIS
}
/**
* Test of getUserById method, of class UserSession.
*/
public void testGetUserById() throws Exception {
System.out.println("getUserById("+idOfUser+")");
int idUser = 0;
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
User expResult = null;
User result = instance.getUserById(idUser);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of setUser method, of class UserSession.
*/
public void testSetUser() throws Exception {
System.out.println("setUser");
User us = null;
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
User expResult = null;
User result = instance.setUser(us);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of getAllUsers method, of class UserSession.
*/
public void testGetAllUsers() throws Exception {
System.out.println("getAllUsers");
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
List expResult = null;
List result = instance.getAllUsers();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of getUsersByName method, of class UserSession.
*/
public void testGetUsersByName() throws Exception {
System.out.println("getUsersByName");
String name = "";
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
List expResult = null;
List result = instance.getUsersByName(name);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of isUserOk method, of class UserSession.
*/
public void testIsUserOk() throws Exception {
System.out.println("isUserOk");
String username = "";
String password = "";
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
boolean expResult = false;
boolean result = instance.isUserOk(username, password);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of getAddressesOfUser method, of class UserSession.
*/
public void testGetAddressesOfUser() throws Exception {
System.out.println("getAddressesOfUser");
User us = null;
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
List expResult = null;
List result = instance.getAddressesOfUser(us);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of getAddress method, of class UserSession.
*/
public void testGetAddress() throws Exception {
System.out.println("getAddress");
int idAddress = 0;
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
Address expResult = null;
Address result = instance.getAddress(idAddress);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of removeUser method, of class UserSession.
*/
public void testRemoveUser_User() throws Exception {
System.out.println("removeUser");
User us = null;
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
instance.removeUser(us);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of removeUser method, of class UserSession.
*/
public void testRemoveUser_int() throws Exception {
System.out.println("removeUser");
int idUser = 0;
UserSession instance = (UserSession) javax.ejb.embeddable.EJBContainer.createEJBContainer().getContext().lookup("java:global/classes/UserSession");
boolean expResult = false;
boolean result = instance.removeUser(idUser);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}
*** Lista de erros no UserSessionTest ***
[list]
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
Compiling 1 source file to H:\AmbienteDesenvolvimento\ProjetoDeSistema\Java\ExemploProjetos\EcommerceDevMedia\build\web\WEB-INF\classes
compile:
compile-test-single:
WARNING: multiple versions of ant detected in path for junit
jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9.1/java/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
and jar:file:/C:/sdk/glassfish/modules/ant.jar!/org/apache/tools/ant/Project.class
Testsuite: br.com.devmedia.session.UserSessionTest
saveUser
27/01/2011 20:05:49 com.sun.enterprise.v3.server.AppServerStartup run
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Embedded(1670ms) startup services(452ms) total(2122ms)
27/01/2011 20:05:49 org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMXStartupService: JMXConnector system is disabled, skipping.
27/01/2011 20:05:49 com.sun.enterprise.transaction.JavaEETransactionManagerSimplified initDelegates
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
27/01/2011 20:05:50 AppServerStartup run
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
27/01/2011 20:05:55 com.sun.enterprise.deployment.archivist.Archivist readAnnotations
AVISO: Error in annotation processing: java.lang.NoClassDefFoundError: build/web/WEB-INF/classes/br/com/devmedia/session/ProductSession (wrong name: br/com/devmedia/session/ProductSession)
27/01/2011 20:05:55 org.glassfish.api.ActionReport failure
GRAVE: Exception while deploying the app
java.lang.IllegalArgumentException: Invalid ejb jar [EcommerceDevMedia.jar]: it contains zero ejb.
Note:
- A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean.
- EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
- If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to see whether the annotations were processed properly.
at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:72)
at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:124)
at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:722)
at com.sun.enterprise.deployment.Application.visit(Application.java:1744)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:774)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:253)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:222)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:152)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:79)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:612)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:554)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144)
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:128)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78)
at br.com.devmedia.session.UserSessionTest.testSaveUser(UserSessionTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:518)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1052)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:906)
27/01/2011 20:05:55 org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
INFO: [EJBContainerProviderImpl] Cleaning up on failure …
27/01/2011 20:05:55 org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMXStartupService and JMXConnectors have been shut down.
27/01/2011 20:05:55 com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Shutdown procedure finished
27/01/2011 20:05:55 AppServerStartup run
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting
27/01/2011 20:05:55 org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
GRAVE: ejb.embedded.exception_instantiating
javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:135)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78)
at br.com.devmedia.session.UserSessionTest.testSaveUser(UserSessionTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:518)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1052)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:906)
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 8,377 sec
------------- Standard Output ---------------
saveUser
------------- Standard Error -----------------
27/01/2011 20:05:49 com.sun.enterprise.v3.server.AppServerStartup run
INFO: GlassFish Server Open Source Edition 3.0.1 (22) startup time : Embedded(1670ms) startup services(452ms) total(2122ms)
27/01/2011 20:05:49 org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMXStartupService: JMXConnector system is disabled, skipping.
27/01/2011 20:05:49 com.sun.enterprise.transaction.JavaEETransactionManagerSimplified initDelegates
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate
27/01/2011 20:05:50 AppServerStartup run
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
27/01/2011 20:05:55 com.sun.enterprise.deployment.archivist.Archivist readAnnotations
AVISO: Error in annotation processing: java.lang.NoClassDefFoundError: build/web/WEB-INF/classes/br/com/devmedia/session/ProductSession (wrong name: br/com/devmedia/session/ProductSession)
27/01/2011 20:05:55 org.glassfish.api.ActionReport failure
GRAVE: Exception while deploying the app
java.lang.IllegalArgumentException: Invalid ejb jar [EcommerceDevMedia.jar]: it contains zero ejb.
Note:
- A valid ejb jar requires at least one session, entity (1.x/2.x style), or message-driven bean.
- EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
- If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven, @Singleton), please check server.log to see whether the annotations were processed properly.
at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:72)
at com.sun.enterprise.deployment.util.ApplicationValidator.accept(ApplicationValidator.java:124)
at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:722)
at com.sun.enterprise.deployment.Application.visit(Application.java:1744)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:774)
at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:253)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:222)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:152)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:79)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:612)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:554)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:262)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:214)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:144)
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:128)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78)
at br.com.devmedia.session.UserSessionTest.testSaveUser(UserSessionTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:518)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1052)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:906)
27/01/2011 20:05:55 org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
INFO: [EJBContainerProviderImpl] Cleaning up on failure …
27/01/2011 20:05:55 org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMXStartupService and JMXConnectors have been shut down.
27/01/2011 20:05:55 com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Shutdown procedure finished
27/01/2011 20:05:55 AppServerStartup run
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting
27/01/2011 20:05:55 org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
GRAVE: ejb.embedded.exception_instantiating
javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:135)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:120)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78)
at br.com.devmedia.session.UserSessionTest.testSaveUser(UserSessionTest.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:518)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1052)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:906)
Testcase: testSaveUser(br.com.devmedia.session.UserSessionTest): Caused an ERROR
No EJBContainer provider available
The following providers:
org.glassfish.ejb.embedded.EJBContainerProviderImpl
Returned null from createEJBContainer call.
javax.ejb.EJBException: No EJBContainer provider available
The following providers:
org.glassfish.ejb.embedded.EJBContainerProviderImpl
Returned null from createEJBContainer call.
at javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:186)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:121)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78)
at br.com.devmedia.session.UserSessionTest.testSaveUser(UserSessionTest.java:70)
Test br.com.devmedia.session.UserSessionTest FAILED
H:\AmbienteDesenvolvimento\ProjetoDeSistema\Java\ExemploProjetos\EcommerceDevMedia\nbproject\build-impl.xml:910: Some tests failed; see details above.
FALHA NA CONSTRUÇÃO (tempo total: 13 segundos)
[/list]
Abraços