Skip to content

Commit

Permalink
Stop using deprecated Verifier methods
Browse files Browse the repository at this point in the history
  • Loading branch information
akurtakov committed Sep 28, 2023
1 parent 7d3ce58 commit 42383b9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2021 SAP AG and others.
* Copyright (c) 2010, 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 Down Expand Up @@ -28,6 +28,7 @@
import java.util.Properties;
import java.util.Set;

import org.apache.maven.it.VerificationException;
import org.apache.maven.it.Verifier;
import org.eclipse.tycho.TargetEnvironment;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
Expand Down Expand Up @@ -237,8 +238,8 @@ private static void assertContainsEntry(File file, String prefix) throws Excepti
}
}

static private void assertRepositoryArtifacts(Verifier verifier) {
verifier.assertArtifactPresent(GROUP_ID, ARTIFACT_ID, VERSION, "zip");
static private void assertRepositoryArtifacts(Verifier verifier) throws VerificationException {
verifier.verifyArtifactPresent(GROUP_ID, ARTIFACT_ID, VERSION, "zip");
}

static private void assertTotalZipArtifacts(final Verifier verifier, final int expectedArtifacts) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022 Joe Shannon and others.
* Copyright (c) 2022, 2023 Joe Shannon 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 @@ -51,12 +51,12 @@ public void setUp() throws Exception {
public void testCompleteBuild() throws Exception {
verifier.executeGoals(List.of("clean", "verify"));
verifyErrorFreeLog(verifier);
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle1a/target/bundle1a-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle1b/target/bundle1b-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1a/target/bundle1a-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1b/target/bundle1b-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
}

@Test
Expand All @@ -66,12 +66,12 @@ public void testAlsoMake() throws Exception {
verifier.addCliOption("-pl feature1");
verifier.executeGoals(List.of("clean", "verify"));
verifyErrorFreeLog(verifier);
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.assertFileNotPresent("bundle1a/target/bundle1a-1.0.0-SNAPSHOT.jar");
verifier.assertFileNotPresent("bundle1b/target/bundle1b-1.0.0-SNAPSHOT.jar");
verifier.assertFileNotPresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.assertFileNotPresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.verifyFileNotPresent("bundle1a/target/bundle1a-1.0.0-SNAPSHOT.jar");
verifier.verifyFileNotPresent("bundle1b/target/bundle1b-1.0.0-SNAPSHOT.jar");
verifier.verifyFileNotPresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.verifyFileNotPresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
}

@Test
Expand All @@ -97,12 +97,12 @@ public void testAlsoMakeWithIndirectDependencies() throws Exception {
verifier.addCliOption("-pl bundle1b");
verifier.executeGoals(List.of("clean", "verify"));
verifyErrorFreeLog(verifier);
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle1a/target/bundle1a-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle1b/target/bundle1b-1.0.0-SNAPSHOT.jar");
verifier.assertFileNotPresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.assertFileNotPresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.assertFileNotPresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1a/target/bundle1a-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1b/target/bundle1b-1.0.0-SNAPSHOT.jar");
verifier.verifyFileNotPresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.verifyFileNotPresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.verifyFileNotPresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
}

@Test
Expand All @@ -112,12 +112,12 @@ public void testAlsoMakeDependentsNeedsToPickUpDependenciesOfDependents() throws
verifier.addCliOption("-pl bundle1");
verifier.executeGoals(List.of("clean", "verify"));
verifyErrorFreeLog(verifier);
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle1a/target/bundle1a-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle1b/target/bundle1b-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1a/target/bundle1a-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1b/target/bundle1b-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
}

@Test
Expand All @@ -128,10 +128,10 @@ public void testBoth() throws Exception {
verifier.addCliOption("-pl feature1,bundle2");
verifier.executeGoals(List.of("clean", "verify"));
verifyErrorFreeLog(verifier);
verifier.assertFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.assertFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle1/target/bundle1-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("bundle2/target/bundle2-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("feature1/target/feature1-1.0.0-SNAPSHOT.jar");
verifier.verifyFilePresent("feature2/target/feature2-1.0.0-SNAPSHOT.jar");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2018 SAP AG and others.
* Copyright (c) 2012, 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 Down

0 comments on commit 42383b9

Please sign in to comment.