@Test(expected = java.lang.ArithmeticException.class) public void testDiv() { Calculator calculator = new Calculator(); assertEquals(10, calculator.div(1, 0), -1); }
@WebMethod public float div(float a, float b) { if (b == 0.0F) throw new ArithmeticException("Divide by zero not allowed ... Bailing out!"); return a / b; }
Calculator { @WebMethod public float div(float a, float b) { if (b == 0.0F) throw new ArithmeticException("Divide by zero not allowed ... Bailing out!"); return a / b; } }
Calculator { @WebMethod public float div(float a, float b) { if (b == 0.0F) throw new ArithmeticException("Divide by zero not allowed ... Bailing out!"); return a / b; }  }
Calculator { @WebMethod public float div(float a, float b) { if (b == 0.0F) throw new ArithmeticException("Divide by zero not allowed ... Bailing out!"); return a / b; }  @WebMethod float sum(float a, float b); @WebMethod float div(float a, float b); @WebMethod float mul(float a, float b); @WebMethod float sub(float a, float b); }
Calculator { @WebMethod public float div(float a, float b) { if (b == 0.0F) throw new ArithmeticException("Divide by zero not allowed ... Bailing out!"); return a / b; }  @WebMethod float sum(float a, float b); @WebMethod float div(float a, float b); @WebMethod float mul(float a, float b); @WebMethod float sub(float a, float b);  }