コード例 #1
0
  public void runTests() throws Throwable {
    init();

    declare("Test connection before Suspend");

    assertTrue("positive write", client.canWrite());
    assertTrue("positive read", server.canRead());

    declare("Test connection after Suspend");
    TestUtil.suspendMidp();
    TestUtil.sleep();

    assertTrue("negative write", !client.canWrite());
    assertTrue("negative read", !server.canRead());

    declare("Test connection after Resume");
    TestUtil.resumeMidp();
    TestUtil.sleep();

    assertTrue("negative write2", !client.canWrite());
    assertTrue("negative read2", !server.canRead());

    client.closeAll();
    server.closeAll();
  }
コード例 #2
0
 void closeAll() {
   try {
     notif.close();
   } catch (IOException e) {
     e.printStackTrace();
   }
   super.closeAll();
 }