@Test public void openInputStream() throws Exception { final MyConnectionFactory factory = create( new String[] { Protocols.HTTP.protocol() }, 1 ); final StreamConnection conn = mock( StreamConnection.class ); final InputStream in = new InputStream() { @Override public int available() throws IOException { return 1001; } @Override public int read() throws IOException { return 1; } }; when( conn.openInputStream() ).thenReturn( in ); registerConnectionFactory( factory ); factory.setConnection( conn ); final InputStream din = this.connectorService.openInputStream( Protocols.HTTP.url() ); assertEquals( din.read(), 1 ); assertEquals( din.available(), 1001 ); assertEquals( in, din ); }
@Override public InputStream openInputStream( final String aName ) throws IOException { return openStreamConnection( aName ).openInputStream(); }
ConnectorServiceImpl implements ConnectorService { @Override public InputStream openInputStream( final String aName ) throws IOException { return openStreamConnection( aName ).openInputStream(); } }
ConnectorServiceImpl implements ConnectorService { @Override public InputStream openInputStream( final String aName ) throws IOException { return openStreamConnection( aName ).openInputStream(); } ConnectorServiceImpl( final BundleContext aContext ); }
ConnectorServiceImpl implements ConnectorService { @Override public InputStream openInputStream( final String aName ) throws IOException { return openStreamConnection( aName ).openInputStream(); } ConnectorServiceImpl( final BundleContext aContext ); @Override Connection open( final String aName ); @Override Connection open( final String aName, final int aMode ); @Override Connection open( final String aName, final int aMode, final boolean aTimeouts ); @Override DataInputStream openDataInputStream( final String aName ); @Override DataOutputStream openDataOutputStream( final String aName ); @Override InputStream openInputStream( final String aName ); @Override OutputStream openOutputStream( final String aName ); void shutdown(); }
ConnectorServiceImpl implements ConnectorService { @Override public InputStream openInputStream( final String aName ) throws IOException { return openStreamConnection( aName ).openInputStream(); } ConnectorServiceImpl( final BundleContext aContext ); @Override Connection open( final String aName ); @Override Connection open( final String aName, final int aMode ); @Override Connection open( final String aName, final int aMode, final boolean aTimeouts ); @Override DataInputStream openDataInputStream( final String aName ); @Override DataOutputStream openDataOutputStream( final String aName ); @Override InputStream openInputStream( final String aName ); @Override OutputStream openOutputStream( final String aName ); void shutdown();  }