Examples of PodamFactory


Examples of uk.co.jemos.podam.api.PodamFactory

  @Test
  public void testRandomDataProviderStrategy() {

    strategy = RandomDataProviderStrategy.getInstance();
    PodamFactory factory = new PodamFactoryImpl(strategy);
    PojoWithMapsAndCollections pojo =
        factory.manufacturePojo(PojoWithMapsAndCollections.class);

    Assert.assertNotNull("POJO manufacturing failed", pojo);
    Assert.assertNotNull("Array is null", pojo.getArray());
    Assert.assertEquals(
        strategy.getNumberOfCollectionElements(Object.class),
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

  @Test
  public void testCustomRandomDataProviderStrategy() {

    strategy = new CustomRandomDataProviderStrategy();
    PodamFactory factory = new PodamFactoryImpl(strategy);
    PojoWithMapsAndCollections pojo =
        factory.manufacturePojo(PojoWithMapsAndCollections.class);

    Assert.assertNotNull("POJO manufacturing failed", pojo);
    Assert.assertNotNull("Array is null", pojo.getArray());
    Assert.assertEquals(2, pojo.getArray().length);
    Assert.assertNotNull("List is null", pojo.getList());
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

  @Test
  public void testRandomProviderStrategyForLong() {

    strategy = new CustomRandomDataProviderStrategy();
    PodamFactory factory = new PodamFactoryImpl(strategy);
    Map<Long,String> pojo =
        factory.manufacturePojo(HashMap.class, Long.class, String.class);

    Assert.assertNotNull("POJO manufacturing failed", pojo);
    Assert.assertEquals("Wrong map size",
        strategy.getNumberOfCollectionElements(String.class),
        pojo.size());
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

*/
public class PackagePrivatePojoTest {

  @Test
  public void testPackagePrivateClassInstantiation() {
    PodamFactory factory = new PodamFactoryImpl();
    PackagePrivatePojo pojo = factory
        .manufacturePojo(PackagePrivatePojo.class);
    Assert.assertNotNull(pojo);
    Assert.assertNotNull(pojo.getValue());

  }
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

public class FloatExtUnitTest {

  @Test
  public void testFloatPojo() {

    PodamFactory podam = new PodamFactoryImpl();

    FloatExt<Float> pojo = podam.manufacturePojo(FloatExt.class,
        Float.class);

    Assert.assertNotNull(pojo);

  }
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

  }

  @Test
  public void testFloat2Pojo() {

    PodamFactory podam = new PodamFactoryImpl();

    FloatExt2 pojo = podam.manufacturePojo(FloatExt2.class);

    Assert.assertNotNull(pojo);

  }
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

public class Pdm4PojoUnitTest {

  @Test
  public void testPdm4Pojo() {

    PodamFactory factory = new PodamFactoryImpl();
    Pdm4PojoWithSetters pojo = factory.manufacturePojo(Pdm4PojoWithSetters.class);
    assertNotNull(pojo);
    assertEquals("Invocation order has changed", 4, pojo.invocationOrder.size());
    assertEquals("Invocation order has changed", "PodamConstructor", pojo.invocationOrder.get(0));
    assertEquals("Invocation order has changed", "no-op", pojo.invocationOrder.get(1));
    assertEquals("Invocation order has changed", "InputStream", pojo.invocationOrder.get(2));
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

    }
  }

  @Test
  public void testConstructionFailure(){
    PodamFactory factory = new PodamFactoryImpl();
    NonInstantiatableClass innerClassPojo =
        factory.manufacturePojo(NonInstantiatableClass.class);
    Assert.assertNull(innerClassPojo);
  }
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

public class AttributeMetaDataTest {

  @Test
  public void testAttributeMetaData() {

    PodamFactory factory = new PodamFactoryImpl(new AbstractRandomDataProviderStrategy() {
      @Override
      public String getStringValue(AttributeMetadata attributeMetadata) {

        if (attributeMetadata.getPojoClass() == PojoSpecific.class) {
          return "specific";
        } else {
          return "classic";
        }
      }
    });

    Assert.assertEquals(factory.manufacturePojo(PojoClassic.class).getAtt(), "classic");
    Assert.assertEquals(factory.manufacturePojo(PojoSpecific.class).getAtt(), "specific");


  }
View Full Code Here

Examples of uk.co.jemos.podam.api.PodamFactory

public class Pdm43UnitTest {

  @Test
  public void validateDtoInstantiation() {

    PodamFactory podamFactory = new PodamFactoryImpl();
    ConcreteBusinessObject pojo = podamFactory
        .manufacturePojo(ConcreteBusinessObject.class);
    Assert.assertNotNull("The created POJO cannot be null!", pojo);

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.