/* (non-Javadoc) * @see org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut#createConfiguration(org.eclipse.jdt.core.IType) */ @Override protected ILaunchConfiguration createConfiguration(IType type) { ILaunchConfiguration config = null; ILaunchConfigurationWorkingCopy wc = null; try { ILaunchConfigurationType configType = getConfigurationType(); wc = configType.newInstance( null, getLaunchManager().generateLaunchConfigurationName(type.getTypeQualifiedName('.'))); // wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, // type.getFullyQualifiedName()); wc.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, type.getJavaProject().getElementName()); wc.setMappedResources(new IResource[] {type.getUnderlyingResource()}); config = wc.doSave(); } catch (CoreException exception) { MessageDialog.openError( JDIDebugUIPlugin.getActiveWorkbenchShell(), LauncherMessages.JavaLaunchShortcut_3, exception.getStatus().getMessage()); } return config; }
public void testMissingMethod() { try { IType type = fProject.findType("tests.apiusescan.coretestproject.ITestInterface"); IMethod method = type.getMethods()[0]; method.rename("performTask1", true, null); ExternalDependencyTestUtils.waitForBuild(); IMarker[] markers = type.getUnderlyingResource() .findMarkers( IApiMarkerConstants.API_USESCAN_PROBLEM_MARKER, false, IResource.DEPTH_ZERO); assertEquals( "No API Use Scan problem marker found for missing method ITestInterface.performTask()", 1, markers.length); String typeName = markers[0].getAttribute(IApiMarkerConstants.API_USESCAN_TYPE, null); assertEquals( "Marker for missing method ITestInterface.performTask() not found", "tests.apiusescan.coretestproject.ITestInterface", typeName); type = fProject.findType("tests.apiusescan.coretestproject.ITestInterface"); method = type.getMethods()[0]; method.rename("performTask", true, null); ExternalDependencyTestUtils.waitForBuild(); markers = type.getUnderlyingResource() .findMarkers( IApiMarkerConstants.API_USESCAN_PROBLEM_MARKER, false, IResource.DEPTH_ZERO); assertEquals( "API Use Scan problem marker for missing method ITestInterface.performTask() did not clear.", 0, markers.length); } catch (JavaModelException e) { fail(e.getMessage()); } catch (CoreException e) { fail(e.getMessage()); } }