forked from citrusframework/yaks
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(citrusframework#477): Support custom Maven plugin repository
Enable users to define custom Maven plugin repositories
- Loading branch information
1 parent
d28cc83
commit cc4f660
Showing
29 changed files
with
524 additions
and
72 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
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
60 changes: 60 additions & 0 deletions
60
...trusframework/yaks/maven/extension/configuration/FileBasedPluginRepositoryLoaderTest.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,60 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
package org.citrusframework.yaks.maven.extension.configuration; | ||
|
||
import java.util.List; | ||
|
||
import org.apache.maven.lifecycle.LifecycleExecutionException; | ||
import org.apache.maven.model.Repository; | ||
import org.assertj.core.api.Assertions; | ||
import org.citrusframework.yaks.maven.extension.ExtensionSettings; | ||
import org.codehaus.plexus.logging.console.ConsoleLogger; | ||
import org.junit.Test; | ||
|
||
/** | ||
* @author Christoph Deppisch | ||
*/ | ||
public class FileBasedPluginRepositoryLoaderTest { | ||
|
||
private final FileBasedRepositoryLoader loader = new FileBasedRepositoryLoader(); | ||
|
||
private final ConsoleLogger logger = new ConsoleLogger(); | ||
|
||
@Test | ||
public void shouldLoadFromPropertyFile() throws LifecycleExecutionException { | ||
System.setProperty(ExtensionSettings.SETTINGS_FILE_KEY, "classpath:yaks.properties"); | ||
List<Repository> repositoryList = loader.load(logger, true); | ||
TestHelper.verifyRepositories(repositoryList); | ||
|
||
System.setProperty(ExtensionSettings.SETTINGS_FILE_KEY, "classpath:yaks.settings.yaml"); | ||
repositoryList = loader.load(logger, true); | ||
TestHelper.verifyRepositories(repositoryList); | ||
|
||
System.setProperty(ExtensionSettings.SETTINGS_FILE_KEY, "classpath:yaks.settings.json"); | ||
repositoryList = loader.load(logger, true); | ||
TestHelper.verifyRepositories(repositoryList); | ||
} | ||
|
||
@Test | ||
public void shouldHandleNonExistingFile() throws LifecycleExecutionException { | ||
System.setProperty(ExtensionSettings.SETTINGS_FILE_KEY, "doesNotExist"); | ||
List<Repository> repositoryList = loader.load(logger, true); | ||
Assertions.assertThat(repositoryList).isEmpty(); | ||
} | ||
|
||
} |
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
Oops, something went wrong.