@Test(expected = IllegalArgumentException.class) public void testEmptyParameterInIsType() { Field[] declaredFields = Peopple.class.getDeclaredFields(); FieldTools fieldTool = new FieldTools(declaredFields[0]); fieldTool.isType(null); }
@Test public void testSameType() { Field[] declaredFields = Peopple.class.getDeclaredFields(); FieldTools fieldTool = new FieldTools(declaredFields[0]); Boolean result = fieldTool.isType(String.class); assertTrue(result); }
@Test public void testClassDotAttributeName() { final String expected = "peopple.name"; Field[] declaredFields = Peopple.class.getDeclaredFields(); FieldTools fieldTool = new FieldTools(declaredFields[0]); String result = fieldTool.getClassDotName(); assertEquals(expected, result); }
@Test public void testInJspNamed() { final String expected = "${peopple.name}"; Field[] declaredFields = Peopple.class.getDeclaredFields(); FieldTools fieldTool = new FieldTools(declaredFields[0]); String result = fieldTool.getInJspNamed(); assertEquals(expected, result); }
@Test public void testOwnerClassInSimpleName() { final String expected = "peopple"; Field[] declaredFields = Peopple.class.getDeclaredFields(); FieldTools fieldTool = new FieldTools(declaredFields[0]); String result = fieldTool.getDeclaringClassinSimpleName(); assertEquals(expected, result); }