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

Fixing #700: Adapting SetScmTagMojoTest to work without BaseMojoTestCase #701

Merged
merged 1 commit into from
Sep 17, 2022
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
13 changes: 9 additions & 4 deletions src/test/java/org/codehaus/mojo/versions/SetScmTagMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
import java.nio.file.Path;
import java.nio.file.Paths;

import org.codehaus.mojo.versions.utils.BaseMojoTestCase;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
import org.apache.maven.plugin.testing.MojoRule;
import org.junit.Rule;
import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
Expand All @@ -35,13 +37,16 @@
*
* @author Andrzej Jarmoniuk
*/
public class SetScmTagMojoTest extends BaseMojoTestCase
public class SetScmTagMojoTest extends AbstractMojoTestCase
{
@Rule
public MojoRule mojoRule = new MojoRule( this );

@Test
public void testNewScmValues() throws Exception
{
Path pomFile = Paths.get( "target/test-classes/org/codehaus/mojo/set-scm-tag/issue-342-pom.xml" );
createMojo( "set-scm-tag", pomFile.toString() )
Path pomFile = Paths.get( "target/test-classes/org/codehaus/mojo/set-scm-tag/pom.xml" );
mojoRule.lookupConfiguredMojo( pomFile.toFile().getParentFile(), "set-scm-tag" )
.execute();
String output = String.join( "", Files.readAllLines( pomFile ) )
.replaceAll( "\\s*", "" );
Expand Down
24 changes: 0 additions & 24 deletions src/test/resources/org/codehaus/mojo/set-scm-tag/issue-342-pom.xml

This file was deleted.

21 changes: 21 additions & 0 deletions src/test/resources/org/codehaus/mojo/set-scm-tag/pom.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
Expand All @@ -11,7 +30,9 @@
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${project.version}</version>
<configuration>
<newTag>newTag</newTag>
<connection>connection</connection>
Expand Down