use of com.avaloq.tools.ddk.xtext.ui.quickfix.WorkbenchMarkerResolutionGenerator.WorkbenchResolutionAdapter in project dsl-devkit by dsldevkit.
the class WorkbenchResolutionAdaptorRunTest method testRun.
@Test
public void testRun() throws CoreException {
adapter = wmrg.new WorkbenchResolutionAdapter(mockIssueResolution, mockMarker);
when(mockMarkerHelpRegistry.getResolutions(mockMarker)).thenReturn(mockMarkerResolutions);
// $NON-NLS-1$
mockMarkerResource(URI.createURI("platform://dummy/" + TEST_FILE_NAME));
/* Test call */
adapter.run(mockMarker);
// Resolution is applied
verify(mockIssueResolution, times(1)).apply();
}
use of com.avaloq.tools.ddk.xtext.ui.quickfix.WorkbenchMarkerResolutionGenerator.WorkbenchResolutionAdapter in project dsl-devkit by dsldevkit.
the class WorkbenchResolutionAdaptorRunTest method testSingleRun.
@Test
public void testSingleRun() throws CoreException {
adapter = wmrg.new WorkbenchResolutionAdapter(mockIssueResolution, mockMarker);
when(mockMarkerHelpRegistry.getResolutions(mockMarker)).thenReturn(mockMarkerResolutions);
// $NON-NLS-1$
mockMarkerResource(URI.createURI("platform://dummy/" + TEST_FILE_NAME));
/* Test call */
adapter.run(new IMarker[] { mockMarker }, null);
verify(mockIssueResolution, times(1)).apply();
}
use of com.avaloq.tools.ddk.xtext.ui.quickfix.WorkbenchMarkerResolutionGenerator.WorkbenchResolutionAdapter in project dsl-devkit by dsldevkit.
the class WorkbenchResolutionAdaptorTest method testGetDescription.
@Test
public void testGetDescription() {
IssueResolution mockIssueResolution = mock(IssueResolution.class);
IMarker mockMarker = mock(IMarker.class);
when(mockIssueResolution.getDescription()).thenReturn(TEST_DESCRIPTION);
WorkbenchResolutionAdapter adapter = mockWmrg.new WorkbenchResolutionAdapter(mockIssueResolution, mockMarker);
// $NON-NLS-1$
assertEquals("Adapter delegates get description to resolution.", TEST_DESCRIPTION, adapter.getDescription());
}
use of com.avaloq.tools.ddk.xtext.ui.quickfix.WorkbenchMarkerResolutionGenerator.WorkbenchResolutionAdapter in project dsl-devkit by dsldevkit.
the class WorkbenchResolutionAdaptorRunTest method setUp.
@Before
public void setUp() throws Exception {
wmrg.setIssueUtil(new IssueUtil());
when(mockRegistryProvider.get()).thenReturn(mockMarkerHelpRegistry);
mockIssueResolution = mock(IssueResolution.class);
mockMarker = mock(IMarker.class);
IMarkerResolution mockMarkerResolution = wmrg.new WorkbenchResolutionAdapter(mockIssueResolution, mockMarker);
mockMarkerResolutions = new IMarkerResolution[] { mockMarkerResolution };
mockFile = mock(IFile.class);
when(mockIssueResolutionProvider.getResolutions(Matchers.any(Issue.class))).thenReturn(Lists.newArrayList(mockIssueResolution));
}
use of com.avaloq.tools.ddk.xtext.ui.quickfix.WorkbenchMarkerResolutionGenerator.WorkbenchResolutionAdapter in project dsl-devkit by dsldevkit.
the class WorkbenchResolutionAdaptorTest method testGetImage.
@Test
public void testGetImage() {
IssueResolution mockIssueResolution = mock(IssueResolution.class);
IMarker mockMarker = mock(IMarker.class);
when(mockWmrg.getImage(mockIssueResolution)).thenReturn(TEST_IMAGE);
WorkbenchResolutionAdapter adapter = mockWmrg.new WorkbenchResolutionAdapter(mockIssueResolution, mockMarker);
// $NON-NLS-1$
assertEquals("Adapter delegates get Image to resolution.", TEST_IMAGE, adapter.getImage());
}
Aggregations