本文整理汇总了Java中org.eclipse.debug.core.ILaunch类的典型用法代码示例。如果您正苦于以下问题:Java ILaunch类的具体用法?Java ILaunch怎么用?Java ILaunch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ILaunch类属于org.eclipse.debug.core包,在下文中一共展示了ILaunch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DSPDebugTarget
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
public DSPDebugTarget(ILaunch launch, Process process, InputStream in, OutputStream out,
Map<String, Object> launchArguments) throws CoreException {
super(null);
this.launch = launch;
this.process = process;
DebugLauncher<IDebugProtocolServer> debugProtocolLauncher = DebugLauncher.createLauncher(this,
IDebugProtocolServer.class, in, out, true, new PrintWriter(System.out));
debugProtocolFuture = debugProtocolLauncher.startListening();
debugProtocolServer = debugProtocolLauncher.getRemoteProxy();
complete(debugProtocolServer.initialize(new InitializeRequestArguments().setClientID("lsp4e")
.setAdapterID((String) launchArguments.get("type")).setPathFormat("path")));
Object object = launchArguments.get("program");
targetName = Objects.toString(object, "Debug Adapter Target");
complete(debugProtocolServer.launch(Either.forLeft(launchArguments)));
complete(debugProtocolServer.configurationDone());
IBreakpointManager breakpointManager = getBreakpointManager();
breakpointManager.addBreakpointListener(this);
breakpointManager.addBreakpointManagerListener(this);
breakpointManagerEnablementChanged(breakpointManager.isEnabled());
}
示例2: appendAdditionalLaunchParameters
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Override
protected void appendAdditionalLaunchParameters(LaunchParameterValues launchParameterValues) {
ILaunch launch = launchParameterValues.getLaunch();
if (launch==null){
throw new IllegalStateException("launch missing");
}
String projectName;
try {
ILaunchConfiguration configuration = launch.getLaunchConfiguration();
projectName = configuration.getAttribute(PROPERTY_PROJECTNAME, (String)null);
String configuredTasksValue= configuration.getAttribute(PROPERTY_TASKS, "");
String tasksToExecute = variableReplacement.replace(configuredTasksValue, JUNIT_PREFERENCES.getDefaultTestTaskType().getTestTasks());
launchParameterValues.setPostJob(new ImportGradleJunitResultsJob("Import gradle junit results",projectName,true));
launchParameterValues.setOverriddenTasks(tasksToExecute);
} catch (CoreException e) {
JunitUtil.logError("Was not able to add additional launch parameters", e);
}
}
示例3: testRemoveSessionsFor1
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Test
public void testRemoveSessionsFor1() {
ILaunch launch0 = new Launch(null, null, null);
ILaunch launch1 = new Launch(null, null, null);
ICoverageSession s0 = new DummySession();
ICoverageSession s1 = new DummySession();
manager.addSession(s0, false, launch0);
manager.addSession(s1, true, launch1);
listener.clear();
manager.removeSessionsFor(launch1);
assertEquals(Arrays.asList(s0), manager.getSessions());
assertSame(s0, manager.getActiveSession());
reflistener.sessionRemoved(s1);
reflistener.sessionActivated(s0);
assertEquals(reflistener, listener);
}
示例4: testRemoveSessionsFor2
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Test
public void testRemoveSessionsFor2() {
ILaunch launch0 = new Launch(null, null, null);
ILaunch launch1 = new Launch(null, null, null);
ILaunch launch2 = new Launch(null, null, null);
ICoverageSession s0 = new DummySession();
ICoverageSession s1 = new DummySession();
manager.addSession(s0, false, launch0);
manager.addSession(s1, true, launch1);
listener.clear();
manager.removeSessionsFor(launch2);
assertEquals(Arrays.asList(s0, s1), manager.getSessions());
assertSame(s1, manager.getActiveSession());
assertEquals(reflistener, listener);
}
示例5: testRemoveSessionsFor3
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Test
public void testRemoveSessionsFor3() {
ILaunch launch0 = new Launch(null, null, null);
ILaunch launch1 = new Launch(null, null, null);
ICoverageSession s0 = new DummySession();
ICoverageSession s1 = new DummySession();
ICoverageSession s2 = new DummySession();
manager.addSession(s0, true, launch0);
manager.addSession(s1, true, launch1);
manager.addSession(s2, true, launch1);
listener.clear();
manager.removeSessionsFor(launch1);
assertEquals(Arrays.asList(s0), manager.getSessions());
assertSame(s0, manager.getActiveSession());
reflistener.sessionRemoved(s1);
reflistener.sessionRemoved(s2);
reflistener.sessionActivated(s0);
assertEquals(reflistener, listener);
}
示例6: getLaunchText
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
public static String getLaunchText(ILaunch launch) {
// new launch configuration
final ILaunchConfiguration config = launch.getLaunchConfiguration();
if (config == null) {
return UIMessages.DumpExecutionDataUnknownLaunch_value;
}
StringBuilder sb = new StringBuilder(config.getName());
sb.append(" ["); //$NON-NLS-1$
try {
sb.append(config.getType().getName());
} catch (CoreException e) {
EclEmmaUIPlugin.log(e);
}
sb.append("]"); //$NON-NLS-1$
return sb.toString();
}
示例7: addSession
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
public void addSession(ICoverageSession session, boolean activate,
ILaunch launch) {
synchronized (lock) {
if (session == null) {
throw new IllegalArgumentException();
}
if (!sessions.contains(session)) {
sessions.add(session);
if (launch != null) {
List<ICoverageSession> l = launchmap.get(launch);
if (l == null) {
l = new ArrayList<ICoverageSession>();
launchmap.put(launch, l);
}
l.add(session);
}
fireSessionAdded(session);
}
if (activate) {
activeSession = session;
fireSessionActivated(session);
}
}
}
示例8: getRunningCoverageLaunches
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
/**
* Determines all current coverage launches which are running.
*
* @return list of running coverage launches
*/
public static List<ICoverageLaunch> getRunningCoverageLaunches() {
final List<ICoverageLaunch> result = new ArrayList<ICoverageLaunch>();
for (final ILaunch launch : DebugPlugin.getDefault().getLaunchManager()
.getLaunches()) {
if (launch instanceof ICoverageLaunch && !launch.isTerminated()) {
result.add((ICoverageLaunch) launch);
}
}
return result;
}
示例9: testLaunchWithProjectThatDoesNotExistThrowsIllegalArgumentException
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Test
public void testLaunchWithProjectThatDoesNotExistThrowsIllegalArgumentException()
throws CoreException {
ILaunchConfiguration configuration = mockILaunchConfiguration();
when(project.exists()).thenReturn(false);
String mode = "run";
ILaunch launch = mock(ILaunch.class);
try {
dataflowDelegate.launch(configuration, mode, launch, monitor);
fail();
} catch (IllegalArgumentException ex) {
assertTrue(
ex.getMessage().contains("Project with name Test-project,Name must exist to launch."));
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:18,代码来源:DataflowPipelineLaunchDelegateTest.java
示例10: testLaunchWithValidLaunchConfigurationCreatesJsonCredential
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Test
public void testLaunchWithValidLaunchConfigurationCreatesJsonCredential() throws CoreException {
ILaunchConfiguration configuration = mockILaunchConfiguration();
when(configuration.getAttribute(
"com.google.cloud.dataflow.eclipse.ALL_ARGUMENT_VALUES", new HashMap<String, String>()))
.thenReturn(ImmutableMap.of("accountEmail", "[email protected]"));
Map<String, String> environmentVariables = new HashMap<>();
ILaunchConfigurationWorkingCopy expectedConfiguration =
mockILaunchConfigurationWorkingCopy(environmentVariables);
when(configuration.copy("dataflow_tmp_config_working_copy-testConfiguration"))
.thenReturn(expectedConfiguration);
WritableDataflowPreferences globalPreferences = WritableDataflowPreferences.global();
globalPreferences.setDefaultAccountEmail("[email protected]");
globalPreferences.save();
dataflowDelegate.launch(configuration, "run" /* mode */, mock(ILaunch.class), monitor);
String jsonCredentialPath = environmentVariables.get("GOOGLE_APPLICATION_CREDENTIALS");
assertNotNull(jsonCredentialPath);
assertTrue(Files.exists(Paths.get(jsonCredentialPath)));
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:24,代码来源:DataflowPipelineLaunchDelegateTest.java
示例11: waitUntilLaunchTerminates
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
/**
* Waits until {@code launch} terminates or {@code monitor} is canceled. if the monitor is
* canceled, attempts to terminate the launch before returning.
*
* @return true if the launch terminated normally; false otherwise
*/
@VisibleForTesting
static boolean waitUntilLaunchTerminates(ILaunch launch, IProgressMonitor monitor)
throws InterruptedException, DebugException {
while (!launch.isTerminated() && !monitor.isCanceled()) {
Thread.sleep(100 /*ms*/);
}
if (monitor.isCanceled()) {
launch.terminate();
return false;
}
for (IProcess process : launch.getProcesses()) {
if (process.getExitValue() != 0) {
return false;
}
}
return true;
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:25,代码来源:FlexMavenPackagedProjectStagingDelegate.java
示例12: getDeployArtifact
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Override
protected IPath getDeployArtifact(IPath safeWorkingDirectory, IProgressMonitor monitor)
throws CoreException {
SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
try {
ILaunchConfiguration config = createMavenPackagingLaunchConfiguration(project);
ILaunch launch = config.launch("run", subMonitor.newChild(10));
if (!waitUntilLaunchTerminates(launch, subMonitor.newChild(90))) {
throw new OperationCanceledException();
}
return getFinalArtifactPath(project);
} catch (InterruptedException ex) {
throw new OperationCanceledException();
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:FlexMavenPackagedProjectStagingDelegate.java
示例13: checkConflictingLaunches
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@VisibleForTesting
void checkConflictingLaunches(ILaunchConfigurationType launchConfigType, String mode,
DefaultRunConfiguration runConfig, ILaunch[] launches) throws CoreException {
for (ILaunch launch : launches) {
if (launch.isTerminated()
|| launch.getLaunchConfiguration() == null
|| launch.getLaunchConfiguration().getType() != launchConfigType) {
continue;
}
IServer otherServer = ServerUtil.getServer(launch.getLaunchConfiguration());
DefaultRunConfiguration otherRunConfig =
generateServerRunConfiguration(launch.getLaunchConfiguration(), otherServer, mode);
IStatus conflicts = checkConflicts(runConfig, otherRunConfig,
new MultiStatus(Activator.PLUGIN_ID, 0,
Messages.getString("conflicts.with.running.server", otherServer.getName()), //$NON-NLS-1$
null));
if (!conflicts.isOK()) {
throw new CoreException(StatusUtil.filter(conflicts));
}
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:23,代码来源:LocalAppEngineServerLaunchConfigurationDelegate.java
示例14: testWaitUntilLaunchTerminates_atLeastOneNonZeroExit
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Test
public void testWaitUntilLaunchTerminates_atLeastOneNonZeroExit()
throws DebugException, InterruptedException {
IProcess process = mock(IProcess.class);
when(process.getExitValue()).thenReturn(0);
IProcess nonZeroExitProcess = mock(IProcess.class);
when(nonZeroExitProcess.getExitValue()).thenReturn(1);
ILaunch launch = mock(ILaunch.class);
when(launch.isTerminated()).thenReturn(true);
when(launch.getProcesses()).thenReturn(new IProcess[] {process, nonZeroExitProcess});
boolean normalExit = FlexMavenPackagedProjectStagingDelegate.waitUntilLaunchTerminates(
launch, new NullProgressMonitor());
assertFalse(normalExit);
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:FlexMavenPackagedProjectStagingDelegateTest.java
示例15: launchesTerminated
import org.eclipse.debug.core.ILaunch; //导入依赖的package包/类
@Override
public void launchesTerminated(ILaunch[] launches) {
boolean found = false;
for (int i = 0; i < launches.length; i++) {
if (launches[i].equals(launch)) {
found = true;
break;
}
}
if (!found || notified) {
return;
}
notified = true;
if (success) {
succeededCallback.run();
}
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
}