Skip to content

Commit

Permalink
Remove ECLIPSE_LATEST from tycho-testing-harness
Browse files Browse the repository at this point in the history
Use the one from tycho-api.
Adjust AbstractTychoIntegrationTest to escape '/' in the target platform
url so it can be passed as parameter.
Fixed test for upstream switch javax.annotation ->
jakarta.annotation-api.
Simplified tests to rely more on verifier with preset target platform
instead of setting it in test.
  • Loading branch information
akurtakov committed Dec 11, 2023
1 parent 0842d26 commit c91cf22
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<repository>
<id>repository</id>
<layout>p2</layout>
<url>${repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<repository>
<id>repo</id>
<layout>p2</layout>
<url>${repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
2 changes: 1 addition & 1 deletion tycho-its/projects/surefire.requireBundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<repository>
<id>oxygen</id>
<layout>p2</layout>
<url>${oxygen-repo}</url>
<url>${target-platform}</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Bundle-Version: 0.0.1.qualifier
Require-Bundle: bundle;bundle-version="0.0.1",
org.junit;bundle-version="4.12.0",
org.eclipse.core.runtime;bundle-version="3.2.0",
javax.annotation
jakarta.annotation-api
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021, 2022 Christoph Läubrich and others.
* Copyright (c) 2021, 2023 Christoph Läubrich 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
Expand All @@ -22,8 +22,8 @@

import org.apache.maven.it.VerificationException;
import org.apache.maven.it.Verifier;
import org.eclipse.tycho.TychoConstants;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.EnvironmentUtil;
import org.junit.Test;

public class CompilerClasspathEntryTest extends AbstractTychoIntegrationTest {
Expand Down Expand Up @@ -64,7 +64,7 @@ public void testLibEntry() throws Exception {
@Test
public void testDSComponents() throws Exception {
Verifier verifier = getVerifier("tycho-ds", false, true);
verifier.setSystemProperty("repo-url", EnvironmentUtil.ECLIPSE_LATEST);
verifier.setSystemProperty("repo-url", TychoConstants.ECLIPSE_LATEST);
// first test to consume from target platform
verifyDs(verifier);
// now test consume from maven directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class SplitPackagesTest extends AbstractTychoIntegrationTest {

@Test
public void testSplitPackage() throws Exception {
Verifier verifier = getVerifier("/resolver.split/org.eclipse.equinox.security");
verifier.addCliOption("-Drepo=" + P2Repositories.ECLIPSE_LATEST.toString());
verifier.executeGoal("compile");
verifier.verifyErrorFreeLog();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,21 @@

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories;
import org.junit.Test;

public class RequireBundleTest extends AbstractTychoIntegrationTest {

// requested in bug 485926
@Test
public void loadResourceFromRequireBundle() throws Exception {
Verifier verifier = getVerifier("/surefire.requireBundle", false, true);
verifier.addCliOption("-Doxygen-repo=" + P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("/surefire.requireBundle", true, true);
verifier.executeGoal("integration-test");
verifier.verifyErrorFreeLog();
}

@Test
public void requireMultipleVersionsOfABundle() throws Exception {
Verifier verifier = getVerifier("/surefire.requireBundle.multipleVersions", false, true);
verifier.addCliOption("-Drepo=" + P2Repositories.ECLIPSE_LATEST.toString());
Verifier verifier = getVerifier("/surefire.requireBundle.multipleVersions", true, true);
verifier.executeGoal("integration-test");
verifier.verifyErrorFreeLog();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011, 2022 SAP AG and others.
* Copyright (c) 2011, 2023 SAP AG 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
Expand All @@ -15,14 +15,16 @@
import java.io.File;
import java.net.URI;

import org.eclipse.tycho.TychoConstants;

/**
* Helper for accessing test resources.
*/
public class ResourceUtil {

public enum P2Repositories {
ECLIPSE_342("e342"), ECLIPSE_352("e352"), ECLIPSE_OXYGEN("https:////download.eclipse.org/releases/oxygen/"),
ECLIPSE_LATEST(EnvironmentUtil.ECLIPSE_LATEST);
ECLIPSE_LATEST(TychoConstants.ECLIPSE_LATEST);

private final String path;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2022 Sonatype Inc. and others.
* Copyright (c) 2008, 2023 Sonatype Inc. 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
Expand Down Expand Up @@ -119,7 +119,7 @@ protected Verifier getVerifier(String test, boolean setTargetPlatform, File user
tmpDir.mkdirs();
verifier.addCliOption("-Djava.io.tmpdir=" + tmpDir.getAbsolutePath());
if (setTargetPlatform) {
verifier.addCliOption("-Dtarget-platform=" + getTargetPlatform());
verifier.addCliOption("-Dtarget-platform=" + getTargetPlatform().replace("/", "//"));
}
if (ignoreLocalArtifacts) {
verifier.addCliOption("-Dtycho.localArtifacts=ignore");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2020 Sonatype Inc. and others.
* Copyright (c) 2008, 2023 Sonatype Inc. 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
Expand All @@ -24,6 +24,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.eclipse.tycho.TychoConstants;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;

/**
Expand All @@ -36,8 +37,6 @@ public class EnvironmentUtil {

private static final String MAVEN_HOME_INFO = "Maven home:";

public static final String ECLIPSE_LATEST = "https:////download.eclipse.org/releases/2023-09/";

private static final Properties props;

static {
Expand Down Expand Up @@ -85,7 +84,7 @@ public static boolean isMac() {
}

public static String getTargetPlatform() {
return ECLIPSE_LATEST;
return TychoConstants.ECLIPSE_LATEST;
}

public static String getTestSettings() {
Expand Down

0 comments on commit c91cf22

Please sign in to comment.