промежуточный. Рефакторинг публикации теста из текущего проекта.
This commit is contained in:
@@ -366,6 +366,47 @@ public abstract class Sapfor extends OSDComponent {
|
||||
//--------------------------------------------------------------------------->>
|
||||
//временный (?) проход, по тихому получить размерность теста, предварительно выполнив тихий парс.
|
||||
//тут все одноразовое. считаем что таблицы бд уже заполнены как надо.
|
||||
public LanguageStyle getStyle() throws Exception {
|
||||
return Global.getSetting(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed;
|
||||
}
|
||||
//----------
|
||||
public static Vector<PassCode_2021> getScenariosCodes() {
|
||||
Vector<PassCode_2021> res = new Vector<>();
|
||||
res.add(PassCode_2021.SPF_InitDeclsWithZero);
|
||||
res.add(PassCode_2021.SPF_ConvertStructures);
|
||||
res.add(PassCode_2021.SPF_ExpressionSubstitution);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_CreateCheckpoints);
|
||||
res.add(PassCode_2021.SPF_CreateIntervalsTree);
|
||||
res.add(PassCode_2021.SPF_RemoveDvmIntervals);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_RemoveDvmDirectives);
|
||||
res.add(PassCode_2021.SPF_RemoveDvmDirectivesToComments);
|
||||
res.add(PassCode_2021.SPF_RemoveOmpDirectives);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_LoopEndDoConverterPass);
|
||||
res.add(PassCode_2021.SPF_LoopUnion);
|
||||
res.add(PassCode_2021.SPF_LoopFission);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_PrivateShrinking);
|
||||
res.add(PassCode_2021.SPF_PrivateExpansion);
|
||||
res.add(PassCode_2021.SPF_PrivateRemoving);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_RemoveUnusedFunctions);
|
||||
res.add(PassCode_2021.SPF_DuplicateFunctionChains);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_ResolveParallelRegionConflicts);
|
||||
res.add(PassCode_2021.SPF_ResolveCommonBlockConflicts);
|
||||
//-
|
||||
res.add(PassCode_2021.SPF_InsertDvmhRegions);
|
||||
res.add(PassCode_2021.SPF_SharedMemoryParallelization);
|
||||
res.add(PassCode_2021.CreateParallelVariants);
|
||||
// res.add(PassCode_2021.SPF_InlineProceduresH);
|
||||
// res.add(PassCode_2021.SPF_InlineProcedures);
|
||||
// res.add(PassCode_2021.SPF_InsertIncludesPass);
|
||||
return res;
|
||||
}
|
||||
//--
|
||||
public int getTextMaxDim(File testFile, db_project_info target) {
|
||||
int res = Constants.Nan;
|
||||
LinkedHashMap<String, DBProjectFile> files = null;
|
||||
@@ -448,44 +489,5 @@ public abstract class Sapfor extends OSDComponent {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
public LanguageStyle getStyle() throws Exception {
|
||||
return Global.getSetting(SettingName.FREE_FORM).toBoolean() ? LanguageStyle.free : LanguageStyle.fixed;
|
||||
}
|
||||
//----------
|
||||
public static Vector<PassCode_2021> getScenariosCodes() {
|
||||
Vector<PassCode_2021> res = new Vector<>();
|
||||
res.add(PassCode_2021.SPF_InitDeclsWithZero);
|
||||
res.add(PassCode_2021.SPF_ConvertStructures);
|
||||
res.add(PassCode_2021.SPF_ExpressionSubstitution);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_CreateCheckpoints);
|
||||
res.add(PassCode_2021.SPF_CreateIntervalsTree);
|
||||
res.add(PassCode_2021.SPF_RemoveDvmIntervals);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_RemoveDvmDirectives);
|
||||
res.add(PassCode_2021.SPF_RemoveDvmDirectivesToComments);
|
||||
res.add(PassCode_2021.SPF_RemoveOmpDirectives);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_LoopEndDoConverterPass);
|
||||
res.add(PassCode_2021.SPF_LoopUnion);
|
||||
res.add(PassCode_2021.SPF_LoopFission);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_PrivateShrinking);
|
||||
res.add(PassCode_2021.SPF_PrivateExpansion);
|
||||
res.add(PassCode_2021.SPF_PrivateRemoving);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_RemoveUnusedFunctions);
|
||||
res.add(PassCode_2021.SPF_DuplicateFunctionChains);
|
||||
//--
|
||||
res.add(PassCode_2021.SPF_ResolveParallelRegionConflicts);
|
||||
res.add(PassCode_2021.SPF_ResolveCommonBlockConflicts);
|
||||
//-
|
||||
res.add(PassCode_2021.SPF_InsertDvmhRegions);
|
||||
res.add(PassCode_2021.SPF_SharedMemoryParallelization);
|
||||
res.add(PassCode_2021.CreateParallelVariants);
|
||||
// res.add(PassCode_2021.SPF_InlineProceduresH);
|
||||
// res.add(PassCode_2021.SPF_InlineProcedures);
|
||||
// res.add(PassCode_2021.SPF_InsertIncludesPass);
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package Repository;
|
||||
import Common.Constants;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.Database;
|
||||
import Common.Database.iDBObject;
|
||||
import Common.Global;
|
||||
import Common.Utils.InterruptThread;
|
||||
import Common.Utils.Utils;
|
||||
@@ -171,10 +170,6 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
public boolean needsEmail(String email) {
|
||||
return true;
|
||||
}
|
||||
public void beforePublishAction(DBObject object) throws Exception {
|
||||
}
|
||||
public void afterPublishAction(DBObject object) throws Exception {
|
||||
}
|
||||
public boolean canDelete(DBObject object) throws Exception {
|
||||
return true;
|
||||
}
|
||||
@@ -276,28 +271,8 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = db.getObjectsCopies(p.getKey(), (Vector<Object>) p.getValue());
|
||||
break;
|
||||
case DeleteObjects:
|
||||
Print("Удалить список объектов ");
|
||||
Vector<Object> objects = (Vector<Object>) request.object;
|
||||
db.BeginTransaction();
|
||||
for (Object object : objects) {
|
||||
dbObject = (DBObject) object;
|
||||
if (canDelete(dbObject)) {
|
||||
db.DeleteWithCheck(dbObject);
|
||||
DeleteAction(dbObject);
|
||||
}
|
||||
}
|
||||
db.Commit();
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
break;
|
||||
//------------------------
|
||||
case PublishObject:
|
||||
dbObject = (DBObject) request.object;
|
||||
beforePublishAction(dbObject);
|
||||
PublishObject(dbObject);
|
||||
afterPublishAction(dbObject);
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
response.object = (Serializable) dbObject.getPK();
|
||||
PublishObject();
|
||||
break;
|
||||
//</editor-fold>
|
||||
case EXIT:
|
||||
@@ -345,13 +320,18 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
}
|
||||
}
|
||||
}
|
||||
public void PublishObject(DBObject dbObject) throws Exception {
|
||||
if (dbObject instanceof iDBObject) {
|
||||
Print("Опубликовать объект");
|
||||
db.Insert(dbObject);
|
||||
} else {
|
||||
Print("Опубликовать объект с автоинкрементным ключом");
|
||||
db.InsertWithCheck(dbObject); //проверка не нужна,АИ гарантирует что ключ уникален.
|
||||
}
|
||||
private void PublishObject() throws Exception {
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
DBObject dbObject = (DBObject) request.object;
|
||||
beforePublishAction(dbObject);
|
||||
response.object = publishObject(dbObject);
|
||||
afterPublishAction(dbObject);
|
||||
}
|
||||
protected Serializable publishObject(DBObject object) throws Exception {
|
||||
return (Serializable) db.InsertS(object).getPK();
|
||||
}
|
||||
protected void beforePublishAction(DBObject object) throws Exception {
|
||||
}
|
||||
protected void afterPublishAction(DBObject object) throws Exception {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,15 +37,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
public int getPort() {
|
||||
return 7995;
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
public boolean needsEmail(String email) {
|
||||
if (db.subscribers.containsKey(email)) {
|
||||
return db.subscribers.get(email).mailOn == 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
public void DeleteAction(DBObject object) throws Exception {
|
||||
if (object instanceof BugReport) {
|
||||
|
||||
@@ -35,7 +35,6 @@ public enum ServerCode {
|
||||
DeleteObjects,
|
||||
CheckObjectExistense, //
|
||||
//--
|
||||
PublishAccountObjects,
|
||||
EditAccountObject,
|
||||
//--
|
||||
EXIT,
|
||||
@@ -80,6 +79,6 @@ public enum ServerCode {
|
||||
PublishAccount,
|
||||
GetActualSapforPackageData,
|
||||
//--
|
||||
PublishObject,
|
||||
PublishTestProject
|
||||
PublishObject
|
||||
// PublishTestProject
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user