Search in sources :

Example 71 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class CollectionsTest method podamShouldFillInPojosWithAttributesContainingWildcards.

@Test
@Title("Podam should fill in POJOs with attributes containing wildcards")
public void podamShouldFillInPojosWithAttributesContainingWildcards() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    ReadOnlyWildcardFieldsPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(ReadOnlyWildcardFieldsPojo.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(pojo, ReadOnlyWildcardFieldsPojo.class);
    podamValidationSteps.theCollectionShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getList(), Object.class);
    podamValidationSteps.theMapShouldNotBeNullOrEmptyAndContainElementsOfType(pojo.getMap(), Object.class, Object.class);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 72 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class ConstructorsUnitTest method podamShouldBeAbleToManufactureInstancesOfTheObservableClass.

@Test
@Title("Podam should be able to manufacture instances of the Observable class")
public void podamShouldBeAbleToManufactureInstancesOfTheObservableClass() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    Observable observable = podamInvocationSteps.whenIInvokeTheFactoryForClass(Observable.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(observable, Observable.class);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Observable(java.util.Observable) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 73 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class ConstructorsUnitTest method podamShouldInstantiateAbstractClassesForWhichItKnowsConcreteTypes.

@Test
@Title("Podam should be able to create instances of abstract POJOs with factory methods which return concrete types")
public void podamShouldInstantiateAbstractClassesForWhichItKnowsConcreteTypes() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    TimeZone pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(TimeZone.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(pojo, TimeZone.class);
}
Also used : TimeZone(java.util.TimeZone) PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 74 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class ConstructorsUnitTest method podamShouldCreateInstancesOfInnerClasses.

@Test
@Title("Podam should be able to create instances of inner classes")
public void podamShouldCreateInstancesOfInnerClasses() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    InnerClassPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(InnerClassPojo.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(pojo, InnerClassPojo.class);
    podamValidationSteps.thePojoMustBeOfTheType(pojo.getIp(), InnerPojo.class);
}
Also used : PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Example 75 with PodamFactory

use of uk.co.jemos.podam.api.PodamFactory in project podam by devopsfolks.

the class ReadOnlyComplexTypesTest method podamShouldCreateAnInstanceOfAnAbstractClassWithAFactoryMethodWhichReturnsAConcreteType.

@Test
@Title("Podam should create an instance of an Abstract class with a factory method which returns a concrete type" + " even if the concrete type has got read-only attributes. These will be empty.")
public void podamShouldCreateAnInstanceOfAnAbstractClassWithAFactoryMethodWhichReturnsAConcreteType() throws Exception {
    PodamFactory podamFactory = podamFactorySteps.givenAStandardPodamFactory();
    ReadOnlyAbstract pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(ReadOnlyAbstract.class, podamFactory);
    podamValidationSteps.thePojoMustBeOfTheType(pojo, ReadOnlyAbstract.class);
}
Also used : ReadOnlyAbstract(uk.co.jemos.podam.test.dto.ReadOnlyAbstract) PodamFactory(uk.co.jemos.podam.api.PodamFactory) Test(org.junit.Test) Title(net.thucydides.core.annotations.Title)

Aggregations

PodamFactory (uk.co.jemos.podam.api.PodamFactory)130 Test (org.junit.Test)127 Title (net.thucydides.core.annotations.Title)126 Validator (javax.validation.Validator)4 DataProviderStrategy (uk.co.jemos.podam.api.DataProviderStrategy)3 Calendar (java.util.Calendar)2 GregorianCalendar (java.util.GregorianCalendar)2 AbstractRandomDataProviderStrategy (uk.co.jemos.podam.api.AbstractRandomDataProviderStrategy)2 PodamFactoryImpl (uk.co.jemos.podam.api.PodamFactoryImpl)2 PojoWithMapsAndCollections (uk.co.jemos.podam.test.dto.PojoWithMapsAndCollections)2 SimplePojoToTestSetters (uk.co.jemos.podam.test.dto.SimplePojoToTestSetters)2 GenericCollectionsConstructorPojo (uk.co.jemos.podam.test.dto.issue123.GenericCollectionsConstructorPojo)2 BeanContextServicesSupport (java.beans.beancontext.BeanContextServicesSupport)1 InputStream (java.io.InputStream)1 BigDecimal (java.math.BigDecimal)1 URL (java.net.URL)1 Timestamp (java.sql.Timestamp)1 Currency (java.util.Currency)1 Date (java.util.Date)1 Observable (java.util.Observable)1