-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ability to allow to pass arguments to underlying Maven commands - c…
…loses #53
- Loading branch information
1 parent
f4f5d69
commit 913a676
Showing
10 changed files
with
125 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/test/java/com/amashchenko/maven/plugin/gitflow/ValidateConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2014-2017 Aleksandr Mashchenko. | ||
* | ||
* Licensed 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. | ||
*/ | ||
package com.amashchenko.maven.plugin.gitflow; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.apache.maven.plugin.MojoFailureException; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
@RunWith(Parameterized.class) | ||
public class ValidateConfigurationTest { | ||
private final String argLine; | ||
private final boolean expected; | ||
|
||
public ValidateConfigurationTest(String argLine, boolean expected) { | ||
this.argLine = argLine; | ||
this.expected = expected; | ||
} | ||
|
||
@Parameters(name = "{0}->{1}") | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][] { { "-X -e", true }, | ||
{ "-DsomeArg1=true", true }, { null, true }, | ||
{ "", true }, { "-DsomeArg & clean", false }, | ||
{ "-DsomeArg && clean", false }, | ||
{ "-DsomeArg | clean", false }, | ||
{ "-DsomeArg || clean", false }, | ||
{ "-DsomeArg ; clean", false } }); | ||
} | ||
|
||
@Test | ||
public void testValidateConfiguration() throws Exception { | ||
GitFlowReleaseStartMojo mojo = new GitFlowReleaseStartMojo(); | ||
mojo.setArgLine(argLine); | ||
|
||
try { | ||
mojo.validateConfiguration(); | ||
} catch (MojoFailureException e) { | ||
if (expected) { | ||
Assert.fail(); | ||
} | ||
} | ||
} | ||
} |