no message
This commit is contained in:
@@ -32,7 +32,9 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
target = response.object;
|
||||
}
|
||||
};
|
||||
if (!pass.Do()) throw new PassException("Ошибка взаимодействия с сервером " + code_in);
|
||||
if (!pass.Do()) {
|
||||
ServerConnectionError(code_in);
|
||||
}
|
||||
return pass.target;
|
||||
}
|
||||
protected Object ServerCommand(ServerCode code_in, Serializable object_in) throws Exception {
|
||||
@@ -103,30 +105,10 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
}
|
||||
protected void Disconnect() {
|
||||
}
|
||||
//жизненный цикл планировщика
|
||||
protected void Session() throws Exception {
|
||||
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;
|
||||
}
|
||||
protected void MachineConnectionError(){
|
||||
}
|
||||
protected void ServerConnectionError(ServerCode code_in) throws Exception{
|
||||
throw new PassException("Ошибка взаимодействия с сервером " + code_in);
|
||||
}
|
||||
// ---
|
||||
protected void PerformPackage(TestingPackage package_in) throws Exception{
|
||||
@@ -137,6 +119,7 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
if (testingPackage.connectionErrosCount>=10){
|
||||
Print(testingPackage.id+" had 10 connection errors. stop");
|
||||
UpdatePackageState(TasksPackageState.ConnectionError);
|
||||
MachineConnectionError();
|
||||
}else {
|
||||
//--
|
||||
InitSessionCredentials();
|
||||
@@ -153,7 +136,30 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
UpdatePackageState(TasksPackageState.Aborted);
|
||||
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(TestingPackageToKill.class, ptk_id));
|
||||
} else {
|
||||
Session();
|
||||
//--
|
||||
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++;
|
||||
|
||||
Reference in New Issue
Block a user