/**
 * 
 */
package uk.co.jemos.podam.test.unit.pdm3;

import java.util.Collection;

import static org.junit.Assert.*;

import org.junit.Test;

import uk.co.jemos.podam.api.PodamFactory;
import uk.co.jemos.podam.api.PodamFactoryImpl;
import uk.co.jemos.podam.test.dto.pdm3.Pdm3Pojo;
import uk.co.jemos.podam.test.dto.pdm3.Pdm3PojoConstructor;
import uk.co.jemos.podam.test.dto.pdm3.Pdm3PojoGenericsConstructor;

/**
 * @author tedonema
 * 
 */
public class Pdm3PojoUnitTest {

	@Test
	public void testPdm3Pojo() {

		PodamFactory factory = new PodamFactoryImpl();
		Pdm3Pojo pojo = factory.manufacturePojo(Pdm3Pojo.class);
		assertNotNull(pojo);
		assertCollection(pojo.getSomething());
		assertCollection(pojo.getDescendants());
		assertCollection(pojo.getAncestors());
	}

	@Test
	public void testPdm3PojoConstructor() {

		PodamFactory factory = new PodamFactoryImpl();
		Pdm3PojoConstructor pojo = factory.manufacturePojo(Pdm3PojoConstructor.class, String.class);
		assertNotNull(pojo);
		assertNotNull(pojo.getName());
	}

	@Test
	public void testPdm3PojoGenericsConstructor() {

		PodamFactory factory = new PodamFactoryImpl();
		Pdm3PojoGenericsConstructor pojo = factory.manufacturePojo(Pdm3PojoGenericsConstructor.class);
		assertNotNull(pojo);
		assertCollection(pojo.getSomething());
		assertCollection(pojo.getDescendants());
		assertCollection(pojo.getAncestors());
	}

	private void assertCollection(Collection<?> collection) {

		assertNotNull("The collection element should not be null!",
				collection);
		assertFalse("The collection attribute should not be empty",
				collection.isEmpty());

	}
}

@@ -280,68 +280,8 @@
 jo;%0A
-import uk.co.jemos.podam.test.dto.pdm3.Pdm3PojoConstructor;%0A
 impo
@@ -712,261 +712,8 @@
 %09%7D%0A%0A
-%09@Test%0A%09public void testPdm3PojoConstructor() %7B%0A%0A%09%09PodamFactory factory = new PodamFactoryImpl();%0A%09%09Pdm3PojoConstructor pojo = factory.manufacturePojo(Pdm3PojoConstructor.class, String.class);%0A%09%09assertNotNull(pojo);%0A%09%09assertNotNull(pojo.getName());%0A%09%7D%0A%0A
 %09@Te

Revert "Test generic class"