Skip to content

Commit

Permalink
Add org.eclipse.tips.tests to Tycho build
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
HeikoKlare authored and akurtakov committed Jan 24, 2024
1 parent eafc8d5 commit a05b110
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ua/org.eclipse.tips.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ Bundle-SymbolicName: org.eclipse.tips.tests
Bundle-Version: 1.2.0.qualifier
Bundle-Vendor: Eclipse
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.tips.examples;bundle-version="0.1.0",
org.eclipse.tips.ide;bundle-version="0.1.0",
Require-Bundle: org.eclipse.tips.ide;bundle-version="0.1.0",
org.eclipse.core.runtime;bundle-version="3.29.0",
org.eclipse.swt,
org.eclipse.jface;bundle-version="3.12.0",
Expand All @@ -17,4 +16,5 @@ Automatic-Module-Name: org.eclipse.tips.tests
Import-Package: com.google.gson;version="[2.8.6,3.0.0)",
org.assertj.core.api,
org.junit.jupiter.api,
org.junit.jupiter.api.function
org.junit.jupiter.api.function,
org.junit.platform.suite.api
4 changes: 4 additions & 0 deletions ua/org.eclipse.tips.tests/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
icons/,\
.
src.includes = about.html
pom.model.property.testClass = org.eclipse.tips.tests.AllTipsTests
pom.model.property.tycho.surefire.useUIHarness = true
pom.model.property.tycho.surefire.useUIThread = true
Binary file added ua/org.eclipse.tips.tests/icons/dummy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String getID() {
@Override
public TipImage getImage() {
if (image == null) {
URL url = Platform.getBundle("org.eclipse.tips.examples").getEntry("icons/48/c++.png");
URL url = Platform.getBundle("org.eclipse.tips.tests").getEntry("icons/dummy.png");
Image pluginImage = resourceManager.get(ImageDescriptor.createFromURL(url));
String base64 = ImageUtil.decodeFromImage(pluginImage, SWT.IMAGE_PNG);
image = new TipImage(base64);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*******************************************************************************
* Copyright (c) 2024 Vector Informatik GmbH and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.tips.tests;

import org.eclipse.tips.core.TipImageBas64Test;
import org.eclipse.tips.core.TipImageURLTest;
import org.eclipse.tips.core.TipManagerTest;
import org.eclipse.tips.core.TipProviderTest;
import org.eclipse.tips.core.TipTest;
import org.eclipse.tips.json.internal.UtilTest;
import org.eclipse.tips.util.ImageUtilTest;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;

@Suite
@SelectClasses({ //
TipImageBas64Test.class, //
TipImageURLTest.class, //
TipManagerTest.class, //
TipProviderTest.class, //
TipTest.class, //
UtilTest.class, //
ImageUtilTest.class, //
})
public class AllTipsTests {

}
2 changes: 1 addition & 1 deletion ua/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<module>org.eclipse.tips.ide</module>
<module>org.eclipse.tips.json</module>
<module>org.eclipse.tips.feature</module>
<module>org.eclipse.tips.tests</module>

<module>infocenter-web</module>
</modules>
</project>

0 comments on commit a05b110

Please sign in to comment.