test_class.declarator: exporter
test_class.modifier: private
test_class.original_string: private Exporter   exporter;
test_class.type: Exporter
test_class.var_name: exporter
test_class.declarator: blob
test_class.modifier: private
test_class.original_string: private Blob       blob;
test_class.type: Blob
test_class.var_name: blob
test_class.declarator: sb
test_class.modifier: private
test_class.original_string: private ServerBlob sb;
test_class.type: ServerBlob
test_class.var_name: sb
test_class.declarator: cb
test_class.modifier: private
test_class.original_string: private ClientBlob cb;
test_class.type: ClientBlob
test_class.var_name: cb
test_class.file: akubra-rmi/src/test/java/org/akubraproject/rmi/client/ClientBlobTest.java
test_class.identifier: ClientBlobTest
test_case.body: @Test
    public void testOpenInputStream() throws IOException {
      URI         id = URI.create("foo:bar");
      InputStream in = createMock(InputStream.class);
      makeThreadSafe(in, true);
  
      reset(blob);
      makeThreadSafe(blob, true);
      expect(blob.openInputStream()).andReturn(in);
      expect(blob.openInputStream()).andThrow(new MissingBlobException(id));
  
      expect(in.read()).andReturn(42);
      in.close();
      expectLastCall().atLeastOnce();
      replay(blob);
      replay(in);
  
      InputStream ci = cb.openInputStream();
      assertNotNull(ci);
      assertEquals(42, ci.read());
      ci.close();
  
      try {
        cb.openInputStream();
        fail("Failed to rcv expected exception");
      } catch (MissingBlobException e) {
        assertEquals(id, e.getBlobId());
      }
  
      verify(blob);
      verify(in);
    }
test_case.class_method_signature: ClientBlobTest.testOpenInputStream()
test_case.full_signature: @Test public void testOpenInputStream()
test_case.identifier: testOpenInputStream
test_case.invocations: create createMock makeThreadSafe reset makeThreadSafe andReturn expect openInputStream andThrow expect openInputStream andReturn expect read close atLeastOnce expectLastCall replay replay openInputStream assertNotNull assertEquals read close openInputStream fail assertEquals getBlobId verify verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOpenInputStream()
focal_class.declarator: remote
focal_class.modifier: private final
focal_class.original_string: private final RemoteBlob          remote;
focal_class.type: RemoteBlob
focal_class.var_name: remote
focal_class.declarator: streamMgr
focal_class.modifier: private final
focal_class.original_string: private final StreamManager       streamMgr;
focal_class.type: StreamManager
focal_class.var_name: streamMgr
focal_class.file: akubra-rmi/src/main/java/org/akubraproject/rmi/client/ClientBlob.java
focal_class.identifier: ClientBlob
focal_class.class_method_signature: ClientBlob.ClientBlob(BlobStoreConnection con, StreamManager streamMgr,
                      RemoteBlob remote)
focal_class.full_signature: public  ClientBlob(BlobStoreConnection con, StreamManager streamMgr,
                      RemoteBlob remote)
focal_class.identifier: ClientBlob
focal_class.modifiers: public
focal_class.parameters: (BlobStoreConnection con, StreamManager streamMgr,
                      RemoteBlob remote)
focal_class.signature:  ClientBlob(BlobStoreConnection con, StreamManager streamMgr,
                      RemoteBlob remote)
focal_class.class_method_signature: ClientBlob.getCanonicalId()
focal_class.full_signature: @Override public URI getCanonicalId()
focal_class.identifier: getCanonicalId
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URI
focal_class.signature: URI getCanonicalId()
focal_class.class_method_signature: ClientBlob.openInputStream()
focal_class.full_signature: @Override public InputStream openInputStream()
focal_class.identifier: openInputStream
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: InputStream
focal_class.signature: InputStream openInputStream()
focal_class.class_method_signature: ClientBlob.openOutputStream(long estSize, boolean overwrite)
focal_class.full_signature: @Override public OutputStream openOutputStream(long estSize, boolean overwrite)
focal_class.identifier: openOutputStream
focal_class.modifiers: @Override public
focal_class.parameters: (long estSize, boolean overwrite)
focal_class.return: OutputStream
focal_class.signature: OutputStream openOutputStream(long estSize, boolean overwrite)
focal_class.class_method_signature: ClientBlob.getSize()
focal_class.full_signature: @Override public long getSize()
focal_class.identifier: getSize
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getSize()
focal_class.class_method_signature: ClientBlob.exists()
focal_class.full_signature: @Override public boolean exists()
focal_class.identifier: exists
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean exists()
focal_class.class_method_signature: ClientBlob.delete()
focal_class.full_signature: @Override public void delete()
focal_class.identifier: delete
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void delete()
focal_class.class_method_signature: ClientBlob.moveTo(URI blobId, Map<String, String> hints)
focal_class.full_signature: @Override public Blob moveTo(URI blobId, Map<String, String> hints)
focal_class.identifier: moveTo
focal_class.modifiers: @Override public
focal_class.parameters: (URI blobId, Map<String, String> hints)
focal_class.return: Blob
focal_class.signature: Blob moveTo(URI blobId, Map<String, String> hints)
focal_class.superclass: extends AbstractBlob
focal_method.body: @Override
    public InputStream openInputStream() throws IOException {
      ensureOpen();
  
      return streamMgr.manageInputStream(getConnection(),
                                         new ClientInputStream(remote.openInputStream()));
    }
focal_method.class_method_signature: ClientBlob.openInputStream()
focal_method.full_signature: @Override public InputStream openInputStream()
focal_method.identifier: openInputStream
focal_method.invocations: ensureOpen manageInputStream getConnection openInputStream
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: InputStream
focal_method.signature: InputStream openInputStream()