From 6eaf132e6bc62d11dabca762f13c9da0067f5fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Thu, 14 Nov 2024 21:35:09 +0200 Subject: [PATCH] Don't hardcode simrel p2 repo to 20219-09 in tycho-its --- .../AbstractTychoExtrasIntegrationTest.java | 2 -- .../extras/pde/TestListDependencies.java | 26 +++++++++---------- .../dependency-with-nested-jar/pom.xml | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/tycho-extras/tycho-extras-its/src/test/java/org/eclipse/tycho/extras/its/AbstractTychoExtrasIntegrationTest.java b/tycho-extras/tycho-extras-its/src/test/java/org/eclipse/tycho/extras/its/AbstractTychoExtrasIntegrationTest.java index 3d837cdd9e..484b980c1c 100644 --- a/tycho-extras/tycho-extras-its/src/test/java/org/eclipse/tycho/extras/its/AbstractTychoExtrasIntegrationTest.java +++ b/tycho-extras/tycho-extras-its/src/test/java/org/eclipse/tycho/extras/its/AbstractTychoExtrasIntegrationTest.java @@ -19,8 +19,6 @@ public class AbstractTychoExtrasIntegrationTest extends AbstractTychoIntegrationTest { - public static final String P2_REPO = "https:///download.eclipse.org/releases/2019-09/"; - @Override protected File getBasedir(String test) throws IOException { return new File("target/test-classes", test).getAbsoluteFile(); diff --git a/tycho-extras/tycho-extras-its/src/test/java/org/eclipse/tycho/extras/pde/TestListDependencies.java b/tycho-extras/tycho-extras-its/src/test/java/org/eclipse/tycho/extras/pde/TestListDependencies.java index dd86effd3c..a65b1d45cf 100644 --- a/tycho-extras/tycho-extras-its/src/test/java/org/eclipse/tycho/extras/pde/TestListDependencies.java +++ b/tycho-extras/tycho-extras-its/src/test/java/org/eclipse/tycho/extras/pde/TestListDependencies.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019 Red Hat, Inc. and others. + * Copyright (c) 2019, 2024 Red Hat, 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 @@ -9,13 +9,15 @@ *******************************************************************************/ package org.eclipse.tycho.extras.pde; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import java.io.BufferedReader; import java.io.File; import java.nio.file.Files; import org.apache.maven.it.Verifier; import org.eclipse.tycho.extras.its.AbstractTychoExtrasIntegrationTest; -import org.junit.Assert; import org.junit.Test; public class TestListDependencies extends AbstractTychoExtrasIntegrationTest { @@ -26,27 +28,25 @@ public void testDependencyInReactor() throws Exception { verifier.executeGoal("verify"); verifier.verifyErrorFreeLog(); File file = new File(verifier.getBasedir(), "dependent/target/dependencies-list.txt"); - Assert.assertTrue(file.exists()); - try (BufferedReader reader = Files.newBufferedReader(file.toPath());) { + assertTrue(file.exists()); + try (BufferedReader reader = Files.newBufferedReader(file.toPath())) { File dependency = new File(reader.readLine()); - Assert.assertTrue(dependency.exists()); - Assert.assertEquals("dependency-0.1.0-SNAPSHOT.jar", dependency.getName()); + assertTrue(dependency.exists()); + assertEquals("dependency-0.1.0-SNAPSHOT.jar", dependency.getName()); } } @Test public void testDependencyWithNestedJar() throws Exception { - Verifier verifier = getVerifier("dependencyList/dependency-with-nested-jar", false); - verifier.addCliOption("-Dp2-repo=" + P2_REPO); + Verifier verifier = getVerifier("dependencyList/dependency-with-nested-jar"); verifier.executeGoal("verify"); verifier.verifyErrorFreeLog(); File file = new File(verifier.getBasedir(), "target/dependencies-list.txt"); - Assert.assertTrue(file.exists()); - try (BufferedReader reader = Files.newBufferedReader(file.toPath()) // - ) { // + assertTrue(file.exists()); + try (BufferedReader reader = Files.newBufferedReader(file.toPath())) { File dependency = new File(reader.readLine()); - Assert.assertTrue(dependency.exists()); - Assert.assertEquals("org.junit-4.12.0.v201504281640.jar", dependency.getName()); + assertTrue(dependency.exists()); + assertEquals("org.junit-4.13.2.v20230809-1000.jar", dependency.getName()); } } } diff --git a/tycho-extras/tycho-extras-its/src/test/resources/dependencyList/dependency-with-nested-jar/pom.xml b/tycho-extras/tycho-extras-its/src/test/resources/dependencyList/dependency-with-nested-jar/pom.xml index 5cec52a0c2..7e525c885a 100644 --- a/tycho-extras/tycho-extras-its/src/test/resources/dependencyList/dependency-with-nested-jar/pom.xml +++ b/tycho-extras/tycho-extras-its/src/test/resources/dependencyList/dependency-with-nested-jar/pom.xml @@ -33,7 +33,7 @@ p2-repo - ${p2-repo} + ${target-platform} p2