コード例 #1
0
  public void testUnbindingIsIsolated() {
    if (!isMultiSession()) {
      return;
    }

    final MockActivatable mock1 = storeNewMock();
    db().commit();

    final MockActivatable mock2 = retrieveMockFromNewClientAndClose();
    assertBindUnbindCalls(mock2);

    // mock1 has only be bound by store so far
    // client.close should have no effect on it
    mock1
        .recorder()
        .verify(
            new MethodCall(
                "bind",
                new MethodCall.ArgumentCondition() {
                  public void verify(Object argument) {
                    Assert.isNotNull(argument);
                  }
                }));
  }
コード例 #2
0
 private void assertSingleBindCall(final MockActivatable mock) {
   mock.recorder().verify(new MethodCall("bind", MethodCall.IGNORED_ARGUMENT));
 }
コード例 #3
0
 private void assertBindUnbindCalls(final MockActivatable mock) {
   mock.recorder()
       .verify(
           new MethodCall("bind", MethodCall.IGNORED_ARGUMENT),
           new MethodCall("bind", new Object[] {null}));
 }