Skip to content

Commit

Permalink
mojohaus#42: add yajsw shell script (minimal set)
Browse files Browse the repository at this point in the history
  • Loading branch information
sparsick committed Oct 31, 2019
1 parent 0c087a2 commit 9de18ac
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ public class YetAnotherJavaServiceWrapperDaemonGenerator
}
};

private static List<String> SHELL_SCRIPTS = new ArrayList<String>()
{
{
add("installDaemon.sh");
add("runConsole.sh");
add("startDaemon.sh");
add("stopDaemon.sh");
add("uninstallDaemon.sh");
}
};


@Override
public void generate( DaemonGenerationRequest request ) throws DaemonGeneratorException
Expand All @@ -106,6 +117,13 @@ private void writeScripts(File outputDirectory) throws DaemonGeneratorException
InputStream batScript = createInputStream(batScriptPath);
writeFile(new File(outputDirectory, batScriptPath), batScript);
}

for(String shellScriptName : SHELL_SCRIPTS)
{
String shellScriptPath = "bin/"+shellScriptName;
InputStream shellScript = createInputStream(shellScriptPath);
writeFile(new File(outputDirectory, shellScriptPath), shellScript);
}
}

private void writeLibraries(File outputDirectory) throws DaemonGeneratorException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testDefaultYAJSWFilesIfNoGeneratorConfigurationsIsSet()
// assertTrue( "Batch file is missing: " + batchFile.getAbsolutePath(), batchFile.isFile() );
//
// assertEquals( FileUtils.fileRead( getTestFile( "src/test/resources/org/codehaus/mojo/appassembler/daemon/jsw/no-generator-configurations-run.bat" ) ),
// FileUtils.fileRead( batchFile ) );
// FileUtils.fileRead( batchFile ) );ore yajsw resources download
//
// assertEquals( ( new File( getBasedir()
// + "/target/classes/org/codehaus/mojo/appassembler/daemon/jsw/bin/wrapper-linux-x86-32" ) ).length(),
Expand All @@ -62,6 +62,11 @@ public void testDefaultYAJSWFilesIfNoGeneratorConfigurationsIsSet()
assertFileExists(yajswDir, "bat/startService.bat");
assertFileExists(yajswDir, "bat/stopService.bat");
assertFileExists(yajswDir, "bat/uninstallService.bat");
assertFileExists(yajswDir, "bin/runConsole.sh");
assertFileExists(yajswDir, "bin/installDaemon.sh");
assertFileExists(yajswDir, "bin/startDaemon.sh");
assertFileExists(yajswDir, "bin/stopDaemon.sh");
assertFileExists(yajswDir, "bin/uninstallDaemon.sh");
assertFileExists( yajswDir, "wrapper.jar" );
assertFileExists( yajswDir, "wrapperApp.jar" );
assertFileExists( yajswDir, "lib/core/commons/commons-cli-1.4.jar" );
Expand Down

0 comments on commit 9de18ac

Please sign in to comment.