[jboss-user] [EJB 3.0] - Re: ant failed.

samwan809 do-not-reply at jboss.com
Sat Jul 18 22:07:58 EDT 2009


Yeah it works in half way now...getting there...
I just don't know what I have missing in the Client.java in order to run it with Junit. I searched google , but couldn't found definite/clear answer.
the following errors shown:


  | 
  | calling_card_reg # ant test
  | Buildfile: build.xml
  | 
  | compile-test:
  | 
  | test:
  |     [junit] Testsuite: com.ip6networks.calling_card_registration.test.Client
  |     [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.011 sec
  |     [junit] 
  |     [junit] Testcase: warning(junit.framework.TestSuite$1):     FAILED
  |     [junit] No tests found in com.ip6networks.calling_card_registration.test.Client
  |     [junit] junit.framework.AssertionFailedError: No tests found in com.ip6networks.calling_card_registration.test.Client
  |     [junit] 
  |     [junit] 
  |     [junit] Test com.ip6networks.calling_card_registration.test.Client FAILED
  | 
  | BUILD SUCCESSFUL
  | Total time: 2 seconds
  | 
  | 

The source code for Client.java is shown below:

  | package com.ip6networks.calling_card_registration.test;
  | 
  | import  com.ip6networks.calling_card_registration.test.Calculator;
  | import  com.ip6networks.calling_card_registration.test.CalculatorRemote;
  | import  com.ip6networks.calling_card_registration.test.ServiceLocator;
  | 
  | public class Client
  | {
  |    public static void main(String[] args) throws Exception
  |    {
  |       Calculator calculator = getSession();
  |       System.out.println("in Client class");
  |       System.out.println("1 + 1 = " + calculator.add(1, 1));
  |       System.out.println("1 - 1 = " + calculator.subtract(1, 1));
  | 
  |    }
  | 
  |       private static Calculator  getSession() throws Exception {
  |              Calculator  mgr = null;
  |              mgr = (Calculator) ServiceLocator.getInstance().getService("Calculator");
  |                 if (mgr == null) {
  |                         //throw new SystemErrorException("Unable to connect to service");
  |                         throw new Exception("Unable to connect to service");
  |                 } else {
  |                         return mgr;
  |                 }
  |         }
  | }
  | 
  | 

Thanks very much.
Sam


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244496#4244496

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244496



More information about the jboss-user mailing list