package test; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codehaus.xfire.BaseTestCase; public class BadServiceTest extends BaseTestCase { Log log = LogFactory.getLog(BadServiceTest.class); /* * Test method for 'test.BadService.badMethod()' */ public void testBadMethod() throws Exception{ IBadService service = (IBadService) getStub(IBadService.class); boolean caught = false; try { service.badMethod(); } catch(MyException e){ caught= true; assertEquals(e.getMessage(),"bad bad"); } catch(Exception e){ log.error("",e); throw e; } if(!caught){ fail("no exception!"); } } /* * Test method for 'test.BadService.badSecondMethod()' */ public void testBadSecondMethod() throws Exception{ IBadService service = (IBadService) getStub(IBadService.class); boolean caught = false; try { service.badSecondMethod(); } catch(MySecondException e){ caught= true; assertEquals(e.getMessage(),"bad bad 2"); } if(!caught){ fail("no exception!"); } } }