### Question:
LoadMojo extends AbstractLDAPMojo { public void execute() throws MojoExecutionException { if (!isSkip()){ final LDAPConnection connection = connect(); try { for (final Source source : sources) { try { getLog().info("Processing input source: " + source); final FormatHandler handler = getFormatHandler(source); if (handler == null) { getLog().warn("No handler for input source: " + source); } else { final InputStream inputStream = source.open(); if (inputStream == null) { if (!this.continueOnError) { throw new MojoExecutionException("Cannot open source for reading: " + source); } else { getLog().warn("Skipping source that could not be opened for reading: " + source); } } else { try { handler.load(connection, source.open(), continueOnError, this); } finally { inputStream.close(); } } } } catch (final IOException e) { if (!this.continueOnError) { throw new MojoExecutionException("Error closing input source: " + source, e); } else { this.getLog().warn("Ignoring error closing input source: " + source, e); } } } } finally { connection.close(); } } }  void execute();  }### Answer:
@Test public void testDeleteLDIF() throws Exception { setVariableValueInObject(mojo, "sources", new Source[]{new Ldif("classpath:com/btmatthews/maven/plugins/ldap/mojo/delete.ldif")}); setVariableValueInObject(mojo, "continueOnError", Boolean.FALSE); mojo.execute(); }
@Test public void loadDSMLWithNamespace() throws Exception { setVariableValueInObject(mojo, "sources", new Source[]{new Dsml("classpath:com/btmatthews/maven/plugins/ldap/mojo/add.dsml")}); setVariableValueInObject(mojo, "continueOnError", Boolean.FALSE); mojo.execute(); }
@Test public void loadDSMLWithoutNamespace() throws Exception { setVariableValueInObject(mojo, "sources", new Source[]{new Dsml("classpath:com/btmatthews/maven/plugins/ldap/mojo/add1.dsml")}); setVariableValueInObject(mojo, "continueOnError", Boolean.FALSE); mojo.execute(); }
@Test public void testAddLDIF() throws Exception { setVariableValueInObject(mojo, "sources", new Source[]{new Ldif("classpath:com/btmatthews/maven/plugins/ldap/mojo/add.ldif")}); setVariableValueInObject(mojo, "continueOnError", Boolean.FALSE); mojo.execute(); }
@Test public void testModifyLDIF() throws Exception { setVariableValueInObject(mojo, "sources", new Source[]{new Ldif("classpath:com/btmatthews/maven/plugins/ldap/mojo/modify.ldif")}); setVariableValueInObject(mojo, "continueOnError", Boolean.FALSE); mojo.execute(); }