本文整理汇总了Java中org.eclipse.debug.core.ILaunchManager.RUN_MODE属性的典型用法代码示例。如果您正苦于以下问题:Java ILaunchManager.RUN_MODE属性的具体用法?Java ILaunchManager.RUN_MODE怎么用?Java ILaunchManager.RUN_MODE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.debug.core.ILaunchManager
的用法示例。
在下文中一共展示了ILaunchManager.RUN_MODE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPreLaunchWithNullRunTestViewAndSuperReturnsFalse
@Test
public void testPreLaunchWithNullRunTestViewAndSuperReturnsFalse() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(null);
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(false);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
assertFalse(prelaunchResult);
}
示例2: testPreLaunchWithNullRunTestViewAndSuperReturnsTrue
@Test
public void testPreLaunchWithNullRunTestViewAndSuperReturnsTrue() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(null);
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(true);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
assertTrue(prelaunchResult);
}
示例3: testPreLaunchWithExistingRun
@Test
public void testPreLaunchWithExistingRun() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
RunTestsView runTestsView = mock(RunTestsView.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
when(runTestsView.canRun()).thenReturn(false);
doNothing().when(mockedDelegate).throwErrorMsg(any(String.class));
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(true);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
verify(mockedDelegate, times(1)).getRunTestView();
verify(mockedDelegate, times(1)).throwErrorMsg(Messages.LaunchDelegate_CannotLaunchAnotherConfig);
assertTrue(prelaunchResult);
}
示例4: getVMRunner
public IVMRunner getVMRunner( ILaunchConfiguration configuration,
String mode ) throws CoreException
{
if ( ( helper.debugType & DEBUG_TYPE_JAVA_CLASS ) == DEBUG_TYPE_JAVA_CLASS )
{
mode = ILaunchManager.DEBUG_MODE;
}
else
{
mode = ILaunchManager.RUN_MODE;
}
return new ReportDebuggerVMRunner( super.getVMRunner( configuration,
mode ),
( helper.debugType & DEBUG_TYPE_JAVA_SCRIPT ) == DEBUG_TYPE_JAVA_SCRIPT,
this );
}
示例5: runVM
/**
* @param label
* @param classToLaunch
* @param classpath
* @param bootClasspath
* @param vmArgs
* @param prgArgs
* @param workDir
* @param sourceLocator
* @param debug
* @param showInDebugger
* @throws CoreException
*/
public void runVM(final String label, final String classToLaunch, final String[] classpath, final String[] bootClasspath, final String[] vmArgs,
final String[] prgArgs, final String workDir, final ISourceLocator sourceLocator, final boolean debug, final boolean showInDebugger)
throws CoreException {
final IVMInstall vmInstall = this.getVMInstall();
String mode = ILaunchManager.DEBUG_MODE;
if (debug && classToLaunch.equals(WEBLOGIC_MAIN_CLASS)) {
mode = ILaunchManager.DEBUG_MODE;
} else {
mode = ILaunchManager.RUN_MODE;
}
final IVMRunner vmRunner = vmInstall.getVMRunner(mode);
final ILaunchConfigurationType launchType = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
final ILaunchConfigurationWorkingCopy config = launchType.newInstance(null, label);
config.setAttribute(IDebugUIConstants.ATTR_PRIVATE, true);
config.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector");
DebugUITools.setLaunchPerspective(launchType, mode, IDebugUIConstants.PERSPECTIVE_DEFAULT);
final Launch launch = new Launch(config, mode, sourceLocator);
config.doSave();
if (vmRunner != null) {
final VMRunnerConfiguration vmConfig = new VMRunnerConfiguration(classToLaunch, classpath);
vmConfig.setVMArguments(vmArgs);
vmConfig.setProgramArguments(prgArgs);
if (workDir != null) {
vmConfig.setWorkingDirectory(workDir);
}
if (bootClasspath.length == 0) {
vmConfig.setBootClassPath(null);
} else {
vmConfig.setBootClassPath(bootClasspath);
}
vmRunner.run(vmConfig, launch, null);
}
if (showInDebugger) {
DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
}
}
示例6: getInterpreterRunner
public IInterpreterRunner getInterpreterRunner(String mode) {
IInterpreterRunner runner = super.getInterpreterRunner(mode);
if (runner != null)
return runner;
switch (mode) {
case ILaunchManager.RUN_MODE:
return new JuliaInterpreterRunner(this);
default:
return null;
}
}
示例7: getVMRunner
@Override
public IVMRunner getVMRunner(final ILaunchConfiguration configuration, final String mode) throws CoreException {
if(ILaunchManager.PROFILE_MODE.equals(mode)) {
// TODO: Figure out how to setup profiling
return super.getVMRunner(configuration, ILaunchManager.RUN_MODE);
}
return super.getVMRunner(configuration, mode);
}
示例8: testCheckRunMode
@Test
public void testCheckRunMode() throws Exception {
String mode = ILaunchManager.RUN_MODE;
doCallRealMethod().when(mockedDelegate).checkMode(mode);
mockedDelegate.checkMode(mode);
verify(mockedDelegate, never()).throwErrorMsg(any(String.class));
}
示例9: testPreLaunchAsyncWithDebugUserContinues
@Test
public void testPreLaunchAsyncWithDebugUserContinues() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
RunTestsView runTestsView = mock(RunTestsView.class);
IProject project = mock(IProject.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
when(runTestsView.canRun()).thenReturn(true);
when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
when(mockedDelegate.getTestMode(configuration)).thenReturn(true);
when(mockedDelegate.isProjectDebugging(project)).thenReturn(true);
when(mockedDelegate.confirmAsyncTestRunWhileDebugging()).thenReturn(true);
when(mockedDelegate.shouldCreateTraceFlag(configuration)).thenReturn(false);
when(runTestsView.hasExistingTraceFlag(project)).thenReturn(false);
doNothing().when(mockedDelegate).setExistingTraceFlag(configuration, false);
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(true);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
verify(mockedDelegate, times(1)).getRunTestView();
verify(mockedDelegate, times(1)).materializeForceProject(configuration);
verify(mockedDelegate, times(1)).getTestMode(configuration);
verify(mockedDelegate, times(1)).isProjectDebugging(project);
verify(mockedDelegate, times(1)).confirmAsyncTestRunWhileDebugging();
verify(mockedDelegate, never()).reopenLaunchConfig(configuration, mode);
verify(mockedDelegate, never()).getDisplay();
verify(mockedDelegate, never()).confirmExistingTraceFlag();
assertTrue(prelaunchResult);
}
示例10: testPreLaunchAsyncWithDebugUserAborts
@Test
public void testPreLaunchAsyncWithDebugUserAborts() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
RunTestsView runTestsView = mock(RunTestsView.class);
IProject project = mock(IProject.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
when(runTestsView.canRun()).thenReturn(true);
when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
when(mockedDelegate.getTestMode(configuration)).thenReturn(true);
when(mockedDelegate.isProjectDebugging(project)).thenReturn(true);
when(mockedDelegate.confirmAsyncTestRunWhileDebugging()).thenReturn(false);
doNothing().when(mockedDelegate).reopenLaunchConfig(configuration, mode);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
verify(mockedDelegate, times(1)).getRunTestView();
verify(mockedDelegate, times(1)).materializeForceProject(configuration);
verify(mockedDelegate, times(1)).getTestMode(configuration);
verify(mockedDelegate, times(1)).isProjectDebugging(project);
verify(mockedDelegate, times(1)).confirmAsyncTestRunWhileDebugging();
verify(mockedDelegate, times(1)).reopenLaunchConfig(configuration, mode);
verify(mockedDelegate, never()).secondPhasePreLaunchCheck(configuration, mode, monitor);
assertFalse(prelaunchResult);
}
示例11: testPreLaunchAsyncWithoutDebug
@Test
public void testPreLaunchAsyncWithoutDebug() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
RunTestsView runTestsView = mock(RunTestsView.class);
IProject project = mock(IProject.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
when(runTestsView.canRun()).thenReturn(true);
when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
when(mockedDelegate.getTestMode(configuration)).thenReturn(true);
when(mockedDelegate.isProjectDebugging(project)).thenReturn(false);
when(mockedDelegate.shouldCreateTraceFlag(configuration)).thenReturn(false);
when(runTestsView.hasExistingTraceFlag(project)).thenReturn(false);
doNothing().when(mockedDelegate).setExistingTraceFlag(configuration, false);
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(true);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
verify(mockedDelegate, times(1)).getRunTestView();
verify(mockedDelegate, times(1)).materializeForceProject(configuration);
verify(mockedDelegate, times(1)).getTestMode(configuration);
verify(mockedDelegate, times(1)).isProjectDebugging(project);
verify(mockedDelegate, never()).confirmAsyncTestRunWhileDebugging();
verify(mockedDelegate, never()).reopenLaunchConfig(configuration, mode);
verify(mockedDelegate, never()).getDisplay();
assertTrue(prelaunchResult);
}
示例12: testPreLaunchSyncWithDebug
@Test
public void testPreLaunchSyncWithDebug() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
RunTestsView runTestsView = mock(RunTestsView.class);
IProject project = mock(IProject.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
when(runTestsView.canRun()).thenReturn(true);
when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
when(mockedDelegate.getTestMode(configuration)).thenReturn(false);
when(mockedDelegate.isProjectDebugging(project)).thenReturn(true);
when(mockedDelegate.shouldCreateTraceFlag(configuration)).thenReturn(false);
when(runTestsView.hasExistingTraceFlag(project)).thenReturn(false);
doNothing().when(mockedDelegate).setExistingTraceFlag(configuration, false);
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(true);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
verify(mockedDelegate, times(1)).getRunTestView();
verify(mockedDelegate, times(1)).materializeForceProject(configuration);
verify(mockedDelegate, times(1)).getTestMode(configuration);
verify(mockedDelegate, times(1)).isProjectDebugging(project);
verify(mockedDelegate, never()).confirmAsyncTestRunWhileDebugging();
verify(mockedDelegate, never()).reopenLaunchConfig(configuration, mode);
verify(mockedDelegate, never()).getDisplay();
assertTrue(prelaunchResult);
}
示例13: testPreLaunchSyncWithoutDebug
@Test
public void testPreLaunchSyncWithoutDebug() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
RunTestsView runTestsView = mock(RunTestsView.class);
IProject project = mock(IProject.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
when(runTestsView.canRun()).thenReturn(true);
when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
when(mockedDelegate.getTestMode(configuration)).thenReturn(false);
when(mockedDelegate.isProjectDebugging(project)).thenReturn(false);
when(mockedDelegate.shouldCreateTraceFlag(configuration)).thenReturn(false);
when(runTestsView.hasExistingTraceFlag(project)).thenReturn(false);
doNothing().when(mockedDelegate).setExistingTraceFlag(configuration, false);
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(true);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
verify(mockedDelegate, times(1)).getRunTestView();
verify(mockedDelegate, times(1)).materializeForceProject(configuration);
verify(mockedDelegate, times(1)).getTestMode(configuration);
verify(mockedDelegate, times(1)).isProjectDebugging(project);
verify(mockedDelegate, never()).confirmAsyncTestRunWhileDebugging();
verify(mockedDelegate, never()).reopenLaunchConfig(configuration, mode);
verify(mockedDelegate, never()).getDisplay();
assertTrue(prelaunchResult);
}
示例14: testPreLaunchWithoutLogging
@Test
public void testPreLaunchWithoutLogging() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
RunTestsView runTestsView = mock(RunTestsView.class);
IProject project = mock(IProject.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
when(runTestsView.canRun()).thenReturn(true);
when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
when(mockedDelegate.getTestMode(configuration)).thenReturn(false);
when(mockedDelegate.isProjectDebugging(project)).thenReturn(false);
when(mockedDelegate.shouldCreateTraceFlag(configuration)).thenReturn(false);
when(runTestsView.hasExistingTraceFlag(project)).thenReturn(false);
doNothing().when(mockedDelegate).setExistingTraceFlag(configuration, false);
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(true);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
verify(mockedDelegate, times(1)).getRunTestView();
verify(mockedDelegate, times(1)).materializeForceProject(configuration);
verify(mockedDelegate, times(1)).getTestMode(configuration);
verify(mockedDelegate, times(1)).isProjectDebugging(project);
verify(mockedDelegate, times(1)).shouldCreateTraceFlag(configuration);
verify(runTestsView, times(1)).hasExistingTraceFlag(project);
verify(mockedDelegate, never()).confirmAsyncTestRunWhileDebugging();
verify(mockedDelegate, never()).reopenLaunchConfig(configuration, mode);
verify(mockedDelegate, never()).getDisplay();
verify(mockedDelegate, never()).confirmExistingTraceFlag();
assertTrue(prelaunchResult);
}
示例15: testPreLaunchWithLoggingWithoutExistingTraceflag
@Test
public void testPreLaunchWithLoggingWithoutExistingTraceflag() throws Exception {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String mode = ILaunchManager.RUN_MODE;
IProgressMonitor monitor = mock(IProgressMonitor.class);
RunTestsView runTestsView = mock(RunTestsView.class);
IProject project = mock(IProject.class);
doCallRealMethod().when(mockedDelegate).preLaunchCheck(configuration, mode, monitor);
doNothing().when(mockedDelegate).checkMode(mode);
when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
when(runTestsView.canRun()).thenReturn(true);
when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
when(mockedDelegate.getTestMode(configuration)).thenReturn(false);
when(mockedDelegate.isProjectDebugging(project)).thenReturn(false);
when(mockedDelegate.shouldCreateTraceFlag(configuration)).thenReturn(true);
when(runTestsView.hasExistingTraceFlag(project)).thenReturn(false);
when(mockedDelegate.secondPhasePreLaunchCheck(configuration, mode, monitor)).thenReturn(true);
boolean prelaunchResult = mockedDelegate.preLaunchCheck(configuration, mode, monitor);
verify(mockedDelegate, times(1)).checkMode(mode);
verify(mockedDelegate, times(1)).getRunTestView();
verify(mockedDelegate, times(1)).materializeForceProject(configuration);
verify(mockedDelegate, times(1)).getTestMode(configuration);
verify(mockedDelegate, times(1)).isProjectDebugging(project);
verify(mockedDelegate, times(1)).shouldCreateTraceFlag(configuration);
verify(runTestsView, times(1)).hasExistingTraceFlag(project);
verify(mockedDelegate, never()).confirmAsyncTestRunWhileDebugging();
verify(mockedDelegate, never()).reopenLaunchConfig(configuration, mode);
verify(mockedDelegate, never()).getDisplay();
verify(mockedDelegate, never()).confirmExistingTraceFlag();
assertTrue(prelaunchResult);
}