пауза тестирования. перенос фильтров влево. v++
This commit is contained in:
@@ -6,6 +6,7 @@ import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Machine.Machine;
|
||||
import _VisualDVM.GlobalData.Machine.MachineType;
|
||||
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
||||
import _VisualDVM.GlobalData.User.User;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
@@ -112,7 +113,7 @@ public abstract class TestingPlanner<P extends TestingPackage> extends TestingCl
|
||||
if (!recipients.contains(testingPackage.sender_address))
|
||||
recipients.add(testingPackage.sender_address);
|
||||
//--
|
||||
for (String address: recipients)
|
||||
for (String address : recipients)
|
||||
ServerCommand(ServerCode.Email, address, message);
|
||||
}
|
||||
}
|
||||
@@ -139,71 +140,73 @@ public abstract class TestingPlanner<P extends TestingPackage> extends TestingCl
|
||||
}
|
||||
protected void MachineConnectionError() {
|
||||
}
|
||||
protected boolean checkIfPaused() throws Exception {
|
||||
return false;
|
||||
}
|
||||
protected void PerformPackage(TestingPackage package_in) throws Exception {
|
||||
testingPackage = (P) package_in;
|
||||
//--
|
||||
Print(testingPackage.id + ":" + testingPackage.state.getDescription());
|
||||
//--
|
||||
// if (testingPackage.connectionErrosCount >= 10) {
|
||||
// Print(testingPackage.id + " had 10 connection errors. stop");
|
||||
// UpdatePackageState(TasksPackageState.ConnectionError);
|
||||
// MachineConnectionError();
|
||||
// } else {
|
||||
//--
|
||||
InitSessionCredentials();
|
||||
if (testingPackage.state.equals(TasksPackageState.Analysis)) {
|
||||
AnalyseResults();
|
||||
} else {
|
||||
try {
|
||||
if (Connect()) {
|
||||
int ptk_id = (int) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id);
|
||||
if (ptk_id != CommonConstants.Nan) {
|
||||
Print("package " + testingPackage.id + " NEEDS TO KILL");
|
||||
Kill();
|
||||
UpdatePackageState(TasksPackageState.Aborted);
|
||||
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(TestingPackageToKill.class, ptk_id));
|
||||
} else {
|
||||
//--
|
||||
switch (testingPackage.state) {
|
||||
case TestsSynchronize:
|
||||
TestsSynchronize();
|
||||
UpdatePackageState(TasksPackageState.PackageWorkspaceCreation);
|
||||
break;
|
||||
case PackageWorkspaceCreation:
|
||||
PackageWorkspaceCreation();
|
||||
UpdatePackageState(TasksPackageState.PackageStart);
|
||||
break;
|
||||
case PackageStart:
|
||||
PackageStart();
|
||||
testingPackage.StartDate = new Date().getTime();
|
||||
UpdatePackageState(getStateAfterStart());
|
||||
break;
|
||||
case RunningEnd:
|
||||
DownloadResults();
|
||||
UpdatePackageState(TasksPackageState.Analysis);
|
||||
break;
|
||||
default:
|
||||
if (CheckNextState()) UpdatePackage();
|
||||
break;
|
||||
}
|
||||
//--
|
||||
}
|
||||
} else {
|
||||
testingPackage.connectionErrosCount++;
|
||||
UpdatePackage();
|
||||
InitSessionCredentials();
|
||||
if (testingPackage.state.equals(TasksPackageState.Analysis)) {
|
||||
AnalyseResults();
|
||||
} else {
|
||||
try {
|
||||
if (Connect()) {
|
||||
//проверка на убийство и паузу
|
||||
int ptk_id = (int) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id);
|
||||
if (ptk_id != CommonConstants.Nan) {
|
||||
Print("package " + testingPackage.id + " NEEDS TO KILL");
|
||||
Kill();
|
||||
UpdatePackageState(TasksPackageState.Aborted);
|
||||
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(TestingPackageToKill.class, ptk_id));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Print("Ошибка сеанса. Соединение будет разорвано.");
|
||||
ex.printStackTrace();
|
||||
Print(ex.getMessage());
|
||||
//
|
||||
// testingPackage.connectionErrosCount++;
|
||||
// UpdatePackage();
|
||||
} finally {
|
||||
Disconnect();
|
||||
else if (checkIfPaused()) {
|
||||
UpdatePackageState(TasksPackageState.Paused);
|
||||
}
|
||||
else {
|
||||
//--
|
||||
switch (testingPackage.state) {
|
||||
case TestsSynchronize:
|
||||
TestsSynchronize();
|
||||
UpdatePackageState(TasksPackageState.PackageWorkspaceCreation);
|
||||
break;
|
||||
case PackageWorkspaceCreation:
|
||||
PackageWorkspaceCreation();
|
||||
UpdatePackageState(TasksPackageState.PackageStart);
|
||||
break;
|
||||
case PackageStart:
|
||||
PackageStart();
|
||||
testingPackage.StartDate = new Date().getTime();
|
||||
UpdatePackageState(getStateAfterStart());
|
||||
break;
|
||||
case RunningEnd:
|
||||
DownloadResults();
|
||||
UpdatePackageState(TasksPackageState.Analysis);
|
||||
break;
|
||||
case Paused:
|
||||
if (!checkIfPaused()&&CheckNextState())
|
||||
UpdatePackage();
|
||||
break;
|
||||
default:
|
||||
if (CheckNextState()) UpdatePackage();
|
||||
break;
|
||||
}
|
||||
//--
|
||||
}
|
||||
} else {
|
||||
testingPackage.connectionErrosCount++;
|
||||
UpdatePackage();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Print("Ошибка сеанса. Соединение будет разорвано.");
|
||||
ex.printStackTrace();
|
||||
Print(ex.getMessage());
|
||||
} finally {
|
||||
Disconnect();
|
||||
}
|
||||
// }
|
||||
}
|
||||
//--
|
||||
testingPackage.destructor();
|
||||
testingPackage = null;
|
||||
|
||||
Reference in New Issue
Block a user