1010import java .util .List ;
1111import java .util .Map ;
1212import java .util .Map .Entry ;
13+ import java .util .Random ;
1314import java .util .concurrent .Callable ;
1415import java .util .concurrent .CompletionService ;
1516import java .util .concurrent .ExecutionException ;
1920import junit .framework .Assert ;
2021import net .sourceforge .seqware .common .module .ReturnValue ;
2122import net .sourceforge .seqware .common .util .Log ;
23+ import net .sourceforge .seqware .common .util .configtools .ConfigTools ;
2224import net .sourceforge .seqware .pipeline .runner .PluginRunner ;
2325import org .apache .commons .io .FileUtils ;
2426import org .junit .AfterClass ;
4850 */
4951public class PluginRunnerET {
5052
51- private static File tempDir = Files .createTempDir ();
53+ private static File tempDir = null ;
54+
5255 private static Map <String , Integer > installedWorkflows = new HashMap <String , Integer >();
5356 private static Map <String , File > bundleLocations = new HashMap <String , File >();
5457 private static List <Integer > launchedWorkflowRuns = new ArrayList <Integer >();
@@ -86,8 +89,8 @@ public static void createAndInstallArchetypes() throws IOException {
8689 return ;
8790 }
8891 }
92+ createSharedTempDir ();
8993
90- tempDir = Files .createTempDir ();
9194 Log .info ("Trying to build and test archetypes at: " + tempDir .getAbsolutePath ());
9295 PluginRunner it = new PluginRunner ();
9396 String SEQWARE_VERSION = it .getClass ().getPackage ().getImplementationVersion ();
@@ -166,7 +169,7 @@ public static void clearStaticVariables() {
166169 installedWorkflows .clear ();
167170 bundleLocations .clear ();
168171 launchedWorkflowRuns .clear ();
169- tempDir = Files . createTempDir ();
172+ createSharedTempDir ();
170173 }
171174
172175 public static void monitorAndClean (boolean monitor ) throws IOException {
@@ -184,6 +187,14 @@ public static void monitorAndClean(boolean monitor) throws IOException {
184187
185188 clearStaticVariables ();
186189 }
190+
191+ private static void createSharedTempDir () {
192+ // need to create in a shared location for seqware installs with multiple nodes
193+ //tempDir = Files.createTempDir();
194+ String parentDir = ConfigTools .getSettings ().get ("OOZIE_WORK_DIR" );
195+ tempDir = new File (parentDir , String .valueOf (Math .abs (new Random ().nextInt ())));
196+ tempDir .mkdir ();
197+ }
187198
188199 @ Test
189200 public void testExportParameters () throws IOException {
0 commit comments