예제 #1
0
  @Test
  public void testFieldNameOf() throws Exception {
    String name = "foo";
    Assert.assertTrue("foo".equals(FieldName.of("foo")));
    Assert.assertTrue("bar".equals(FieldName.of("bar")));
    new AssertedFailure(FieldName.FieldNameNotFoundException.class) {

      @Override
      protected void thisMustFail() throws Throwable {
        FieldName.of("buh");
      }
    };
    Assert.assertTrue("x".equals(FieldName.of(E2.class, "x")));
    Assert.assertTrue("y".equals(FieldName.of(E2.class, "y")));
  }