for ( PathTrackingEntry entry : entries )
{
System.out.println( "entry:" + entry );
}
PathTrackingEntry entry = entries.get( 0 );
Assert.assertEquals( "beer", entry.getMethodName() );
Assert.assertEquals( "org.apache.test.sirona.javaagent.App", entry.getClassName() );
Assert.assertEquals( 1, entry.getLevel() );
entry = entries.get( 1 );
Assert.assertEquals( "foo", entry.getMethodName() );
Assert.assertEquals( "org.apache.test.sirona.javaagent.App", entry.getClassName() );
Assert.assertEquals( 2, entry.getLevel() );
// there is Thread.sleep( 500 ) so we can be sure a minimum for that
Assert.assertTrue( entry.getExecutionTime() >= 500 * 1000000 );
entry = entries.get( 2 );
Assert.assertEquals( "pub", entry.getMethodName() );
Assert.assertEquals( "org.apache.test.sirona.javaagent.App", entry.getClassName() );
Assert.assertEquals( 3, entry.getLevel() );
Assert.assertTrue( entry.getExecutionTime() >= 100 * 1000000 );
entry = entries.get( 3 );
Assert.assertEquals( "bar", entry.getMethodName() );
Assert.assertEquals( "org.apache.test.sirona.javaagent.App", entry.getClassName() );
Assert.assertEquals( 4, entry.getLevel() );
Assert.assertTrue( entry.getExecutionTime() >= 300 * 1000000 );
// we have only one here
PathTrackingInvocationListener listener = PathTracker.getPathTrackingInvocationListeners()[0];
MockPathTrackingInvocationListener mock = MockPathTrackingInvocationListener.class.cast( listener );