@Test public void typedMapClassesShouldNotBeEmpty() { final MapBean mapBean = enhancedRandom.nextObject(MapBean.class); assertThat(mapBean).isNotNull(); assertContainsNonZeroIntegers(mapBean.getTypedHashMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedHashMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedHashtable().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedHashtable().values()); assertContainsNonZeroIntegers(mapBean.getTypedLinkedHashMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedLinkedHashMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedWeakHashMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedWeakHashMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedIdentityHashMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedIdentityHashMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedTreeMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedTreeMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedConcurrentSkipListMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedConcurrentSkipListMap().values()); }
@Test public void userDefinedMapTypeShouldBePopulated() throws Exception { CustomMap customMap = enhancedRandom.nextObject(CustomMap.class); assertThat(customMap).isNotNull(); assertThat(customMap.getName()).isNotNull(); }
@Test public void wildcardTypedMapClassesShouldBeEmpty() { final WildCardMapBean wildCardMapBean = enhancedRandom.nextObject(WildCardMapBean.class); assertThat(wildCardMapBean).isNotNull(); assertThat(wildCardMapBean.getBoundedWildCardTypedHashMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedHashMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedHashtable()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedHashtable()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedLinkedHashMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedHinkedHashMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedWeakHashMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedWeakHashMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedIdentityHashMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedIdentityHashMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedTreeMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedTreeMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedConcurrentSkipListMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedConcurrentSkipListMap()).isEmpty(); }
@Test public void enumMapTypeShouldBePopulated() throws Exception { EnumMapBean enumMapBean = enhancedRandom.nextObject(EnumMapBean.class); assertThat(enumMapBean).isNotNull(); assertThat(enumMapBean.getTypedEnumMap()).isNotNull(); assertThat(enumMapBean.getUntypedEnumMap()).isNull(); }
@Test public void compositeMapTypesShouldBeEmpty() { CompositeMapBean compositeMapBean = enhancedRandom.nextObject(CompositeMapBean.class); assertThat(compositeMapBean.getPersonToNicknames()).isEmpty(); assertThat(compositeMapBean.getPersonToAccounts()).isEmpty(); assertThat(compositeMapBean.getReallyStrangeCompositeDataStructure()).isEmpty(); }
@Test @SuppressWarnings("unchecked") public void rawMapInterfacesShouldBeEmpty() { final MapBean mapBean = enhancedRandom.nextObject(MapBean.class); assertThat(mapBean).isNotNull(); assertThat(mapBean.getMap()).isEmpty(); assertThat(mapBean.getSortedMap()).isEmpty(); assertThat(mapBean.getNavigableMap()).isEmpty(); assertThat(mapBean.getConcurrentMap()).isEmpty(); assertThat(mapBean.getConcurrentNavigableMap()).isEmpty(); }
@Test @SuppressWarnings("unchecked") public void rawMapClassesShouldBeEmpty() { final MapBean mapBean = enhancedRandom.nextObject(MapBean.class); assertThat(mapBean).isNotNull(); assertThat(mapBean.getHashMap()).isEmpty(); assertThat(mapBean.getHashtable()).isEmpty(); assertThat(mapBean.getLinkedHashMap()).isEmpty(); assertThat(mapBean.getWeakHashMap()).isEmpty(); assertThat(mapBean.getIdentityHashMap()).isEmpty(); assertThat(mapBean.getTreeMap()).isEmpty(); assertThat(mapBean.getConcurrentSkipListMap()).isEmpty(); }
@Test public void typedMapInterfacesShouldNotBeEmpty() { final MapBean mapBean = enhancedRandom.nextObject(MapBean.class); assertThat(mapBean).isNotNull(); assertContainsNonZeroIntegers(mapBean.getTypedMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedSortedMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedSortedMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedNavigableMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedNavigableMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedConcurrentMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedConcurrentMap().values()); assertContainsNonZeroIntegers(mapBean.getTypedConcurrentNavigableMap().keySet()); assertContainsOnlyNonEmptyPersons(mapBean.getTypedConcurrentNavigableMap().values()); }
@Test public void wildcardTypedMapInterfacesShouldBeEmpty() { final WildCardMapBean wildCardMapBean = enhancedRandom.nextObject(WildCardMapBean.class); assertThat(wildCardMapBean).isNotNull(); assertThat(wildCardMapBean.getBoundedWildCardTypedMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedSortedMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedSortedMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedNavigableMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedNavigableMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedConcurrentMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedConcurrentMap()).isEmpty(); assertThat(wildCardMapBean.getBoundedWildCardTypedConcurrentNavigableMap()).isEmpty(); assertThat(wildCardMapBean.getUnboundedWildCardTypedConcurrentNavigableMap()).isEmpty(); }
@Test public void jodaTimeBeansShouldBeFilledIn() { Organizer organizer = enhancedRandom.nextObject(Organizer.class); assertThat(organizer).hasNoNullFieldsOrProperties(); }