@Test
public void testGenerateNoContext() throws Exception {

  MicroPlatform microPlatform = MicroPlatformFactory.create();
  try {
    microPlatform.start();
    ClassicEngineBoot.getInstance().start();
    PentahoSystem.setApplicationContext( null );
    assertEquals( -1, emailOutput.generate( new MasterReport(), 1, new ByteArrayOutputStream(), 1 ) );
  } finally {
    microPlatform.stop();
    microPlatform = null;
  }
}