}
{
TracingPullBufferDataSource ds = new TracingPullBufferDataSource();
TracingPullBufferStream s = new TracingPullBufferStream();
ds.streams = new PullBufferStream[1];
ds.streams[0] = s;
try
{
p.setSource(ds);
} catch (IncompatibleSourceException e)
{
assertTrue(false);
} catch (IOException e)
{
e.printStackTrace();
assertTrue(false);
}
assertEquals(ds.getStringBuffer().toString(), "getStreams\n");
assertEquals(s.getStringBuffer().toString(), "");
assertEquals(p.getTracks(), null);
assertEquals(ds.getStringBuffer().toString(), "getStreams\n");
assertEquals(s.getStringBuffer().toString(), "");
try
{
p.open();
}
catch (Exception e)
{ e.printStackTrace();
assertTrue(false);
}
assertEquals(ds.getStringBuffer().toString(), "getStreams\n");
assertEquals(s.getStringBuffer().toString(), "getFormat\n");
assertTrue(p.getTracks() != null);
try
{
p.start();
}
catch (Exception e)
{ e.printStackTrace();
assertTrue(false);
}
assertEquals(ds.getStringBuffer().toString(), "getStreams\nstart\n");
assertEquals(s.getStringBuffer().toString(), "getFormat\n");
}
}