use of org.apache.ofbiz.testtools.TestRunContainer in project ofbiz-framework by apache.
the class RunTestEvents method runTest.
public static String runTest(HttpServletRequest request, HttpServletResponse response) throws ContainerException {
String component = request.getParameter("compName");
String suiteName = request.getParameter("suiteName");
String caseName = request.getParameter("caseName");
String result = null;
List<StartupCommand> ofbizCommands = new ArrayList<StartupCommand>();
if (caseName == null) {
ofbizCommands.add(new StartupCommand.Builder("test").properties(UtilMisc.toMap("component", component, "suitename", suiteName)).build());
} else {
ofbizCommands.add(new StartupCommand.Builder("test").properties(UtilMisc.toMap("component", component, "suitename", suiteName, "case", caseName)).build());
}
TestRunContainer testRunContainer = new TestRunContainer();
testRunContainer.init(ofbizCommands, "frontend test run", " ");
if (testRunContainer.start() == false) {
result = "error";
} else {
result = "success";
}
return result;
}
Aggregations