コード例 #1
0
 private void test_exception(Base base) {
   try {
     String retval = base.base_op("bad_name");
     fail("base_op returned without exception on bad call");
   } catch (BadInput e) {
     // expected exception
   }
 }
コード例 #2
0
  private void test_ops(Base base) {
    String retval;
    try {
      retval = base.base_op("base_op");
    } catch (BadInput e) {
      fail(e.toString());
    }

    Foo foo = FooHelper.narrow(base);

    assertNotNull(foo);

    try {
      retval = foo.foo_op("foo_op");
    } catch (BadInput e) {
      fail(e.toString());
    }

    try {
      retval = foo.base_op("base_op");
    } catch (BadInput e) {
      fail(e.toString());
    }
  }