Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't hardcode simrel p2 repo to 20219-09 in tycho-its #4436

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 {
Expand All @@ -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());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<repositories>
<repository>
<id>p2-repo</id>
<url>${p2-repo}</url>
<url>${target-platform}</url>
<layout>p2</layout>
</repository>
</repositories>
Expand Down
Loading