YangLibraryMojo extends AbstractBaaMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { updateClasspath(m_project); String yangLibFile; if (m_enableForTesting && m_yangLibTestFile != null) { yangLibFile = m_yangLibTestFile; } else { String yangLibraryFile = AdapterSpecificConstants.YANG_LIB_FILE; ClassLoader cl = Thread.currentThread().getContextClassLoader(); yangLibFile = cl.getResource(yangLibraryFile).getFile(); if (System.getProperty("os.name").startsWith("Windows")) { yangLibFile = yangLibFile.substring(1); } } File modelDir = new File(m_outputDir); modelDir.mkdirs(); try { VariantFileUtils.copyYangLibFiles(yangLibFile, m_outputDir); } catch (Exception e) { throw new MojoExecutionException(e.getMessage(), e); } }  void setOutputDir(String outputDir); void setEnableForTesting(boolean value); String getYangLibFilePath(); void setYangLibFilePath(String yangLib); @Override void execute();  }
@Test public void testExecute() throws Exception { YangLibraryMojo mojo = setupMojo(); mojo.execute(); checkDeviationAndFeatureFiles(); }