Package uk.co.jemos.podam.test.dto.annotations

Examples of uk.co.jemos.podam.test.dto.annotations.IntegerValuePojo


  }

  @Test
  public void testIntegerValueAnnotation() {

    IntegerValuePojo pojo = factory.manufacturePojo(IntegerValuePojo.class);
    Assert.assertNotNull("The pojo cannot be null!", pojo);
    int intFieldWithMinValueOnly = pojo.getIntFieldWithMinValueOnly();
    Assert.assertTrue("The int field with only minValue should be >= 0",
        intFieldWithMinValueOnly >= 0);
    int intFieldWithMaxValueOnly = pojo.getIntFieldWithMaxValueOnly();
    Assert.assertTrue(
        "The int field with maximum value only should have a maximum value of 100",
        intFieldWithMaxValueOnly <= 100);
    int intObjectFieldWithMinAndMaxValue = pojo
        .getIntFieldWithMinAndMaxValue();
    Assert.assertTrue(
        "The int field with both min and max value should have a value comprised between",
        intObjectFieldWithMinAndMaxValue >= 0
        && intObjectFieldWithMinAndMaxValue <= 1000);
    Integer integerObjectFieldWithMinValueOnly = pojo
        .getIntegerObjectFieldWithMinValueOnly();
    Assert.assertNotNull(
        "The integer field with minimum value only should not be null!",
        integerObjectFieldWithMinValueOnly);
    Assert.assertTrue(
        "The integer field with minimum value only should have a minimum value greater or equal to zero!",
        integerObjectFieldWithMinValueOnly.intValue() >= 0);
    Integer integerObjectFieldWithMaxValueOnly = pojo
        .getIntegerObjectFieldWithMaxValueOnly();
    Assert.assertNotNull(
        "The integer field with maximum value only should not be null!",
        integerObjectFieldWithMaxValueOnly);
    Assert.assertTrue(
        "The integer field with maximum value only should have a maximum value of 100",
        integerObjectFieldWithMaxValueOnly.intValue() <= 100);
    Integer integerObjectFieldWithMinAndMaxValue = pojo
        .getIntegerObjectFieldWithMinAndMaxValue();
    Assert.assertNotNull(
        "The integer field with minimum and maximum value should not be null!",
        integerObjectFieldWithMinAndMaxValue);
    Assert.assertTrue(
        "The integer field with minimum and maximum value should have value comprised between 0 and 1000",
        integerObjectFieldWithMinAndMaxValue.intValue() >= 0
        && integerObjectFieldWithMinAndMaxValue.intValue() <= 1000);

    int intFieldWithPreciseValue = pojo.getIntFieldWithPreciseValue();
    Assert.assertTrue(
        "The integer field with precise value must have a value of: "
            + PodamTestConstants.INTEGER_PRECISE_VALUE,
            intFieldWithPreciseValue == Integer
            .valueOf(PodamTestConstants.INTEGER_PRECISE_VALUE));

    Integer integerObjectFieldWithPreciseValue = pojo
        .getIntegerObjectFieldWithPreciseValue();
    Assert.assertNotNull(
        "The integer object field with precise value cannot be null!",
        integerObjectFieldWithPreciseValue);
    Assert.assertTrue(
View Full Code Here

TOP

Related Classes of uk.co.jemos.podam.test.dto.annotations.IntegerValuePojo

Copyright © 2018 www.massapicom. 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.