no message

This commit is contained in:
2024-05-18 23:31:45 +03:00
parent d29c2ba93c
commit fb53a4133a
10 changed files with 129 additions and 21 deletions

11
.idea/workspace.xml generated
View File

@@ -7,16 +7,15 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ActualizeServerSapfors.java" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ShowSapforCompilationErr.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ShowSapforCompilationOut.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ShowTestingServerFile.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/Common/TestsDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapfor.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapforState.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapforState.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapforState.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapforState.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ActualizePackages.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ActualizePackages.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapforsBar.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/SAPFOR/ServerSapfor/ServerSapforsBar.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddSapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/AddSapforPackage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CloneSapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/CloneSapforPackage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/PassCode_2021.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />

View File

@@ -62,7 +62,7 @@ public class Visualiser extends Component {
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html //http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
@Override @Override
public void GetVersionInfo() { public void GetVersionInfo() {
version = 1099; version = 1100;
String pattern = "MMM dd yyyy HH:mm:ss"; String pattern = "MMM dd yyyy HH:mm:ss";
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH); DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
date_text = df.format(getClassBuildTime()); date_text = df.format(getClassBuildTime());

View File

@@ -7,11 +7,8 @@ import Common.Utils.Utils;
import ProjectData.LanguageName; import ProjectData.LanguageName;
import Repository.Component.Sapfor.Sapfor; import Repository.Component.Sapfor.Sapfor;
import Repository.EmailMessage; import Repository.EmailMessage;
import Repository.RepositoryRefuseException;
import Repository.Server.ServerCode; import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import TestingSystem.Common.TasksPackageState; import TestingSystem.Common.TasksPackageState;
import TestingSystem.Common.TestingPackageToKill.TestingPackageToKill;
import TestingSystem.Common.TestingPlanner; import TestingSystem.Common.TestingPlanner;
import TestingSystem.SAPFOR.Json.SapforConfiguration_json; import TestingSystem.SAPFOR.Json.SapforConfiguration_json;
import TestingSystem.SAPFOR.Json.SapforTest_json; import TestingSystem.SAPFOR.Json.SapforTest_json;
@@ -27,7 +24,6 @@ import java.nio.charset.Charset;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Vector; import java.util.Vector;
public class SapforTestingPlanner extends TestingPlanner<SapforPackage> { public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
File workspace; File workspace;
@@ -188,13 +184,16 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
} }
} }
void SyncronizeRepository() throws Exception { void SyncronizeRepository() throws Exception {
System.out.println("Синхронизация репозитория..."); System.out.println("Синхронизация репозитория...");
UpdateSapforState(ServerSapforState.DVMRepositorySynchronization);
System.out.println("Синхронизация ветви DVM..."); System.out.println("Синхронизация ветви DVM...");
Utils.startScript(repo, repo, "dvm_checkout", Utils.startScript(repo, repo, "dvm_checkout",
"svn checkout " + "svn checkout " +
Constants.REPOSITORY_AUTHENTICATION + Constants.REPOSITORY_AUTHENTICATION +
" " + Constants.DVM_REPOSITORY + " 1>dvm_out.txt 2>dvm_err.txt\n").waitFor(); " " + Constants.DVM_REPOSITORY + " 1>dvm_out.txt 2>dvm_err.txt\n").waitFor();
System.out.println("Синхронизация ветви SAPFOR..."); System.out.println("Синхронизация ветви SAPFOR...");
UpdateSapforState(ServerSapforState.SAPFORRepositorySynchronization);
Utils.startScript(repo, repo, "spf_checkout", Utils.startScript(repo, repo, "spf_checkout",
"svn checkout " + "svn checkout " +
Constants.REPOSITORY_AUTHENTICATION + Constants.REPOSITORY_AUTHENTICATION +
@@ -202,6 +201,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
} }
void CompileSapfor() throws Exception { void CompileSapfor() throws Exception {
System.out.println("Сборка SAPFOR..."); System.out.println("Сборка SAPFOR...");
UpdateSapforState(ServerSapforState.Compilation);
//- //-
if (repo_bin.exists()) if (repo_bin.exists())
FileUtils.forceDelete(repo_bin); FileUtils.forceDelete(repo_bin);

View File

@@ -1,7 +1,9 @@
package TestingSystem.SAPFOR.ServerSapfor; package TestingSystem.SAPFOR.ServerSapfor;
import Common.Constants;
import Common.Database.DBObject; import Common.Database.DBObject;
import Common.Database.riDBObject; import Common.Database.riDBObject;
import Common.Utils.Utils; import Common.Utils.Utils;
import GlobalData.RemoteFile.RemoteFile;
import ProjectData.LanguageName; import ProjectData.LanguageName;
import com.sun.org.glassfish.gmbal.Description; import com.sun.org.glassfish.gmbal.Description;

View File

@@ -1,12 +1,10 @@
package TestingSystem.SAPFOR.ServerSapfor; package TestingSystem.SAPFOR.ServerSapfor;
import Common.Current;
import Common.UI.StatusEnum; import Common.UI.StatusEnum;
import Common.UI.Themes.VisualiserFonts; import Common.UI.Themes.VisualiserFonts;
import java.awt.*;
public enum ServerSapforState implements StatusEnum { public enum ServerSapforState implements StatusEnum {
Queued, Queued,
RepositorySynchronization, DVMRepositorySynchronization,
SAPFORRepositorySynchronization,
Compilation, Compilation,
Done, Done,
DoneWithErrors; DoneWithErrors;
@@ -20,7 +18,8 @@ public enum ServerSapforState implements StatusEnum {
case DoneWithErrors: case DoneWithErrors:
return VisualiserFonts.BadState; return VisualiserFonts.BadState;
case Compilation: case Compilation:
case RepositorySynchronization: case DVMRepositorySynchronization:
case SAPFORRepositorySynchronization:
return VisualiserFonts.ProgressState; return VisualiserFonts.ProgressState;
default: default:
return VisualiserFonts.UnknownState; return VisualiserFonts.UnknownState;
@@ -31,8 +30,10 @@ public enum ServerSapforState implements StatusEnum {
switch (this) { switch (this) {
case Queued: case Queued:
return "в очереди"; return "в очереди";
case RepositorySynchronization: case DVMRepositorySynchronization:
return "синхронизация"; return "синхронизация репозитория DVM";
case SAPFORRepositorySynchronization:
return "синхронизация репозитория SAPFOR";
case Compilation: case Compilation:
return "сборка"; return "сборка";
case Done: case Done:

View File

@@ -5,7 +5,8 @@ public class ServerSapforsBar extends DataMenuBar {
public ServerSapforsBar() { public ServerSapforsBar() {
super("версии SAPFOR", super("версии SAPFOR",
PassCode_2021.CompileServerSapfor, PassCode_2021.CompileServerSapfor,
// PassCode_2021.InstallServerSapfor, PassCode_2021.ShowSapforCompilationOut,
PassCode_2021.ShowSapforCompilationErr,
PassCode_2021.DeleteServerSapfor PassCode_2021.DeleteServerSapfor
); );
} }

View File

@@ -0,0 +1,25 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants;
import Common.Current;
import GlobalData.RemoteFile.RemoteFile;
public class ShowSapforCompilationErr extends ShowTestingServerFile{
@Override
protected int getTimeout() {
return super.getTimeout();
}
@Override
public String getIconPath() {
return "/icons/CompilationErrors.png";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Current.Check(Log,Current.ServerSapfor)){
return false;
}
return super.canStart("Поток ошибок", new RemoteFile(Current.getServerSapfor().home_path, Constants.err_file));
}
}

View File

@@ -0,0 +1,25 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants;
import Common.Current;
import GlobalData.RemoteFile.RemoteFile;
public class ShowSapforCompilationOut extends ShowTestingServerFile{
@Override
protected int getTimeout() {
return super.getTimeout();
}
@Override
public String getIconPath() {
return "/icons/CompilationOutput.png";
}
@Override
public String getButtonText() {
return "";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (!Current.Check(Log,Current.ServerSapfor)){
return false;
}
return super.canStart("Поток вывода", new RemoteFile(Current.getServerSapfor().home_path, Constants.out_file));
}
}

View File

@@ -0,0 +1,46 @@
package Visual_DVM_2021.Passes.All;
import Common.UI.Windows.Dialog.Text.ReadOnlyMultilineTextForm;
import Common.Utils.Utils;
import GlobalData.RemoteFile.RemoteFile;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import Visual_DVM_2021.Passes.PassException;
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.util.List;
import java.util.Vector;
public class ShowTestingServerFile extends TestingSystemPass<RemoteFile> {
String title;
File localFile;
@Override
protected boolean canStart(Object... args) throws Exception {
title = (String) args[0];
target = (RemoteFile) args[1];
return true;
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.ReceiveFile, target.full_name));
localFile = Utils.getTempFileName(target.name);
if (response.object != null)
response.Unpack(localFile);
else throw new PassException("Файл не найден");
}
@Override
protected boolean validate() {
return localFile.exists();
}
@Override
protected void showDone() throws Exception {
ReadOnlyMultilineTextForm ff = new ReadOnlyMultilineTextForm();
List<String> lines = FileUtils.readLines(localFile);
Vector<String> res = new Vector<>();
for (int i = lines.size() - 1; i >= 0; i--)
res.add(lines.get(i));
ff.ShowDialog(title,
String.join("\n", res)
);
}
}

View File

@@ -336,12 +336,21 @@ public enum PassCode_2021 {
SPF_InsertImplicitNone, SPF_InsertImplicitNone,
CompileServerSapfor, CompileServerSapfor,
ActualizeServerSapfors, ActualizeServerSapfors,
; ShowTestingServerFile,
//--
ShowSapforCompilationOut,
ShowSapforCompilationErr;
//--
public String getDescription() { public String getDescription() {
switch (this) { switch (this) {
case Undefined: case Undefined:
return "?"; return "?";
//-- case ShowSapforCompilationOut:
return "Отобразить поток вывода сборки SAPFOR";
case ShowSapforCompilationErr:
return "Отобразить поток ошибок сборки SAPFOR";
case ShowTestingServerFile:
return "Отобразить файл сервера тестирования";
case ActualizeServerSapfors: case ActualizeServerSapfors:
return "Проверить собираемые версии SAPFOR"; return "Проверить собираемые версии SAPFOR";
case CompileServerSapfor: case CompileServerSapfor: