Moved source plugins to main plugin
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@378781 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
9329c2c354
commit
009e7bceab
23 files changed
+1363
No files matched your search
@@ -0,0 +1,76 @@
|
||||
package org.apache.maven.plugin.source;
|
||||
|
||||
/* ====================================================================
|
||||
* Copyright 2001-2005 The Apache Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
* ====================================================================
|
||||
*/
|
||||
|
||||
import org.apache.maven.project.Project;
|
||||
import org.apache.maven.repository.ArtifactTypeHandler;
|
||||
import org.apache.maven.MavenException;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* Tests the java source artifact type handler implementation.
|
||||
*
|
||||
* @author <a href="mailto:snicoll@apache.org">Stephane Nicoll</a>
|
||||
* @version $Id: JavaSourceArtifactTypeHandlerTest.java 232640 2005-08-14 20:46:54Z snicoll $
|
||||
*/
|
||||
public class JavaSourceArtifactTypeHandlerTest
|
||||
extends TestCase
|
||||
{
|
||||
private Project project;
|
||||
|
||||
private ArtifactTypeHandler handler;
|
||||
|
||||
private static final String VERSION = "VERSION";
|
||||
|
||||
public void setUp()
|
||||
throws Exception
|
||||
{
|
||||
project = new Project();
|
||||
project.setGroupId( "groupId" );
|
||||
project.setArtifactId( "artifactId" );
|
||||
handler = new JavaSourceArtifactTypeHandler();
|
||||
}
|
||||
|
||||
public void testConstructRepositoryDirectoryPath()
|
||||
throws Exception
|
||||
{
|
||||
assertEquals( "check artifact directory", "groupId/java-sources/",
|
||||
handler.constructRepositoryDirectoryPath( "java-source", project ) );
|
||||
}
|
||||
|
||||
public void testConstructRepositoryFullPath()
|
||||
throws Exception
|
||||
{
|
||||
assertEquals( "check artifact path", "groupId/java-sources/artifactId-VERSION-sources.jar",
|
||||
handler.constructRepositoryFullPath( "java-source", project, VERSION ) );
|
||||
}
|
||||
|
||||
public void testConstructRepositoryFullPathWithInvalidType()
|
||||
throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
handler.constructRepositoryFullPath( "foo", project, VERSION );
|
||||
fail( "expected exception" );
|
||||
}
|
||||
catch ( MavenException expected )
|
||||
{
|
||||
assertEquals( "Unrecognised java-source type (is foo)", expected.getMessage() );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user