File sDir = new File(m_engine.getWikiProperties().getProperty( BasicAttachmentProvider.PROP_STORAGEDIR ));
File extrafile = makeExtraFile( sDir, "foobar.blob" );
try
{
Attachment att = new Attachment( m_engine, NAME1, "test1.txt" );
m_provider.putAttachmentData( att, new FileInputStream(in) );
Thread.sleep( 2000L ); // So that we get a bit of granularity.
Attachment att2 = new Attachment( m_engine, NAME2, "test2.txt" );
m_provider.putAttachmentData( att2, new FileInputStream(in) );
List res = m_provider.listAllChanged( new Date(0L) );
assertEquals( "list size", 2, res.size() );
Attachment a2 = (Attachment) res.get(0); // Most recently changed
Attachment a1 = (Attachment) res.get(1); // Least recently changed
assertEquals( "a1 name", att.getName(), a1.getName() );
assertEquals( "a2 name", att2.getName(), a2.getName() );
}
finally
{
extrafile.delete();