}
@Test(groups = "Functional", dataProvider = "allLinkedIdsData")
- public void allLinkedIdsTest(String commandLineArgs, Arg a,
+ public void allLinkedIdsTest(String pwd, String commandLineArgs, Arg a,
String[] values, String[] nonvalues)
{
+ String userDir = System.getProperty("user.dir");
+ if (pwd != null)
+ {
+ File pwdFile = new File(pwd);
+ System.setProperty("user.dir", pwdFile.getAbsolutePath());
+ }
String[] args = commandLineArgs.split("\\s+");
ArgParser argparser = new ArgParser(args);
ArgValues avs = avm.getArgValues(a);
ArgValue av = avs.getArgValue();
String v = av.getValue();
- value = new File(value).getAbsolutePath();
+ value = new File(value).getPath();
Assert.assertEquals(v, value, "Arg value for " + a.argString()
+ " not applied correctly to linkedId '" + linkedId + "'");
}
}
+ System.setProperty("user.dir", userDir);
}
@DataProvider(name = "allLinkedIdsData")
//
/*
*/
- { "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close",
+ { null,
+ "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close",
Arg.CLOSE, new String[]
{ null, null, null },
null },
- { "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --output={dirname}/{basename}.stk --close",
+ { null,
+ "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --output={dirname}/{basename}.stk --close",
Arg.OUTPUT, new String[]
{ "test/jalview/bin/argparser/testfiles/test1.stk",
"test/jalview/bin/argparser/testfiles/test2.stk",
"test/jalview/bin/argparser/testfiles/test3.stk", },
null },
- { "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close",
+ { null,
+ "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close",
Arg.IMAGE, new String[]
{ "test/jalview/bin/argparser/testfiles/test1.png",
"test/jalview/bin/argparser/testfiles/test2.png",
"test/jalview/bin/argparser/testfiles/test3.png", },
null },
+ /*
+ * Find a way to change pwd reliably -- need to match "*.fa" against some files!
+ { "test/jalview/bin/argparser/testfiles",
+
+ "--open=*.fa --image={dirname}/{basename}.png --close",
+ Arg.IMAGE, new String[]
+ { "./test1.png", "./test2.png", "./test3.png", }, null },
+ */
//
};
}
};
}
-}
+}
\ No newline at end of file