Package com._1c.g5.v8.dt.testing.compare
Class CompareTestUtils
- java.lang.Object
- 
- com._1c.g5.v8.dt.testing.compare.CompareTestUtils
 
- 
 public final class CompareTestUtils extends Object Common utilities for testing of compare/merge mechanism.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddCatalogAndWait(String catalogSymlink, IComparisonSession session, IComparisonManager comparisonManager, IV8ProjectManager v8ProjectManager, IWorkspaceOrchestrator workspaceOrchestrator)Adds new Catalog object into the MAIN DT project under the active comparison session.static voidaddEnumAndWait(String enumSymlink, IComparisonSession session, IComparisonManager comparisonManager, IV8ProjectManager v8ProjectManager, IWorkspaceOrchestrator workspaceOrchestrator)Adds new Enum object into the MAIN DT project under the active comparison session.static CompareMergeProcessBatchcreateComparisonBatch(ComparisonProcessHandle... handles)static CompareMergeProcessBatchcreateComparisonBatch(MatchingStrategy matchingStrategy, boolean mainSideObjectsDeletionAllowed, ComparisonProcessHandle... handles)static CompareMergeProcessBatchcreateComparisonBatch(MatchingStrategy matchingStrategy, ComparisonProcessHandle... handles)static CompareMergeProcessBatchcreateComparisonBatchForLibraryIntegration(String integrationSettingsName, MatchingStrategy matchingStrategy, boolean mainSideObjectsDeletionAllowed, ComparisonProcessHandle... handles)Creates comparison batch for the library integration processstatic CompareMergeProcessBatchcreateComparisonBatchMergeObjectsContent(MatchingStrategy matchingStrategy, ComparisonProcessHandle... handles)static CompareMergeProcessBatchcreateComparisonBatchMergeObjectsContent(MatchingStrategy matchingStrategy, List<ObjectsTriple<String>> correspondences, ComparisonProcessHandle... handles)static CompareMergeProcessBatchcreateComparisonBatchMergeWithInfobase(ComparisonProcessHandle handle, IEObjectTrie mainSideModifiedObjectsTrie, IEObjectTrie otherSideModifiedObjectsTrie)static CompareMergeProcessBatchcreateComparisonBatchMergeWithInfobase(ComparisonProcessHandle handle, MatchingStrategy matchingStrategy, IEObjectTrie mainSideModifiedObjectsTrie, IEObjectTrie otherSideModifiedObjectsTrie)static CompareMergeProcessBatchcreateComparisonBatchParseBslModuleStructure(MatchingStrategy matchingStrategy, ComparisonProcessHandle... handles)static IComparisonDataSourceDescriptorcreateDataSourceDescriptor(IV8Project v8Project, DataSourceType type, Class<?> sourceClass)Creates comparison data source descriptor.static EObjectTriecreateEObjectTrie(String... symlinks)CreatesEObjectTriefor the given collection of symlinks.static FileSystemComparisonDataSourceDescriptorcreateFileSystemDescriptor(String projectName, Class<?> sourceClass)static FileSystemComparisonDataSourceDescriptorcreateFileSystemDescriptor(String folderName, String deltaBaseProjectName, Class<?> sourceClass)static GitComparisonDataSourceDescriptorcreateGitDescriptor(File workTree, String projectPathInRepo, String revision)static V8ProjectComparisonDataSourceDescriptorcreateV8ProjectDescriptor(IV8Project v8Project)static V8ProjectComparisonDataSourceDescriptorcreateV8ProjectDescriptor(String projectName, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager, Class<?> sourceClass)static voiddisableConfigurationNameMerging(IComparisonSession session)static <T extends FeatureComparisonNode>
 TfindChildNodeByFeature(IComparisonSession session, ComparisonNode parent, org.eclipse.emf.ecore.EStructuralFeature feature)static <T extends ComparisonNode>
 TfindChildNodeByFeaturePath(IComparisonSession session, ComparisonNode nearestTopNode, org.eclipse.emf.ecore.EStructuralFeature... featuresPath)static BslModuleSectionComparisonNodefindMethodOrProcedure(IComparisonSession session, BslModuleComparisonNode parent, String methodName)static FilegetBundleEntry(Class<?> clazz, String path)static IComparedObjects<?>getComparedObjects(IComparisonSession session, ComparisonNode node)static <T extends ComparisonNode>
 TgetContainmentNode(IComparisonSession session, String nearestTopNodeSymlink, org.eclipse.emf.ecore.EStructuralFeature... featuresPath)static List<Path>getFileListRecursively(IV8Project project, Path path)Returns all files in given folder and subfolders.static org.eclipse.xtext.naming.QualifiedNamegetQualifiedName(String symlink)Returns the qualified name for the given symlink.static org.eclipse.jgit.revwalk.RevCommitgetRevCommit(org.eclipse.jgit.lib.Repository repo, String refName)static org.eclipse.emf.ecore.EObjectgetTopLevelObject(String symlink, IV8Project v8Project, IBmModelManager bmModelManager)static TopComparisonNodegetTopNode(IComparisonSession session, String symlink)static IV8ProjectopenV8Project(String projectName, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager, Class<?> sourceClass)static IV8ProjectopenV8Project(String projectName, Path sourceRoot, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager)static IV8ProjectopenV8ProjectAndDisableAllChecks(String projectName, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager, IWorkspaceOrchestrator workspaceOrchestrator, ICheckRepository checkRepository, Class<?> sourceClass)static IV8ProjectopenV8ProjectAndDisableAllChecks(String projectName, Path sourceRoot, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager, IWorkspaceOrchestrator workspaceOrchestrator, ICheckRepository checkRepository)static org.eclipse.jgit.lib.RepositoryprepareGitRepo(String commitId, File workTree)Creates a repository matching the parameters passed.static voidresetContent(org.eclipse.jgit.api.Git git, String commitId)Resets HARD the given git repository to the specified commit.static voidsetCorrespondencesAndWait(IComparisonManager comparisonManager, IComparisonSession session, ObjectsTriple<String> correspondence)static voidsetMergeRule(IComparisonSession session, ComparisonNode node, MergeRule ruleToSet)static voidsetOrderSide(IComparisonSession session, ComparisonNode node, ComparisonSide orderSideToSet)static voidstartComparison(IComparisonManager comparisonManager, CompareMergeProcessBatch batch)static voidstartComparison(IComparisonManager comparisonManager, ComparisonProcessHandle handle)static voidstartComparisonAndWait(IComparisonManager comparisonManager, CompareMergeProcessBatch batch)static voidstartComparisonAndWait(IComparisonManager comparisonManager, ComparisonProcessHandle handle)static voidstartComparisonAndWait(String message, IComparisonManager comparisonManager, CompareMergeProcessBatch batch)static voidstartMerge(IComparisonManager comparisonManager, CompareMergeProcessBatch batch)static voidstartMergeAndWait(IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace)static voidstartMergeAndWait(IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace, IDerivedDataManagerProvider derivedDataManagerProvider)static voidstartMergeAndWait(IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace, IDerivedDataManagerProvider derivedDataManagerProvider, boolean expectSuccess)static voidstartMergeAndWait(String message, IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace)static voidstartMergeAndWait(String message, IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace, IDerivedDataManagerProvider derivedDataManagerProvider)static voidstartMergeAndWait(String message, IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace, IDerivedDataManagerProvider derivedDataManagerProvider, boolean expectSuccess)static booleanstopJob(String jobFamily, boolean waitToStop)static voidwaitComparison(IComparisonManager comparisonManager, ComparisonProcessHandle comparisonHandle)static voidwaitForJobFinish(Object jobFamily)
 
- 
- 
- 
Method Detail- 
getBundleEntrypublic static File getBundleEntry(Class<?> clazz, String path) throws IOException - Throws:
- IOException
 
 - 
createComparisonBatchpublic static CompareMergeProcessBatch createComparisonBatch(ComparisonProcessHandle... handles) 
 - 
createComparisonBatchpublic static CompareMergeProcessBatch createComparisonBatch(MatchingStrategy matchingStrategy, ComparisonProcessHandle... handles) 
 - 
createComparisonBatchpublic static CompareMergeProcessBatch createComparisonBatch(MatchingStrategy matchingStrategy, boolean mainSideObjectsDeletionAllowed, ComparisonProcessHandle... handles) 
 - 
createComparisonBatchMergeObjectsContentpublic static CompareMergeProcessBatch createComparisonBatchMergeObjectsContent(MatchingStrategy matchingStrategy, ComparisonProcessHandle... handles) 
 - 
createComparisonBatchMergeObjectsContentpublic static CompareMergeProcessBatch createComparisonBatchMergeObjectsContent(MatchingStrategy matchingStrategy, List<ObjectsTriple<String>> correspondences, ComparisonProcessHandle... handles) 
 - 
createComparisonBatchMergeWithInfobasepublic static CompareMergeProcessBatch createComparisonBatchMergeWithInfobase(ComparisonProcessHandle handle, IEObjectTrie mainSideModifiedObjectsTrie, IEObjectTrie otherSideModifiedObjectsTrie) 
 - 
createComparisonBatchMergeWithInfobasepublic static CompareMergeProcessBatch createComparisonBatchMergeWithInfobase(ComparisonProcessHandle handle, MatchingStrategy matchingStrategy, IEObjectTrie mainSideModifiedObjectsTrie, IEObjectTrie otherSideModifiedObjectsTrie) 
 - 
createComparisonBatchParseBslModuleStructurepublic static CompareMergeProcessBatch createComparisonBatchParseBslModuleStructure(MatchingStrategy matchingStrategy, ComparisonProcessHandle... handles) 
 - 
startComparisonpublic static void startComparison(IComparisonManager comparisonManager, ComparisonProcessHandle handle) 
 - 
startComparisonpublic static void startComparison(IComparisonManager comparisonManager, CompareMergeProcessBatch batch) 
 - 
startMergepublic static void startMerge(IComparisonManager comparisonManager, CompareMergeProcessBatch batch) 
 - 
startComparisonAndWaitpublic static void startComparisonAndWait(IComparisonManager comparisonManager, ComparisonProcessHandle handle) 
 - 
startComparisonAndWaitpublic static void startComparisonAndWait(String message, IComparisonManager comparisonManager, CompareMergeProcessBatch batch) 
 - 
waitComparisonpublic static void waitComparison(IComparisonManager comparisonManager, ComparisonProcessHandle comparisonHandle) 
 - 
startComparisonAndWaitpublic static void startComparisonAndWait(IComparisonManager comparisonManager, CompareMergeProcessBatch batch) 
 - 
startMergeAndWaitpublic static void startMergeAndWait(String message, IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace) 
 - 
startMergeAndWaitpublic static void startMergeAndWait(IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace) 
 - 
startMergeAndWaitpublic static void startMergeAndWait(String message, IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace, IDerivedDataManagerProvider derivedDataManagerProvider) 
 - 
startMergeAndWaitpublic static void startMergeAndWait(IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace, IDerivedDataManagerProvider derivedDataManagerProvider) 
 - 
startMergeAndWaitpublic static void startMergeAndWait(String message, IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace, IDerivedDataManagerProvider derivedDataManagerProvider, boolean expectSuccess) 
 - 
startMergeAndWaitpublic static void startMergeAndWait(IComparisonManager comparisonManager, CompareMergeProcessBatch batch, TestingWorkspace testingWorkspace, IDerivedDataManagerProvider derivedDataManagerProvider, boolean expectSuccess) 
 - 
stopJobpublic static boolean stopJob(String jobFamily, boolean waitToStop) 
 - 
waitForJobFinishpublic static void waitForJobFinish(Object jobFamily) 
 - 
disableConfigurationNameMergingpublic static void disableConfigurationNameMerging(IComparisonSession session) 
 - 
getRevCommitpublic static org.eclipse.jgit.revwalk.RevCommit getRevCommit(org.eclipse.jgit.lib.Repository repo, String refName) throws IOException- Throws:
- IOException
 
 - 
getTopNodepublic static TopComparisonNode getTopNode(IComparisonSession session, String symlink) 
 - 
getComparedObjectspublic static IComparedObjects<?> getComparedObjects(IComparisonSession session, ComparisonNode node) 
 - 
findChildNodeByFeaturepublic static <T extends FeatureComparisonNode> T findChildNodeByFeature(IComparisonSession session, ComparisonNode parent, org.eclipse.emf.ecore.EStructuralFeature feature) 
 - 
findMethodOrProcedurepublic static BslModuleSectionComparisonNode findMethodOrProcedure(IComparisonSession session, BslModuleComparisonNode parent, String methodName) 
 - 
findChildNodeByFeaturePathpublic static <T extends ComparisonNode> T findChildNodeByFeaturePath(IComparisonSession session, ComparisonNode nearestTopNode, org.eclipse.emf.ecore.EStructuralFeature... featuresPath) 
 - 
getContainmentNodepublic static <T extends ComparisonNode> T getContainmentNode(IComparisonSession session, String nearestTopNodeSymlink, org.eclipse.emf.ecore.EStructuralFeature... featuresPath) 
 - 
setCorrespondencesAndWaitpublic static void setCorrespondencesAndWait(IComparisonManager comparisonManager, IComparisonSession session, ObjectsTriple<String> correspondence) 
 - 
setMergeRulepublic static void setMergeRule(IComparisonSession session, ComparisonNode node, MergeRule ruleToSet) 
 - 
setOrderSidepublic static void setOrderSide(IComparisonSession session, ComparisonNode node, ComparisonSide orderSideToSet) 
 - 
openV8Projectpublic static IV8Project openV8Project(String projectName, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager, Class<?> sourceClass) throws org.eclipse.core.runtime.CoreException - Throws:
- org.eclipse.core.runtime.CoreException
 
 - 
openV8Projectpublic static IV8Project openV8Project(String projectName, Path sourceRoot, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager) throws org.eclipse.core.runtime.CoreException - Throws:
- org.eclipse.core.runtime.CoreException
 
 - 
openV8ProjectAndDisableAllCheckspublic static IV8Project openV8ProjectAndDisableAllChecks(String projectName, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager, IWorkspaceOrchestrator workspaceOrchestrator, ICheckRepository checkRepository, Class<?> sourceClass) throws org.eclipse.core.runtime.CoreException - Throws:
- org.eclipse.core.runtime.CoreException
 
 - 
openV8ProjectAndDisableAllCheckspublic static IV8Project openV8ProjectAndDisableAllChecks(String projectName, Path sourceRoot, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager, IWorkspaceOrchestrator workspaceOrchestrator, ICheckRepository checkRepository) throws org.eclipse.core.runtime.CoreException - Throws:
- org.eclipse.core.runtime.CoreException
 
 - 
createV8ProjectDescriptorpublic static V8ProjectComparisonDataSourceDescriptor createV8ProjectDescriptor(String projectName, TestingWorkspace testingWorkspace, IV8ProjectManager projectManager, Class<?> sourceClass) throws org.eclipse.core.runtime.CoreException - Throws:
- org.eclipse.core.runtime.CoreException
 
 - 
createV8ProjectDescriptorpublic static V8ProjectComparisonDataSourceDescriptor createV8ProjectDescriptor(IV8Project v8Project) 
 - 
createFileSystemDescriptorpublic static FileSystemComparisonDataSourceDescriptor createFileSystemDescriptor(String projectName, Class<?> sourceClass) throws IOException - Throws:
- IOException
 
 - 
createFileSystemDescriptorpublic static FileSystemComparisonDataSourceDescriptor createFileSystemDescriptor(String folderName, String deltaBaseProjectName, Class<?> sourceClass) throws IOException - Throws:
- IOException
 
 - 
createGitDescriptorpublic static GitComparisonDataSourceDescriptor createGitDescriptor(File workTree, String projectPathInRepo, String revision) throws IOException - Throws:
- IOException
 
 - 
getTopLevelObjectpublic static org.eclipse.emf.ecore.EObject getTopLevelObject(String symlink, IV8Project v8Project, IBmModelManager bmModelManager) 
 - 
getFileListRecursivelypublic static List<Path> getFileListRecursively(IV8Project project, Path path) Returns all files in given folder and subfolders.- Parameters:
- project- the project path belongs to, cannot be- null
- path- folder path, where to search for files, cannot be- null
- Returns:
- all files in given folder and subfolders
 
 - 
createComparisonBatchForLibraryIntegrationpublic static CompareMergeProcessBatch createComparisonBatchForLibraryIntegration(String integrationSettingsName, MatchingStrategy matchingStrategy, boolean mainSideObjectsDeletionAllowed, ComparisonProcessHandle... handles) Creates comparison batch for the library integration process- Parameters:
- integrationSettingsName- The name of the integration settings. The corresponding file should be present in the target configuration. May not be- null
- matchingStrategy- The matching strategy. May not be- null
- mainSideObjectsDeletionAllowed- The main side removal allowance flag
- handles- The comparison process handle set. May not be- nullor empty
- Returns:
- The comparison process batch. May not be null
 
 - 
createDataSourceDescriptorpublic static IComparisonDataSourceDescriptor createDataSourceDescriptor(IV8Project v8Project, DataSourceType type, Class<?> sourceClass) Creates comparison data source descriptor.- Parameters:
- v8Project- V8 project, cannot be- null
- type- data source type, cannot be- null
- sourceClass- the source class, cannot be- null
- Returns:
- reference to {link IComparisonDataSourceDescriptor} for selected DataSourceType, nevernull
 
 - 
addCatalogAndWaitpublic static void addCatalogAndWait(String catalogSymlink, IComparisonSession session, IComparisonManager comparisonManager, IV8ProjectManager v8ProjectManager, IWorkspaceOrchestrator workspaceOrchestrator) Adds new Catalog object into the MAIN DT project under the active comparison session.- Parameters:
- catalogSymlink- the symlink of the catalog to be added, cannot be- nullor empty
- session- the active comparison session, cannot be- null
- comparisonManager- the comparison manager, cannot be- null
- v8ProjectManager- the V8 project manager, cannot be- null
- workspaceOrchestrator- the workspace orchestrator, cannot be- null
 
 - 
addEnumAndWaitpublic static void addEnumAndWait(String enumSymlink, IComparisonSession session, IComparisonManager comparisonManager, IV8ProjectManager v8ProjectManager, IWorkspaceOrchestrator workspaceOrchestrator) Adds new Enum object into the MAIN DT project under the active comparison session.- Parameters:
- enumSymlink- the symlink of the enum to be added, cannot be- nullor empty
- session- the active comparison session, cannot be- null
- comparisonManager- the comparison manager, cannot be- null
- v8ProjectManager- the V8 project manager, cannot be- null
- workspaceOrchestrator- the workspace orchestrator, cannot be- null
 
 - 
prepareGitRepopublic static org.eclipse.jgit.lib.Repository prepareGitRepo(String commitId, File workTree) throws Exception Creates a repository matching the parameters passed.- Parameters:
- commitId- commit id to reset repository to, cannot be- null
- workTree- top level directory of the working files, cannor be- null
- Returns:
- reposity repository matching parameters passed, cannot be null
- Throws:
- Exception- if an error occurred while configuring the repository
 
 - 
resetContentpublic static void resetContent(org.eclipse.jgit.api.Git git, String commitId) throws ExceptionResets HARD the given git repository to the specified commit.- Parameters:
- git- git object, cannot be- null
- commitId- commit to reset to, cannot be- null
- Throws:
- Exception- if an error occurred while execute reset command.
 
 - 
createEObjectTriepublic static EObjectTrie createEObjectTrie(String... symlinks) CreatesEObjectTriefor the given collection of symlinks.- Parameters:
- symlinks- the collection of symlinks to create- EObjectTriefor, cannot be- null
- Returns:
- the EObjectTriefor the given collection of symlinks, nevernull
 
 - 
getQualifiedNamepublic static org.eclipse.xtext.naming.QualifiedName getQualifiedName(String symlink) Returns the qualified name for the given symlink.- Parameters:
- symlink- the symlink to get the qualified name for, cannot be- null
- Returns:
- the qualified name, never null
 
 
- 
 
-