Skip to content

Commit e5043b8

Browse files
committed
Merge branch 'master' into nebulaCell
2 parents fb880d1 + 49202a4 commit e5043b8

55 files changed

Lines changed: 1280 additions & 364 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- name: VNC
104104
run: vncserver $DISPLAY -localhost=1 -noxstartup -PasswordFile /root/.vnc/passwd
105105
- name: Build
106-
run: ./build.sh -Decl-platform-repository=https://download.eclipse.org/releases/2026-03 -Decl.executionEnvironment=JavaSE-21 -DforceContextQualifier=`date '+%Y%m%d%H%M'` -DbuildUrl=file://`pwd` --errors --batch-mode --no-transfer-progress
106+
run: ./build.sh -PlatestPlatform -PforceContextQualifier -DforceContextQualifier=`date '+%Y%m%d%H%M'` -DbuildUrl=file://`pwd` --errors --batch-mode --no-transfer-progress
107107
- name: Archive results
108108
if: always()
109109
uses: actions/upload-artifact@v4

ecl/plugins/org.eclipse.rcptt.ecl.platform.ui/src/org/eclipse/rcptt/ecl/platform/internal/ui/commands/ExecuteCommandService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public IStatus service(Command command, IProcess context) throws InterruptedExce
6060
}
6161
});
6262
try {
63-
return result.get(1, TimeUnit.SECONDS);
63+
// Garbage collection may take more than a second on Eclipse CI
64+
return result.get(2, TimeUnit.SECONDS);
6465
} catch (TimeoutException e) {
6566
return error("UI thread has timed out");
6667
} catch (java.util.concurrent.ExecutionException e) {

ecl/plugins/org.eclipse.rcptt.ecl.platform/src/org/eclipse/rcptt/ecl/platform/internal/commands/ListPluginsService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@
3535
public class ListPluginsService implements ICommandService {
3636

3737

38+
@Override
3839
public IStatus service(Command command, IProcess context)
3940
throws InterruptedException, CoreException {
4041
ListPlugins cmd = (ListPlugins) command;
4142
boolean includeDeps = cmd.isIncludeDependencies();
42-
State platformState = includeDeps ? Platform.getPlatformAdmin()
43-
.getState() : null;
4443

4544
for (Bundle bundle : PlatformPlugin.getDefault().getBundles()) {
4645
Plugin plugin = ObjectsFactory.eINSTANCE.createPlugin();
@@ -53,7 +52,7 @@ public IStatus service(Command command, IProcess context)
5352
}
5453

5554
if (includeDeps) {
56-
platformState = Platform.getPlatformAdmin().getState();
55+
State platformState = Platform.getPlatformAdmin().getState();
5756
BundleDescription bundleDesc = platformState.getBundle(bundle
5857
.getBundleId());
5958

launching/org.eclipse.rcptt.launching.ext/src/org/eclipse/rcptt/internal/launching/ext/JDTUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class JDTUtils {
4747
private static final String OS_ARCH = "os.arch";
4848
private static final ILog LOG = Platform.getLog(JDTUtils.class);
4949

50-
private static IVMInstall registerCurrentJVM() {
50+
public static IVMInstall registerCurrentJVM() {
5151
try {
5252
return registerVM(new File(System.getProperty("java.home")));
5353
} catch (CoreException e) {
@@ -240,7 +240,6 @@ public static final Stream<IVMInstall> installedVms() {
240240
Stream<IVMInstall> preinstalled = registeredInstalls();
241241
Stream<IVMInstall> currentJVM = Stream.generate(JDTUtils::registerCurrentJVM).limit(1);
242242
return Stream.concat(preinstalled, currentJVM);
243-
244243
}
245244

246245
private static Stream<IVMInstall> registeredInstalls() {

launching/org.eclipse.rcptt.launching.ext/src/org/eclipse/rcptt/internal/launching/ext/PDELocationUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313
*/
1414
package org.eclipse.rcptt.internal.launching.ext;
1515

16+
import static org.eclipse.core.runtime.Status.error;
1617
import static org.eclipse.rcptt.internal.launching.ext.Q7ExtLaunchingPlugin.PLUGIN_ID;
1718

1819
import java.io.File;
1920
import java.io.IOException;
2021
import java.nio.file.Files;
21-
import java.util.NoSuchElementException;
22-
import java.util.Optional;
2322

2423
import org.eclipse.core.filesystem.EFS;
2524
import org.eclipse.core.runtime.CoreException;
@@ -133,9 +132,9 @@ private static IPath getOSXProductE4Folder(final IPath path) throws CoreExceptio
133132
try {
134133
return Path.fromOSString(Files.list(root).filter(Files::isDirectory).filter(PDELocationUtils::endsWithApp).findFirst().map(appDir ->
135134
appDir. resolve("Contents").resolve("Eclipse")
136-
).filter(Files::isDirectory).orElseThrow(() -> new NoSuchElementException("Can't find Eclipse directory in " + path)).toString());
135+
).filter(Files::isDirectory).orElseThrow(() -> new CoreException(error("Can't find Eclipse directory in " + path))).toString());
137136
} catch (IOException e) {
138-
throw new CoreException(Status.error("Can't find Eclipse directory in " + path, e));
137+
throw new CoreException(error("Can't find Eclipse directory in " + path, e));
139138
}
140139
}
141140

launching/org.eclipse.rcptt.launching.ext/src/org/eclipse/rcptt/internal/launching/ext/PDEUtils.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111
package org.eclipse.rcptt.internal.launching.ext;
1212

1313
import java.util.Map;
14+
import java.util.Optional;
1415
import java.util.Set;
1516
import java.util.stream.Stream;
1617

1718
import org.eclipse.core.runtime.CoreException;
19+
import org.eclipse.core.runtime.IPath;
1820
import org.eclipse.debug.core.ILaunchConfiguration;
21+
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
1922
import org.eclipse.jdt.launching.IVMInstall;
23+
import org.eclipse.jdt.launching.JavaRuntime;
2024
import org.eclipse.osgi.service.resolver.BundleDescription;
2125
import org.eclipse.pde.core.plugin.IPluginModelBase;
2226
import org.eclipse.pde.internal.build.IPDEBuildConstants;
@@ -73,5 +77,16 @@ public static IVMInstall getVMInstall(ILaunchConfiguration configuration, Set<IP
7377
public static Stream<String> startupPackageNames() {
7478
return Stream.of(IPDEBuildConstants.BUNDLE_EQUINOX_LAUNCHER);
7579
}
80+
81+
public static Optional<String> getExecutionEnvironmentId(ILaunchConfiguration configuration) throws CoreException {
82+
String jre = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String) null);
83+
if (jre == null) {
84+
return Optional.empty();
85+
}
86+
87+
// Launch configuration has a JRE or EE set, throw exception if associated vm not found
88+
IPath jrePath = IPath.fromPortableString(jre);
89+
return Optional.ofNullable(JavaRuntime.getExecutionEnvironmentId(jrePath));
90+
}
7691

7792
}

launching/org.eclipse.rcptt.launching.ext/src/org/eclipse/rcptt/launching/ext/JvmTargetCompatibility.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ public String explainJvmRequirements() throws CoreException {
219219
return result.toString();
220220
}
221221

222-
222+
public Stream<VmInstallMetaData> findForEnvironment(String executionEnvironmentId) {
223+
return VmInstallMetaData.forEnvironment(executionEnvironmentId).filter(this::isCompatible);
224+
}
225+
223226

224227
private static final String[] EMPTY = new String[0];
225228
private static String[] getExecutionEnironments(IPluginModelBase plugin) {

launching/org.eclipse.rcptt.launching.ext/src/org/eclipse/rcptt/launching/ext/Q7ExternalLaunchDelegate.java

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
package org.eclipse.rcptt.launching.ext;
1212

1313
import static java.util.Arrays.asList;
14+
import static java.util.Objects.requireNonNull;
1415
import static org.eclipse.core.runtime.IProgressMonitor.done;
1516
import static org.eclipse.core.runtime.Status.error;
1617
import static org.eclipse.rcptt.internal.launching.ext.AJConstants.OSGI_FRAMEWORK_EXTENSIONS;
@@ -58,6 +59,7 @@
5859
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
5960
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
6061
import org.eclipse.jdt.launching.IVMInstall;
62+
import org.eclipse.jdt.launching.IVMRunner;
6163
import org.eclipse.jdt.launching.JavaRuntime;
6264
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
6365
import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager;
@@ -168,6 +170,13 @@ public boolean finalLaunchCheck(ILaunchConfiguration configuration,
168170
return super.finalLaunchCheck(configuration, mode, monitor);
169171
}
170172

173+
@Override
174+
public IVMRunner getVMRunner(ILaunchConfiguration configuration, String mode) throws CoreException {
175+
final CachedInfo info = LaunchInfoCache.getInfo(configuration);
176+
final ITargetPlatformHelper platform = (ITargetPlatformHelper) requireNonNull(info.target);
177+
return getVMInstall(configuration, platform).getVMRunner(mode);
178+
}
179+
171180
@Override
172181
public boolean preLaunchCheck(ILaunchConfiguration configuration,
173182
String mode, IProgressMonitor monitor) throws CoreException {
@@ -229,11 +238,13 @@ public boolean preLaunchCheck(ILaunchConfiguration configuration,
229238
info.target = target;
230239

231240

232-
JvmTargetCompatibility compatibility = new JvmTargetCompatibility(target);
233-
234-
IVMInstall configuredJvm = getVMInstall(configuration, target);
241+
try {
242+
getVMInstall(configuration, target);
243+
} catch (CoreException e) {
244+
error.add(e.getStatus());
245+
throw new CoreException(error);
246+
}
235247

236-
error.add(compatibility.checkCompatibilty(configuredJvm));
237248
if (error.matches(IStatus.CANCEL)) {
238249
return false;
239250
}
@@ -251,7 +262,25 @@ public boolean preLaunchCheck(ILaunchConfiguration configuration,
251262
}
252263

253264
public static IVMInstall getVMInstall(ILaunchConfiguration configuration, ITargetPlatformHelper target) throws CoreException {
254-
return PDEUtils.getVMInstall(configuration, target.getModels().map(m -> m.model()).collect(Collectors.toSet()));
265+
JvmTargetCompatibility compatibility = new JvmTargetCompatibility(target);
266+
IVMInstall pdeDerived = PDEUtils.getVMInstall(configuration, target.getModels().map(m -> m.model()).collect(Collectors.toSet()));
267+
IStatus error = compatibility.checkCompatibilty(pdeDerived);
268+
if (error.matches(IStatus.CANCEL)) {
269+
throw new CoreException(error);
270+
}
271+
if (!error.matches(IStatus.ERROR)) {
272+
return pdeDerived;
273+
}
274+
275+
Stream<VmInstallMetaData> byEnv = PDEUtils.getExecutionEnvironmentId(configuration).map(envId -> compatibility.findForEnvironment(envId)).orElse(Stream.empty());
276+
277+
return byEnv.findFirst().orElseThrow(() -> {
278+
try {
279+
return new CoreException(Status.error(compatibility.explainJvmRequirements()));
280+
} catch (CoreException e) {
281+
return e;
282+
}
283+
}).install;
255284
}
256285

257286
private void removeTargetPlatform(ILaunchConfiguration configuration)

launching/org.eclipse.rcptt.launching.ext/src/org/eclipse/rcptt/launching/ext/VmInstallMetaData.java

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
*******************************************************************************/
1111
package org.eclipse.rcptt.launching.ext;
1212

13+
import static java.util.Arrays.asList;
1314
import static java.util.Arrays.stream;
15+
import static java.util.function.Function.identity;
16+
import static java.util.stream.Stream.generate;
17+
import static java.util.stream.Stream.ofNullable;
1418

1519
import java.nio.file.Path;
1620
import java.util.Arrays;
1721
import java.util.Collection;
22+
import java.util.List;
1823
import java.util.Objects;
1924
import java.util.Optional;
2025
import java.util.Set;
@@ -78,12 +83,42 @@ public String formatVmContainerPath() {
7883
}
7984

8085
public static Stream<VmInstallMetaData> all() {
86+
var compatibilities = new Compatibilities();
87+
return JDTUtils.installedVms().map(compatibilities::adapt).flatMap(Optional::stream);
88+
89+
}
90+
91+
public static Stream<VmInstallMetaData> forEnvironment(String executionEnvironmentId) {
8192
IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
82-
Multimap<IVMInstall, IExecutionEnvironment> environments = HashMultimap.create();
83-
stream(manager.getExecutionEnvironments())
84-
.forEach(env -> stream(env.getCompatibleVMs()).forEach( vm -> environments.put(vm, env) ));
85-
return JDTUtils.installedVms().map(vm -> adapt(vm, environments.get(vm))).flatMap(Optional::stream);
93+
IExecutionEnvironment environment = manager.getEnvironment(executionEnvironmentId);
94+
var compatibilities = new Compatibilities();
95+
Stream<IVMInstall> currentJvm = generate(JDTUtils::registerCurrentJVM).limit(1).filter(install -> asList(environment.getCompatibleVMs()).contains(install));
96+
return List.<Stream<IVMInstall>>of(ofNullable(environment.getDefaultVM()), stream(environment.getCompatibleVMs()), currentJvm)
97+
.stream()
98+
.flatMap(identity())
99+
.distinct()
100+
.map(compatibilities::adapt)
101+
.flatMap(Optional::stream);
102+
}
103+
104+
private static class Compatibilities {
105+
private Multimap<IVMInstall, IExecutionEnvironment> environments = HashMultimap.create();
106+
private final IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
107+
{
108+
stream(manager.getExecutionEnvironments())
109+
.forEach(env -> stream(env.getCompatibleVMs()).forEach( vm -> environments.put(vm, env) ));
110+
}
111+
public Optional<VmInstallMetaData> adapt(IVMInstall install) {
112+
Collection<IExecutionEnvironment> compatible = environments.get(install);
113+
if (compatible.isEmpty()) {
114+
compatible = stream(manager.getExecutionEnvironments()).filter(env -> asList(env.getCompatibleVMs()).contains(install)).toList();
115+
assert !compatible.isEmpty() : install + " does not support any environments";
116+
environments.putAll(install, compatible);
117+
}
118+
return VmInstallMetaData.adapt(install, compatible);
119+
}
86120
}
121+
87122

88123
private static Optional<VmInstallMetaData> adapt(IVMInstall install, Collection<IExecutionEnvironment> environments) {
89124
try {
@@ -102,4 +137,5 @@ public static Stream<VmInstallMetaData> register(Path location) throws CoreExcep
102137
IVMInstall install = JDTUtils.registerVM(location.toFile());
103138
return adapt(install);
104139
}
140+
105141
}

launching/org.eclipse.rcptt.reporting.html/src/org/eclipse/rcptt/reporting/html/FullSingleTestHtmlRenderer.java

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2019 Xored Software Inc and others.
2+
* Copyright (c) 2009 Xored Software Inc and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -69,7 +69,7 @@
6969
public class FullSingleTestHtmlRenderer {
7070
private final PrintWriter writer;
7171
private final NumberFormat durationFormat;
72-
private final DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm");
72+
private final DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");
7373
private final Function<Screenshot, String> imageStorage;
7474
private static final ILog LOG = Platform.getLog(FullSingleTestHtmlRenderer.class);
7575

@@ -123,8 +123,21 @@ public void render(Report report) {
123123
closeDetails();
124124
}
125125

126+
private void renderTime(long ms_since_epoch) {
127+
writer.print("<span class=\"time\" epoch=\"");
128+
writer.print(ms_since_epoch);
129+
writer.print("\">");
130+
writer.print(dateFormat.format(ms_since_epoch));
131+
writer.print("</span>");
132+
133+
}
126134
private void renderNode(Node node) {
135+
renderTime(node.getStartTime());
136+
writer.print(" - ");
137+
renderTime(node.getEndTime());
138+
writer.println("<p>");
127139
Q7Info info = ReportHelper.getInfo(node);
140+
128141
renderResult(info.getResult());
129142
EList<Node> children = node.getChildren();
130143
Q7WaitInfoRoot waitInfo = ReportHelper.getWaitInfo(node, false);
@@ -147,10 +160,11 @@ private void renderNode(Node node) {
147160
logs.append(logs2);
148161
}
149162
if (logs.length() > 2) {
150-
renderHeader(2, "Logs", "");
163+
openDetails(2, "Logs", "");
151164
writer.println("<pre>");
152165
writer.println(logs);
153166
writer.println("</pre>");
167+
closeDetails();
154168
}
155169
}
156170

@@ -247,7 +261,12 @@ private void renderEvent(EObject eObject) {
247261
public void renderAdvanced(AdvancedInformation info) {
248262
EList<InfoNode> nodes = info.getNodes();
249263
for (InfoNode infoNode : nodes) {
264+
if (infoNode.getChildren().isEmpty() && infoNode.getProperties().isEmpty()) {
265+
continue;
266+
}
267+
openDetails(5, infoNode.getName(), "");
250268
renderNode(infoNode);
269+
closeDetails();
251270
}
252271
// Append job information
253272
EList<JobEntry> jobs = info.getJobs();
@@ -266,8 +285,7 @@ public void renderAdvanced(AdvancedInformation info) {
266285
// Append thread information
267286
EList<StackTraceEntry> threads = info.getThreads();
268287
if (!threads.isEmpty()) {
269-
renderHeader(5, "Thread information", "");
270-
writer.println("<div class=\"childNode\">");
288+
openDetails(5, "Thread information", "");
271289
for (StackTraceEntry trace : threads) {
272290
if (trace.getThreadClass().equals(
273291
"org.eclipse.core.internal.jobs.Worker")
@@ -284,12 +302,11 @@ public void renderAdvanced(AdvancedInformation info) {
284302
.println("<br>");
285303
}
286304
}
287-
writer.println("</div>");
305+
closeDetails();
288306
}
289307
}
290308

291309
private void renderNode(InfoNode infoNode) {
292-
writer.println(infoNode.getName());
293310
EList<NodeProperty> list = infoNode.getProperties();
294311
EList<InfoNode> childs = infoNode.getChildren();
295312
if (!list.isEmpty() || !childs.isEmpty()) {
@@ -303,6 +320,7 @@ private void renderNode(InfoNode infoNode) {
303320
}
304321
if (childs.size() != 0) {
305322
for (InfoNode child : childs) {
323+
writer.println(child.getName());
306324
renderNode(child);
307325
}
308326
}

0 commit comments

Comments
 (0)