jclouds-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds] JCLOUDS-127 (#32)
Date Mon, 17 Jun 2013 13:35:20 GMT
>     }
>  
> +   @Test
> +   void testCloserCallOneClose() throws IOException, InterruptedException {
> +      Injector i = createInjector();
> +      final Closer closer = i.getInstance(Closer.class);
> +      assert closer.getState() == Closer.State.OPEN;
> +
> +      Closeable closeable = EasyMock.createMock(Closeable.class);
> +
> +      closeable.close();
> +
> +      EasyMock.expectLastCall().times(1);
> +
> +      EasyMock.replay(closeable);

With some static imports, this could boil down to:
```
Closeable closeable = createStrictMock(Closeable.class);
closeable.close();
expectLastCall(); // don't need times(1), see "If no call count is specified, one call is
expected." in http://www.easymock.org/EasyMock3_0_Documentation.html
replay(closeable);
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/32/files#r4723865

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message