@Test
    public void testArchiver() throws Exception
    {
        // Setup fixture.
        final int maxWorkQueueSize = 100;
        final Duration maxPurgeInterval = Duration.ofMillis( 5000 );
        final Duration gracePeriod = Duration.ofMillis( 50 );
        final DummyArchiver archiver = new DummyArchiver( "test", maxWorkQueueSize, maxPurgeInterval, gracePeriod );
        final Thread thread = new Thread( archiver );

        try
        {
            // Execute system under test.
            thread.start();
            archiver.archive( 1 );

            // Verify result.
            waitUntilArchivingIsDone( archiver, 1 );

            assertFalse( archiver.store.isEmpty() );
            final Duration timeUntilLogged = Duration.between( archiver.getStarted(), archiver.store.get( 1 ) );
            assertTrue( timeUntilLogged.compareTo( gracePeriod ) >= 0 );
            assertTrue( timeUntilLogged.compareTo( maxPurgeInterval ) < 0 ); // this needs not be entirely true (due to garbage collection, etc), but is a fair assumption.
        }
        finally
        {
            // Teardown fixture.
            archiver.stop();
        }
    }
Verifies that data that is being archived ends up in the archive.

This test verifies that the data is written to the storage.
xmppserver/src/test/java/org/jivesoftware/openfire/archive/ArchiverTest.java