use of com.oxygenxml.git.view.staging.ChangesPanel.SelectedResourcesProvider in project oxygen-git-client-addon by oxygenxml.
the class GitViewResourceContextualMenuActionsTest method testActionsEnablingState_17.
/**
* <p><b>Description:</b> test the enabling state of the actions
* from the contextual menu of the unstaged resources.</p>
* <p><b>Bug ID:</b> EXM-40615</p>
*
* @author sorin_carbunaru
*
* @throws Exception
*/
public void testActionsEnablingState_17() throws Exception {
GitResourceContextualMenu menu = new GitResourceContextualMenu(new SelectedResourcesProvider() {
@Override
public List<FileStatus> getOnlySelectedLeaves() {
return getAllSelectedResources();
}
@Override
public List<FileStatus> getAllSelectedResources() {
List<FileStatus> fileStatuses = new ArrayList<>();
fileStatuses.add(new FileStatus(GitChangeType.MODIFIED, "test2.xml"));
return fileStatuses;
}
}, gitCtrl, null, // For unstaged resources
false, Optional.of(RepositoryState.SAFE));
assertEquals("\n" + "Open_In_Compare [ENABLED]\n" + "Open [ENABLED]\n" + "----\n" + "Stage [ENABLED]\n" + "Resolve_Conflict [DISABLED]\n" + " Open_In_Compare [ENABLED]\n" + " ----\n" + " Resolve_Using_Mine [DISABLED]\n" + " Resolve_Using_Theirs [DISABLED]\n" + " Mark_Resolved [DISABLED]\n" + " ----\n" + " Restart_Merge [DISABLED]\n" + "Discard [ENABLED]\n" + "----\n" + "Show_history [ENABLED]\n" + "Show_blame [ENABLED]", PopupMenuSerializer.serializePopupStructure(menu, true, true));
}
use of com.oxygenxml.git.view.staging.ChangesPanel.SelectedResourcesProvider in project oxygen-git-client-addon by oxygenxml.
the class GitViewResourceContextualMenuActionsTest method testActionsEnablingState_19.
/**
* <p><b>Description:</b> test the enabling state of the actions
* from the contextual menu of the staged resources.</p>
* <p><b>Bug ID:</b> EXM-40615</p>
*
* @author sorin_carbunaru
*
* @throws Exception
*/
public void testActionsEnablingState_19() throws Exception {
GitResourceContextualMenu menu = new GitResourceContextualMenu(new SelectedResourcesProvider() {
@Override
public List<FileStatus> getOnlySelectedLeaves() {
return getAllSelectedResources();
}
@Override
public List<FileStatus> getAllSelectedResources() {
List<FileStatus> fileStatuses = new ArrayList<>();
fileStatuses.add(new FileStatus(GitChangeType.CHANGED, "test.xml"));
fileStatuses.add(new FileStatus(GitChangeType.CHANGED, "test2.xml"));
return fileStatuses;
}
}, gitCtrl, null, // For staged resources
true, Optional.of(RepositoryState.SAFE));
assertEquals("\n" + "Open_In_Compare [DISABLED]\n" + "Open [ENABLED]\n" + "----\n" + "Unstage [ENABLED]\n" + "Resolve_Conflict [DISABLED]\n" + " Open_In_Compare [DISABLED]\n" + " ----\n" + " Resolve_Using_Mine [DISABLED]\n" + " Resolve_Using_Theirs [DISABLED]\n" + " Mark_Resolved [DISABLED]\n" + " ----\n" + " Restart_Merge [DISABLED]\n" + "Discard [ENABLED]", PopupMenuSerializer.serializePopupStructure(menu, true, true));
}
use of com.oxygenxml.git.view.staging.ChangesPanel.SelectedResourcesProvider in project oxygen-git-client-addon by oxygenxml.
the class GitViewResourceContextualMenuActionsTest method testActionsEnablingState_14.
/**
* <p><b>Description:</b> test the enabling state of the actions
* from the contextual menu of the unstaged resources.</p>
* <p><b>Bug ID:</b> EXM-40615</p>
*
* @author sorin_carbunaru
*
* @throws Exception
*/
public void testActionsEnablingState_14() throws Exception {
GitResourceContextualMenu menu = new GitResourceContextualMenu(new SelectedResourcesProvider() {
@Override
public List<FileStatus> getOnlySelectedLeaves() {
return getAllSelectedResources();
}
@Override
public List<FileStatus> getAllSelectedResources() {
List<FileStatus> fileStatuses = new ArrayList<>();
fileStatuses.add(new FileStatus(GitChangeType.UNTRACKED, "test.xml"));
return fileStatuses;
}
}, gitCtrl, null, // For unstaged resources
false, Optional.of(RepositoryState.SAFE));
assertEquals("\n" + "Open_In_Compare [ENABLED]\n" + "Open [ENABLED]\n" + "----\n" + "Stage [ENABLED]\n" + "Resolve_Conflict [DISABLED]\n" + " Open_In_Compare [ENABLED]\n" + " ----\n" + " Resolve_Using_Mine [DISABLED]\n" + " Resolve_Using_Theirs [DISABLED]\n" + " Mark_Resolved [DISABLED]\n" + " ----\n" + " Restart_Merge [DISABLED]\n" + "Discard [ENABLED]\n" + "----\n" + "Show_history [DISABLED]\n" + "Show_blame [DISABLED]", PopupMenuSerializer.serializePopupStructure(menu, true, true));
}
use of com.oxygenxml.git.view.staging.ChangesPanel.SelectedResourcesProvider in project oxygen-git-client-addon by oxygenxml.
the class GitViewResourceContextualMenuActionsTest method testActionsEnablingState_7.
/**
* <p><b>Description:</b> test the enabling state of the actions
* from the contextual menu of the staged resources.</p>
* <p><b>Bug ID:</b> EXM-40615</p>
*
* @author sorin_carbunaru
*
* @throws Exception
*/
public void testActionsEnablingState_7() throws Exception {
// Create repositories
String localTestRepository = "target/test-resources/testActionsEnabling7_local";
String remoteTestRepository = "target/test-resources/testActionsEnabling7_remote";
Repository remoteRepo = createRepository(remoteTestRepository);
Repository localRepo = createRepository(localTestRepository);
// Bind the local repository to the remote one.
bindLocalToRemote(localRepo, remoteRepo);
GitResourceContextualMenu menu = new GitResourceContextualMenu(new SelectedResourcesProvider() {
@Override
public List<FileStatus> getOnlySelectedLeaves() {
return getAllSelectedResources();
}
@Override
public List<FileStatus> getAllSelectedResources() {
List<FileStatus> fileStatuses = new ArrayList<>();
fileStatuses.add(new FileStatus(GitChangeType.CONFLICT, "test.xml"));
fileStatuses.add(new FileStatus(GitChangeType.ADD, "test2.xml"));
return fileStatuses;
}
}, gitCtrl, null, // For staged resources
true, // In merging state
Optional.of(RepositoryState.MERGING));
assertEquals("\n" + "Open_In_Compare [DISABLED]\n" + "Open [ENABLED]\n" + "----\n" + "Unstage [DISABLED]\n" + "Resolve_Conflict [ENABLED]\n" + " Open_In_Compare [DISABLED]\n" + " ----\n" + " Resolve_Using_Mine [DISABLED]\n" + " Resolve_Using_Theirs [DISABLED]\n" + " Mark_Resolved [DISABLED]\n" + " ----\n" + " Restart_Merge [ENABLED]\n" + "Discard [DISABLED]", PopupMenuSerializer.serializePopupStructure(menu, true, true));
}
use of com.oxygenxml.git.view.staging.ChangesPanel.SelectedResourcesProvider in project oxygen-git-client-addon by oxygenxml.
the class GitViewResourceContextualMenuActionsTest method testActionsEnablingState_15.
/**
* <p><b>Description:</b> test the enabling state of the actions
* from the contextual menu of the unstaged resources.</p>
* <p><b>Bug ID:</b> EXM-40615</p>
*
* @author sorin_carbunaru
*
* @throws Exception
*/
public void testActionsEnablingState_15() throws Exception {
GitResourceContextualMenu menu = new GitResourceContextualMenu(new SelectedResourcesProvider() {
@Override
public List<FileStatus> getOnlySelectedLeaves() {
return getAllSelectedResources();
}
@Override
public List<FileStatus> getAllSelectedResources() {
List<FileStatus> fileStatuses = new ArrayList<>();
fileStatuses.add(new FileStatus(GitChangeType.UNTRACKED, "test.xml"));
fileStatuses.add(new FileStatus(GitChangeType.UNTRACKED, "test2.xml"));
return fileStatuses;
}
}, gitCtrl, null, // For unstaged resources
false, Optional.of(RepositoryState.SAFE));
assertEquals("\n" + "Open_In_Compare [DISABLED]\n" + "Open [ENABLED]\n" + "----\n" + "Stage [ENABLED]\n" + "Resolve_Conflict [DISABLED]\n" + " Open_In_Compare [DISABLED]\n" + " ----\n" + " Resolve_Using_Mine [DISABLED]\n" + " Resolve_Using_Theirs [DISABLED]\n" + " Mark_Resolved [DISABLED]\n" + " ----\n" + " Restart_Merge [DISABLED]\n" + "Discard [ENABLED]\n" + "----\n" + "Show_history [DISABLED]\n" + "Show_blame [DISABLED]", PopupMenuSerializer.serializePopupStructure(menu, true, true));
}
Aggregations