Package samples.suppressfield

Examples of samples.suppressfield.SuppressField


    @Test
    public void suppressSingleFieldExample() throws Exception {
        suppress(field(SuppressField.class, "domainObject"));

        SuppressField tested = new SuppressField();
        assertNull(tested.getDomainObject());
    }
View Full Code Here


  @Ignore("Final primitive types doesn't work, see issue at http://code.google.com/p/powermock/issues/detail?id=85")
  @Test
  public void assertThatSpecificInstanceFinalPrimitiveFieldSuppressionWorks() throws Exception {
    suppress(field(SuppressField.class, "myBoolean"));
    SuppressField suppressField = new SuppressField();
    assertEquals(false, suppressField.isMyBoolean());
  }
View Full Code Here

  }

  @Test
  public void assertThatSpecificInstanceFinalFieldSuppressionWorks() throws Exception {
    suppress(field(SuppressField.class, "myWrappedBoolean"));
    SuppressField suppressField = new SuppressField();
    assertNull(suppressField.getMyWrappedBoolean());
  }
View Full Code Here

  }

  @Test
  public void assertThatSpecificPrimitiveInstanceFieldSuppressionWorks() throws Exception {
    suppress(field(SuppressField.class, "myChar"));
    SuppressField suppressField = new SuppressField();
    assertEquals(' ', suppressField.getMyChar());
  }
View Full Code Here

  }

  @Test
  public void assertThatSpecificInstanceFieldSuppressionWorks() throws Exception {
    suppress(field(SuppressField.class, "mySecondValue"));
    SuppressField suppressField = new SuppressField();
    assertNull(suppressField.getMySecondValue());
  }
View Full Code Here

  }

  @Test
  public void assertThatSpecificInstanceFieldSuppressionWhenSpecifingClassAndFieldNameWorks() throws Exception {
    suppress(field(SuppressField.class, "mySecondValue"));
    SuppressField suppressField = new SuppressField();
    assertNull(suppressField.getMySecondValue());
  }
View Full Code Here

  }

  @Test
  public void assertThatMultipleInstanceFieldSuppressionWorks() throws Exception {
    suppress(fields(SuppressField.class, "mySecondValue", "myChar"));
    SuppressField suppressField = new SuppressField();
    assertNull(suppressField.getMySecondValue());
    assertEquals(' ', suppressField.getMyChar());
    assertEquals(Boolean.TRUE, suppressField.getMyWrappedBoolean());
  }
View Full Code Here

  // TODO Add final tests here as well when they work
  @Test
  public void assertThatAllFieldSuppressionWorks() throws Exception {
    suppress(fields(SuppressField.class));
    SuppressField suppressField = new SuppressField();
    assertNull(suppressField.getMySecondValue());
    assertEquals(' ', suppressField.getMyChar());
    assertNull(suppressField.getMyWrappedBoolean());
    assertNull(SuppressField.getMyObject());
  }
View Full Code Here

  }

  @Test
  public void assertThatObjectIsNeverInstansiated() throws Exception {
    suppress(field(SuppressField.class, "domainObject"));
    SuppressField suppressField = new SuppressField();
    assertNull(suppressField.getDomainObject());
  }
View Full Code Here

    @Test
    public void suppressSingleFieldExample() throws Exception {
        suppress(field(SuppressField.class, "domainObject"));

        SuppressField tested = new SuppressField();
        assertNull(tested.getDomainObject());
    }
View Full Code Here

TOP

Related Classes of samples.suppressfield.SuppressField

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.