GenericPropertyUtil { public static Class<?> resolveType(Object bean, String name, Class<?> genericClass, int index) throws IllegalArgumentException, IllegalStateException { if (bean == null) { throw new IllegalArgumentException("Argument 'bean' (" + Object.class.getName() + " is null"); } if (StringUtils.isBlank(name)) { throw new IllegalArgumentException("Argument 'name' (" + String.class.getName() + " is empty"); } Method method = getMethod(bean, name); return resolveType(genericClass, method.getReturnType(), method .getGenericReturnType(), index); }  static Class<?> resolveCollectionType(Object bean,
            String name); static Class<?> resolveType(Object bean, String name,
            Class<?> genericClass,
            int index);  }
@Test public void testResolveTypeObjectStringClassint01() throws Exception { try { GenericPropertyUtil.resolveType(null, (String) null, null, 0); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { String message = "Argument 'bean' (" + Object.class.getName() + " is null"; assertEquals(message, e.getMessage()); assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint02() throws Exception { try { GenericPropertyUtil.resolveType(new Object(), (String) null, null, 0); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { String message = "Argument 'name' (" + String.class.getName() + " is empty"; assertEquals(message, e.getMessage()); assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint03() throws Exception { try { GenericPropertyUtil.resolveType(new Object(), "", null, 0); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { String message = "Argument 'name' (" + String.class.getName() + " is empty"; assertEquals(message, e.getMessage()); assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint04() throws Exception { try { GenericPropertyUtil.resolveType(new Object(), " ", null, 0); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { String message = "Argument 'name' (" + String.class.getName() + " is empty"; assertEquals(message, e.getMessage()); assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint05() throws Exception { try { GenericPropertyUtil.resolveType(new GenericPropertyUtil_Stub01(), "map0", Map.class, 0); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint06() throws Exception { try { GenericPropertyUtil.resolveType(new GenericPropertyUtil_Stub01(), "map1", Map.class, -1); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint07() throws Exception { Class<?> actual = GenericPropertyUtil.resolveType( new GenericPropertyUtil_Stub01(), "map1", Map.class, 0); assertEquals(String.class, actual); }
@Test public void testResolveTypeObjectStringClassint08() throws Exception { Class<?> actual = GenericPropertyUtil.resolveType( new GenericPropertyUtil_Stub01(), "map1", Map.class, 0); assertEquals(String.class, actual); }
@Test public void testResolveTypeObjectStringClassint09() throws Exception { try { GenericPropertyUtil.resolveType(new GenericPropertyUtil_Stub01(), "map1", Map.class, 2); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint10() throws Exception { try { GenericPropertyUtil.resolveType(new GenericPropertyUtil_Stub01(), "map1", null, 1); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint11() throws Exception { Class<?> actual = GenericPropertyUtil.resolveType( new GenericPropertyUtil_Stub01(), "map2", Map.class, 0); assertEquals(String[].class, actual); }
@Test public void testResolveTypeObjectStringClassint12() throws Exception { Class<?> actual = GenericPropertyUtil.resolveType( new GenericPropertyUtil_Stub01(), "map2", Map.class, 1); assertEquals(List.class, actual); }
@Test public void testResolveTypeObjectStringClassint13() throws Exception { try { GenericPropertyUtil.resolveType(new GenericPropertyUtil_Stub01(), "map2", String.class, 1); fail("例外がスローされませんでした。"); } catch (IllegalStateException e) { assertEquals(IllegalStateException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint14() throws Exception { try { GenericPropertyUtil.resolveType(new GenericPropertyUtil_Stub01(), "integer", int.class, 1); fail("例外がスローされませんでした。"); } catch (IllegalStateException e) { assertEquals("No parameterizedType was detected.", e.getMessage()); assertEquals(IllegalStateException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint15() throws Exception { try { GenericPropertyUtil.resolveType(new GenericPropertyUtil_Stub01(), "object", Object.class, 1); fail("例外がスローされませんでした。"); } catch (IllegalStateException e) { assertEquals("No parameterizedType was detected.", e.getMessage()); assertEquals(IllegalStateException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeObjectStringClassint16() throws Exception { Class<?> actual = GenericPropertyUtil.resolveType( new GenericPropertyUtil_Stub01(), "map3", Map.class, 0); assertEquals(Object.class, actual); }
@Test public void testResolveTypeClassClassTypeint01() throws Exception { try { GenericPropertyUtil.resolveType((Class<?>) null, (Class<?>) null, null, 0); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { String message = "Argument 'genericsClass' (" + Class.class .getName() + ") is null"; assertEquals(message, e.getMessage()); assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeClassClassTypeint02() throws Exception { try { GenericPropertyUtil.resolveType(List.class, (Class<?>) null, null, 0); fail("例外がスローされませんでした。"); } catch (IllegalStateException e) { String message = List.class + " is not assignable from " + "null"; assertEquals(message, e.getMessage()); assertEquals(IllegalStateException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeClassClassTypeint03() throws Exception { try { GenericPropertyUtil.resolveType(List.class, Object.class, null, 0); fail("例外がスローされませんでした。"); } catch (IllegalStateException e) { String message = List.class + " is not assignable from " + Object.class; assertEquals(message, e.getMessage()); assertEquals(IllegalStateException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeClassClassTypeint04() throws Exception { try { GenericPropertyUtil.resolveType(List.class, GenericPropertyUtil_ArrayListStub01.class, null, -1); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { String message = "Argument 'index'(-1) is out of bounds of" + " generics parameters"; assertEquals(message, e.getMessage()); assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeClassClassTypeint05() throws Exception { Class<?> actual = GenericPropertyUtil.resolveType(List.class, GenericPropertyUtil_ArrayListStub01.class, null, 0); assertEquals(String.class, actual); }
@Test public void testResolveTypeClassClassTypeint06() throws Exception { try { GenericPropertyUtil.resolveType(List.class, GenericPropertyUtil_ArrayListStub01.class, null, 1); fail("例外がスローされませんでした。"); } catch (IllegalArgumentException e) { String message = "Argument 'index'(1) is out of bounds of" + " generics parameters"; assertEquals(message, e.getMessage()); assertEquals(IllegalArgumentException.class.getName(), e.getClass() .getName()); } }
@Test public void testResolveTypeClassClassTypeint07() throws Exception { Class<?> actual = GenericPropertyUtil.resolveType(List.class, ArrayList.class, List.class, 0); assertEquals(Object.class, actual); assertThat(logger.getLoggingEvents(), is(asList(trace( "Concrete type of Type(E) was " + "not found in ancestorList([java.util.AbstractList<E>, " + "java.util.List<E>])")))); }