### Question:
DumpMojo extends AbstractLDAPMojo { public final void execute() throws MojoExecutionException { final File outputFile = new File(outputDirectory, filename); if (outputDirectory.exists() || outputDirectory.mkdirs()) { try { final OutputStream outputStream = new FileOutputStream(outputFile); try { final LDAPConnection connection = connect(); try { final FormatHandler handler = getFormatHandler(); if (handler != null) { handler.dump(connection, searchBase, searchFilter, outputStream, this); } } finally { connection.close(); } } finally { try { outputStream.close(); } catch (final IOException e) { } } } catch (final FileNotFoundException e) { } } }  final void execute();  }### Answer:
@Test public void dumpDSML() throws Exception { setVariableValueInObject(mojo, "filename", "dump.dsml"); setVariableValueInObject(mojo, "format", "dsml"); mojo.execute(); assertTrue(new File(outputDirectory.getRoot(), "dump.dsml").exists()); }
@Test public void dumpLDIF() throws Exception { setVariableValueInObject(mojo, "filename", "dump.ldif"); setVariableValueInObject(mojo, "format", "ldif"); mojo.execute(); assertTrue(new File(outputDirectory.getRoot(), "dump.ldif").exists()); }