Re: Struts Hibernate error

2005-08-23 Thread Luiz Godoy
 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:585)
 at junit.framework.TestCase.runTest(TestCase.java:154)
 at junit.framework.TestCase.runBare(TestCase.java:127)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected(TestResult.java:124)
 at junit.framework.TestResult.run(TestResult.java:109)
 at junit.framework.TestCase.run(TestCase.java:118)
 at junit.framework.TestSuite.runTest(TestSuite.java:208)
 at junit.framework.TestSuite.run(TestSuite.java:203)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:436)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:311)
 at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


Emmanouil Batsis <[EMAIL PROTECTED]> wrote:
Luiz Godoy wrote:

>I´m having this error using eclipse, with struts and hibernate, any clue ?
>

Not without the stacktrace.

Manos

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Luiz Octavio Godoy 

Desenvolvimento de Sistemas


-
Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.

Struts Hibernate error

2005-08-23 Thread Luiz Godoy

I´m having this error using eclipse, with struts and hibernate, any clue ?

INFO: using CGLIB reflection optimizer

23/08/2005 10:12:25 org.hibernate.cfg.Environment 

INFO: using JDK 1.4 java.sql.Timestamp handling

23/08/2005 10:12:25 org.apache.struts.action.RequestProcessor processException

WARNING: Unhandled Exception thrown: class java.lang.RuntimeException

Thanks 


Luiz Octavio Godoy 

Desenvolvimento de Sistemas


-
 Start your day with Yahoo! - make it your home page 

Testing Struts With JUnit

2005-08-18 Thread Luiz Godoy


 

I´m trying to test the action below :

public class FamiliaDNCAction extends BasicAction {

public ActionForward unspecified(ActionMapping actionMapping, ActionForm 
actionForm, HttpServletRequest request, HttpServletResponse response) throws 
BusinessException {
  Set msgs = new HashSet();  
  return loadPage(actionMapping,actionForm,request,response);
 }

public ActionForward loadPage(ActionMapping actionMapping, ActionForm 
actionForm, HttpServletRequest request, HttpServletResponse response) throws 
BusinessException {
  HttpSession session=request.getSession();
  CadastroFamiliaDNC cad = new CadastroFamiliaDNC();
 FamiliaDNCForm form = (FamiliaDNCForm) actionForm;
  List dados = cad.findByCodigoDependencia(form.getCodDependencia().intValue());
  session.setAttribute("dadosdnc",dados); 
  return actionMapping.findForward("inicial");
 }

}

The parameters for the action are 

FamiliaDNC.do -- calls the class
ev --> the parameter for the method, when not set calls "unspecified" method

public class TestFamiliaDNCAction extends MockStrutsTestCase{
 FamiliaDNCAction fdnca;
  public TestFamiliaDNCAction(String nomeDoTeste) {
super(nomeDoTeste);
 }
  
  public void setUp() throws Exception {
super.setUp();
fdnca = new FamiliaDNCAction();
}

  public void testLoadPage() {
  
   addRequestParameter("codDependencia","1");
   addRequestParameter("codTipoFamiliaInsumo","0");
   addRequestParameter("ev","unspecified");
setRequestPathInfo("/corporativo/cadastro/cadFamiliaDNC");
actionPerform();
verifyForward("inicial");
 verifyForwardPath("/corporativo/cadastro/corp_cad_familia_dnc.jsp");
verifyNoActionErrors();
}

 I´m getting nullPointerException, when i try to test it. I´m not sure 
witch parameters i add to the request for example in the action form i have:


  
  
  
  .
/form>  

My question is, witch parameters do i put in the addRequestParameter("?","?"); ?

any clue ?

Thanks in advance 

regards..



Luiz Octavio Godoy 

Desenvolvimento de Sistemas

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com