> +import com.google.common.base.Charsets; > +import com.google.common.io.ByteStreams; > + > +@Test > +public class BasePayloadSlicerTest { > + > + @Test > + public void testIterableSliceExpectedSingle() throws IOException { > + PayloadSlicer slicer = new BasePayloadSlicer(); > + String data = "aaaaaaaaaabbbbbbbbbbccccc"; > + Payload payload = new InputStreamPayload(new > ByteArrayInputStream(data.getBytes(Charsets.US_ASCII))); > + > + Iterator<Payload> iter = slicer.slice(payload, 25).iterator(); > + > + assertTrue(iter.hasNext(), "Not enough results"); > + assertEquals(new String(ByteStreams.toByteArray(iter.next())), data);
> This is right, isn't it? The first argument (actual), is the result as > provided by the iterator, the second (expected), > is the test string we used as input. Doh, yes indeed. Thanks for pointing that out. Yes, the first arg is indeed "actual"...sloppy reading by me... --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/192/files#r8182230