Author: ltheussl
Date: Tue Jun 13 10:01:12 2006
New Revision: 413935
URL: http://svn.apache.org/viewvc?rev=413935&view=rev
Log:
Checkstyle fixes: code reformatting, package.html, javadocs.
Added:
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/package.html
(with props)
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/package.html
(with props)
Modified:
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/DistributionArtifactTypeHandler.java
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/DistributionArtifactTypeHandlerTest.java
Modified:
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/DistributionArtifactTypeHandler.java
URL:
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/DistributionArtifactTypeHandler.java?rev=413935&r1=413934&r2=413935&view=diff
==============================================================================
---
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/DistributionArtifactTypeHandler.java
(original)
+++
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/DistributionArtifactTypeHandler.java
Tue Jun 13 10:01:12 2006
@@ -23,64 +23,82 @@
/**
* This will do until wagon debuts.
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
* @version $Id$
*/
public class DistributionArtifactTypeHandler implements ArtifactTypeHandler
{
/**
* Map an artifact to a repository directory path.
- *
+ *
* @param project the project for the artifact
- * @param type The type of the artifact
+ * @param type The type of the artifact
* @return the path
+ * @throws MavenException MavenException
*/
- public String constructRepositoryDirectoryPath(String type, Project
project) throws MavenException
+ public String constructRepositoryDirectoryPath( String type, Project
project )
+ throws MavenException
{
StringBuffer path = new StringBuffer();
- path.append(project.getArtifactDirectory());
- path.append("/distributions/");
+
+ path.append( project.getArtifactDirectory() );
+ path.append( "/distributions/" );
+
return path.toString();
}
/**
* Map an artifact to a repository path.
- *
+ *
* @param project the project for the artifact
- * @param type The type of the artifact
+ * @param type The type of the artifact
* @param version The version of the artifact (may be a snapshot)
* @return the path
+ * @throws MavenException MavenException
*/
- public String constructRepositoryFullPath(String type, Project project,
String version) throws MavenException
+ public String constructRepositoryFullPath( String type, Project project,
+ String version ) throws MavenException
{
- StringBuffer path = new
StringBuffer(constructRepositoryDirectoryPath(type, project));
- path.append(project.getArtifactId());
- path.append("-");
- path.append(version);
- if (!type.startsWith("distribution")) {
- throw new MavenException("Type is not a distribution (is " + type
+ ")");
- }
- String subtype = type.substring(12);
- if (subtype.startsWith("-src")) {
- path.append("-src");
- subtype = subtype.substring(4);
- }
+ StringBuffer path =
+ new StringBuffer( constructRepositoryDirectoryPath( type, project
) );
- if (subtype.equals("-targz")) {
- path.append(".tar.gz");
- }
- else if (subtype.equals("-tarbz2")) {
- path.append(".tar.bz2");
+ path.append( project.getArtifactId() );
+ path.append( "-" );
+ path.append( version );
+
+ if ( !type.startsWith( "distribution" ) )
+ {
+ throw new MavenException( "Type is not a distribution (is " + type
+ + ")" );
}
- else if (subtype.equals("-zip")) {
- path.append(".zip");
+
+ String subtype = type.substring( 12 );
+
+ if ( subtype.startsWith( "-src" ) )
+ {
+ path.append( "-src" );
+ subtype = subtype.substring( 4 );
}
- else {
- throw new MavenException("Unrecognised distribution type (is " +
type + ")");
+
+ if ( subtype.equals( "-targz" ) )
+ {
+ path.append( ".tar.gz" );
+ }
+ else if ( subtype.equals( "-tarbz2" ) )
+ {
+ path.append( ".tar.bz2" );
+ }
+ else if ( subtype.equals( "-zip" ) )
+ {
+ path.append( ".zip" );
+ }
+ else
+ {
+ throw new MavenException( "Unrecognised distribution type (is "
+ + type + ")" );
}
-
+
return path.toString();
}
}
-
Added:
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/package.html
URL:
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/package.html?rev=413935&view=auto
==============================================================================
---
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/package.html
(added)
+++
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/package.html
Tue Jun 13 10:01:12 2006
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <title>org.apache.maven.dist</title>
+ </head>
+ <body>
+ <p>
+ Contains utility classes for the dist plugin.
+ </p>
+ </body>
+</html>
Propchange:
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/maven-1/plugins/trunk/dist/src/main/org/apache/maven/dist/package.html
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified:
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/DistributionArtifactTypeHandlerTest.java
URL:
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/DistributionArtifactTypeHandlerTest.java?rev=413935&r1=413934&r2=413935&view=diff
==============================================================================
---
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/DistributionArtifactTypeHandlerTest.java
(original)
+++
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/DistributionArtifactTypeHandlerTest.java
Tue Jun 13 10:01:12 2006
@@ -17,78 +17,110 @@
* ====================================================================
*/
+import junit.framework.TestCase;
+
import org.apache.maven.MavenException;
import org.apache.maven.project.Project;
import org.apache.maven.repository.ArtifactTypeHandler;
-import junit.framework.TestCase;
-
/**
* This will do until wagon debuts.
- *
- * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
* @version $Id$
*/
public class DistributionArtifactTypeHandlerTest extends TestCase
{
+ /** A test version string. */
+ private static final String VERSION = "VERSION";
+
+ /** A test project. */
private Project project;
+
+ /** A test ArtifactTypeHandler. */
private ArtifactTypeHandler handler;
- private static final String VERSION = "VERSION";
+ /** JUnit setup: initialize project and handler. */
public void setUp() throws Exception
{
project = new Project();
- project.setGroupId("groupId");
- project.setArtifactId("artifactId");
+ project.setGroupId( "groupId" );
+ project.setArtifactId( "artifactId" );
handler = new DistributionArtifactTypeHandler();
}
- public void testConstructRepositoryDirectoryPath() throws Exception
+ /** Test constructRepositoryDirectoryPath. */
+ public void testConstructRepositoryDirectoryPath()
+ throws Exception
{
- assertEquals("check artifact directory", "groupId/distributions/",
- handler.constructRepositoryDirectoryPath("distribution-targz",
project));
- assertEquals("check artifact directory", "groupId/distributions/",
- handler.constructRepositoryDirectoryPath("distribution-tarbz2",
project));
- assertEquals("check artifact directory", "groupId/distributions/",
- handler.constructRepositoryDirectoryPath("distribution-zip",
project));
- assertEquals("check artifact directory", "groupId/distributions/",
- handler.constructRepositoryDirectoryPath("distribution-src-targz",
project));
- assertEquals("check artifact directory", "groupId/distributions/",
-
handler.constructRepositoryDirectoryPath("distribution-src-tarbz2", project));
- assertEquals("check artifact directory", "groupId/distributions/",
- handler.constructRepositoryDirectoryPath("distribution-src-zip",
project));
+ assertEquals( "check artifact directory", "groupId/distributions/",
+ handler.constructRepositoryDirectoryPath( "distribution-targz",
+ project ) );
+ assertEquals( "check artifact directory", "groupId/distributions/",
+ handler.constructRepositoryDirectoryPath( "distribution-tarbz2",
+ project ) );
+ assertEquals( "check artifact directory", "groupId/distributions/",
+ handler.constructRepositoryDirectoryPath( "distribution-zip",
+ project ) );
+ assertEquals( "check artifact directory", "groupId/distributions/",
+ handler.constructRepositoryDirectoryPath(
+ "distribution-src-targz", project ) );
+ assertEquals( "check artifact directory", "groupId/distributions/",
+ handler.constructRepositoryDirectoryPath(
+ "distribution-src-tarbz2", project ) );
+ assertEquals( "check artifact directory", "groupId/distributions/",
+ handler.constructRepositoryDirectoryPath( "distribution-src-zip",
+ project ) );
}
- public void testConstructRepositoryFullPath() throws Exception
+ /** Test constructRepositoryFullPath. */
+ public void testConstructRepositoryFullPath()
+ throws Exception
{
- try {
- handler.constructRepositoryFullPath("foo", project, VERSION);
- fail("expected exception");
+ try
+ {
+ handler.constructRepositoryFullPath( "foo", project, VERSION );
+ fail( "expected exception" );
}
- catch (MavenException expected) {
- assertTrue("expected exception", true);
+ catch ( MavenException expected )
+ {
+ assertTrue( "expected exception", true );
}
- try {
- handler.constructRepositoryFullPath("distribution", project,
VERSION);
- fail("expected exception");
+ try
+ {
+ handler.constructRepositoryFullPath( "distribution", project,
+ VERSION );
+ fail( "expected exception" );
}
- catch (MavenException expected) {
- assertTrue("expected exception", true);
+ catch ( MavenException expected )
+ {
+ assertTrue( "expected exception", true );
}
- assertEquals("check artifact path",
"groupId/distributions/artifactId-VERSION.tar.gz",
- handler.constructRepositoryFullPath("distribution-targz", project,
VERSION));
- assertEquals("check artifact path",
"groupId/distributions/artifactId-VERSION.tar.bz2",
- handler.constructRepositoryFullPath("distribution-tarbz2",
project, VERSION));
- assertEquals("check artifact path",
"groupId/distributions/artifactId-VERSION.zip",
- handler.constructRepositoryFullPath("distribution-zip", project,
VERSION));
- assertEquals("check artifact path",
"groupId/distributions/artifactId-VERSION-src.tar.gz",
- handler.constructRepositoryFullPath("distribution-src-targz",
project, VERSION));
- assertEquals("check artifact path",
"groupId/distributions/artifactId-VERSION-src.tar.bz2",
- handler.constructRepositoryFullPath("distribution-src-tarbz2",
project, VERSION));
- assertEquals("check artifact path",
"groupId/distributions/artifactId-VERSION-src.zip",
- handler.constructRepositoryFullPath("distribution-src-zip",
project, VERSION));
+ assertEquals( "check artifact path",
+ "groupId/distributions/artifactId-VERSION.tar.gz",
+ handler.constructRepositoryFullPath( "distribution-targz", project,
+ VERSION ) );
+ assertEquals( "check artifact path",
+ "groupId/distributions/artifactId-VERSION.tar.bz2",
+ handler.constructRepositoryFullPath( "distribution-tarbz2",
+ project, VERSION ) );
+ assertEquals( "check artifact path",
+ "groupId/distributions/artifactId-VERSION.zip",
+ handler.constructRepositoryFullPath( "distribution-zip", project,
+ VERSION ) );
+ assertEquals( "check artifact path",
+ "groupId/distributions/artifactId-VERSION-src.tar.gz",
+ handler.constructRepositoryFullPath( "distribution-src-targz",
+ project, VERSION ) );
+ assertEquals( "check artifact path",
+ "groupId/distributions/artifactId-VERSION-src.tar.bz2",
+ handler.constructRepositoryFullPath( "distribution-src-tarbz2",
+ project, VERSION ) );
+ assertEquals( "check artifact path",
+ "groupId/distributions/artifactId-VERSION-src.zip",
+ handler.constructRepositoryFullPath( "distribution-src-zip",
+ project, VERSION ) );
}
}
-
Added:
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/package.html
URL:
http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/package.html?rev=413935&view=auto
==============================================================================
---
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/package.html
(added)
+++
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/package.html
Tue Jun 13 10:01:12 2006
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <title>org.apache.maven.dist</title>
+ </head>
+ <body>
+ <p>
+ Test classes for org.apache.maven.test.
+ </p>
+ </body>
+</html>
Propchange:
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/package.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
maven/maven-1/plugins/trunk/dist/src/test/org/apache/maven/dist/package.html
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"