Skip to content

Commit

Permalink
Don't hardcode simrel p2 repo to 20219-09 in tycho-its
Browse files Browse the repository at this point in the history
  • Loading branch information
akurtakov committed Nov 14, 2024
1 parent 4ac9f1a commit 6eaf132
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
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

0 comments on commit 6eaf132

Please sign in to comment.