Author: dennisl
Date: Fri Jun 16 15:24:06 2006
New Revision: 414948

URL: http://svn.apache.org/viewvc?rev=414948&view=rev
Log:
Add PluginConfigurationConverter for maven-changes-plugin

Added:
    
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/plugins/PCCChanges.java
   (with props)
    
maven/sandbox/plugins/maven-maven1-plugin/src/test/java/org/apache/maven/maven1converter/plugins/PCCChangesTest.java
   (with props)
    
maven/sandbox/plugins/maven-maven1-plugin/src/test/resources/PCCChangesTest.properties
   (with props)
Modified:
    
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java

Modified: 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java?rev=414948&r1=414947&r2=414948&view=diff
==============================================================================
--- 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java
 (original)
+++ 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/PomV3ConvertMojo.java
 Fri Jun 16 15:24:06 2006
@@ -25,6 +25,7 @@
 import java.io.Writer;
 import java.util.Properties;
 
+import org.apache.maven.maven1converter.plugins.PCCChanges;
 import org.apache.maven.maven1converter.plugins.PCCCheckstyle;
 import org.apache.maven.maven1converter.plugins.PCCCompiler;
 import org.apache.maven.maven1converter.plugins.PCCJar;
@@ -69,6 +70,7 @@
      * Available converters for specific plugin configurations
      */
     private PluginConfigurationConverter[] converters = new 
PluginConfigurationConverter[] {
+        new PCCChanges(),
         new PCCCheckstyle(),
         new PCCCompiler(),
         new PCCJar(),

Added: 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/plugins/PCCChanges.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/plugins/PCCChanges.java?rev=414948&view=auto
==============================================================================
--- 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/plugins/PCCChanges.java
 (added)
+++ 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/plugins/PCCChanges.java
 Fri Jun 16 15:24:06 2006
@@ -0,0 +1,51 @@
+package org.apache.maven.maven1converter.plugins;
+
+/*
+ * Copyright 2006 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.plugin.MojoExecutionException;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+
+import java.util.Properties;
+
+/**
+ * A <code>PluginConfigurationConverter</code> for the maven-changes-plugin.
+ *
+ * @author Dennis Lundberg
+ * @version $Id: PCCChanges.java 409264 2006-05-24 23:13:13 +0000 (on, 24 maj 
2006) carlos $
+ */
+public class PCCChanges extends AbstractPluginConfigurationConverter
+{
+    /**
+     * @see 
org.apache.maven.maven1converter.plugins.AbstractPluginConfigurationConverter#getArtifactId()
+     */
+    public String getArtifactId()
+    {
+        return "maven-changes-plugin";
+    }
+
+    public String getType()
+    {
+        return TYPE_REPORT_PLUGIN;
+    }
+
+    protected void buildConfiguration( Xpp3Dom configuration, 
org.apache.maven.model.v3_0_0.Model v3Model,
+                                       Properties projectProperties )
+        throws MojoExecutionException
+    {
+        addConfigurationChild( configuration, projectProperties, 
"maven.changes.issue.template", "link_template" );
+    }
+}

Propchange: 
maven/sandbox/plugins/maven-maven1-plugin/src/main/java/org/apache/maven/maven1converter/plugins/PCCChanges.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
maven/sandbox/plugins/maven-maven1-plugin/src/test/java/org/apache/maven/maven1converter/plugins/PCCChangesTest.java
URL: 
http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-maven1-plugin/src/test/java/org/apache/maven/maven1converter/plugins/PCCChangesTest.java?rev=414948&view=auto
==============================================================================
--- 
maven/sandbox/plugins/maven-maven1-plugin/src/test/java/org/apache/maven/maven1converter/plugins/PCCChangesTest.java
 (added)
+++ 
maven/sandbox/plugins/maven-maven1-plugin/src/test/java/org/apache/maven/maven1converter/plugins/PCCChangesTest.java
 Fri Jun 16 15:24:06 2006
@@ -0,0 +1,58 @@
+package org.apache.maven.maven1converter.plugins;
+
+/*
+ * Copyright 2006 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 junit.framework.Assert;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import java.io.IOException;
+
+/**
+ * @author Dennis Lundberg
+ * @version $Id: PCCChangesTest.java 409264 2006-05-24 23:13:13 +0000 (on, 24 
maj 2006) carlos $
+ */
+public class PCCChangesTest extends AbstractPCCTest
+{
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        pluginConfigurationConverter = new PCCChanges();
+    }
+
+    public void testBuildConfiguration()
+    {
+        try
+        {
+            projectProperties.load( getClassLoader().getResourceAsStream( 
"PCCChangesTest.properties" ) );
+
+            pluginConfigurationConverter.buildConfiguration( configuration, 
v3Model, projectProperties );
+
+            String value = configuration.getChild( "link_template" 
).getValue();
+            Assert.assertEquals( "check link_template value", 
"%URL%/browse/%ISSUE%", value );
+        }
+        catch ( MojoExecutionException e )
+        {
+            Assert.fail( e.getMessage() );
+        }
+        catch ( IOException e )
+        {
+            Assert.fail( "Unable to find the requested resource." );
+        }
+    }
+}

Propchange: 
maven/sandbox/plugins/maven-maven1-plugin/src/test/java/org/apache/maven/maven1converter/plugins/PCCChangesTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
maven/sandbox/plugins/maven-maven1-plugin/src/test/resources/PCCChangesTest.properties
URL: 
http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-maven1-plugin/src/test/resources/PCCChangesTest.properties?rev=414948&view=auto
==============================================================================
--- 
maven/sandbox/plugins/maven-maven1-plugin/src/test/resources/PCCChangesTest.properties
 (added)
+++ 
maven/sandbox/plugins/maven-maven1-plugin/src/test/resources/PCCChangesTest.properties
 Fri Jun 16 15:24:06 2006
@@ -0,0 +1,15 @@
+#   Copyright 2006 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.
+
+maven.changes.issue.template=%URL%/browse/%ISSUE%

Propchange: 
maven/sandbox/plugins/maven-maven1-plugin/src/test/resources/PCCChangesTest.properties
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to