Skip to content

Commit a05b110

Browse files
HeikoKlareakurtakov
authored andcommitted
Add org.eclipse.tips.tests to Tycho build
* Make test bundle independent from org.eclipse.tips.examples by replicating the dummy resource used from the example project in the test project * Add test project as module to Maven build * Add a JUnit 5 test suite containing all tips tests * Add test suite to build.properties for pomless Tycho execution
1 parent eafc8d5 commit a05b110

File tree

6 files changed

+44
-5
lines changed

6 files changed

+44
-5
lines changed

ua/org.eclipse.tips.tests/META-INF/MANIFEST.MF

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Bundle-SymbolicName: org.eclipse.tips.tests
55
Bundle-Version: 1.2.0.qualifier
66
Bundle-Vendor: Eclipse
77
Bundle-RequiredExecutionEnvironment: JavaSE-17
8-
Require-Bundle: org.eclipse.tips.examples;bundle-version="0.1.0",
9-
org.eclipse.tips.ide;bundle-version="0.1.0",
8+
Require-Bundle: org.eclipse.tips.ide;bundle-version="0.1.0",
109
org.eclipse.core.runtime;bundle-version="3.29.0",
1110
org.eclipse.swt,
1211
org.eclipse.jface;bundle-version="3.12.0",
@@ -17,4 +16,5 @@ Automatic-Module-Name: org.eclipse.tips.tests
1716
Import-Package: com.google.gson;version="[2.8.6,3.0.0)",
1817
org.assertj.core.api,
1918
org.junit.jupiter.api,
20-
org.junit.jupiter.api.function
19+
org.junit.jupiter.api.function,
20+
org.junit.platform.suite.api

ua/org.eclipse.tips.tests/build.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@
1414
source.. = src/
1515
output.. = bin/
1616
bin.includes = META-INF/,\
17+
icons/,\
1718
.
1819
src.includes = about.html
20+
pom.model.property.testClass = org.eclipse.tips.tests.AllTipsTests
21+
pom.model.property.tycho.surefire.useUIHarness = true
22+
pom.model.property.tycho.surefire.useUIThread = true
237 Bytes
Loading

ua/org.eclipse.tips.tests/src/org/eclipse/tips/core/TestTipProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public String getID() {
4646
@Override
4747
public TipImage getImage() {
4848
if (image == null) {
49-
URL url = Platform.getBundle("org.eclipse.tips.examples").getEntry("icons/48/c++.png");
49+
URL url = Platform.getBundle("org.eclipse.tips.tests").getEntry("icons/dummy.png");
5050
Image pluginImage = resourceManager.get(ImageDescriptor.createFromURL(url));
5151
String base64 = ImageUtil.decodeFromImage(pluginImage, SWT.IMAGE_PNG);
5252
image = new TipImage(base64);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2024 Vector Informatik GmbH and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*******************************************************************************/
11+
package org.eclipse.tips.tests;
12+
13+
import org.eclipse.tips.core.TipImageBas64Test;
14+
import org.eclipse.tips.core.TipImageURLTest;
15+
import org.eclipse.tips.core.TipManagerTest;
16+
import org.eclipse.tips.core.TipProviderTest;
17+
import org.eclipse.tips.core.TipTest;
18+
import org.eclipse.tips.json.internal.UtilTest;
19+
import org.eclipse.tips.util.ImageUtilTest;
20+
import org.junit.platform.suite.api.SelectClasses;
21+
import org.junit.platform.suite.api.Suite;
22+
23+
@Suite
24+
@SelectClasses({ //
25+
TipImageBas64Test.class, //
26+
TipImageURLTest.class, //
27+
TipManagerTest.class, //
28+
TipProviderTest.class, //
29+
TipTest.class, //
30+
UtilTest.class, //
31+
ImageUtilTest.class, //
32+
})
33+
public class AllTipsTests {
34+
35+
}

ua/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<module>org.eclipse.tips.ide</module>
4242
<module>org.eclipse.tips.json</module>
4343
<module>org.eclipse.tips.feature</module>
44+
<module>org.eclipse.tips.tests</module>
4445

4546
<module>infocenter-web</module>
4647
</modules>
4748
</project>
48-

0 commit comments

Comments
 (0)