コード例 #1
0
  public void testSwingExample1B() {
    TestParseHandler handler = TestUtil.parseClassHelper(TestSwingExample1B.class);
    ArrayList<ICheckThreadError> list = handler.getThreadPolicyErrors();

    // Verify that there is one thread policy error
    int actualValue = list.size();
    int expectedValue = 2;
    assertEquals(expectedValue, actualValue);
  }
コード例 #2
0
  public void testSwingAPI() {
    TestParseHandler handler = TestUtil.parseClassHelper(TestSwingAPI.class);
    ArrayList<ICheckThreadError> list = handler.getThreadPolicyErrors();

    // Verify
    int actualValue = list.size();
    int expectedValue = 2;
    assertEquals(expectedValue, actualValue);
  }
コード例 #3
0
  public void testBasicSwing() {

    TestParseHandler handler = TestUtil.parseClassHelper(TestBasicSwing.class);
    ArrayList<ICheckThreadError> list = handler.getThreadPolicyErrors();

    // Verify
    int actualValue = list.size();
    int expectedValue = 1;
    assertEquals(expectedValue, actualValue);

    // Verify that the failure occurred in a method called "mymethod"
    ICheckThreadError errorBean = list.get(0);
    String methodName = errorBean.getParentName();
    assertEquals("mymethod", methodName);
  }