test.setDequeueTime(System.currentTimeMillis());
if(mExecutionContext == null) {
mExecutionContext = createExceutionContext();
}
test.setExecutionStartTime(System.currentTimeMillis());
TestStartRequest startRequest = test.getStartRequest();
String profile = startRequest.getProfile();
File profileConfFile = new File(mExecutionContextConfiguration.getProfileDirectory(),
String.format("%s.properties", profile));
if(!profileConfFile.isFile()) {
test.setStatus(Status.illegalArgument("Profile " + profile + " not found"));
test.setExecutionFinishTime(System.currentTimeMillis());
} else {
File logDir = Dirs.create(new File(mExecutionContextConfiguration.
getGlobalLogDirectory(), test.getStartRequest().getTestHandle()));
File logFile = new File(logDir, "execution.txt");
test.setOutputFile(logFile);
logStream = new PrintStream(logFile);
logger = new TestLogger(logStream, TestLogger.LEVEL.DEBUG);
TestConfiguration testConfiguration = TestConfiguration.fromFile(profileConfFile, logger);
testConfiguration.setPatch(startRequest.getPatchURL());
testConfiguration.setJiraName(startRequest.getJiraName());
testConfiguration.setClearLibraryCache(startRequest.isClearLibraryCache());
LocalCommandFactory localCommandFactory = new LocalCommandFactory(logger);
PTest ptest = mPTestBuilder.build(testConfiguration, mExecutionContext,
test.getStartRequest().getTestHandle(), logDir,
localCommandFactory, new SSHCommandExecutor(logger),
new RSyncCommandExecutor(logger, mExecutionContextConfiguration.getMaxRsyncThreads(),