maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r1379892 - in /maven/plugins/trunk/maven-changes-plugin/src: main/java/org/apache/maven/plugin/jira/ test/java/org/apache/maven/plugin/jira/
Date Sat, 01 Sep 2012 23:06:54 GMT
Author: dennisl
Date: Sat Sep  1 23:06:54 2012
New Revision: 1379892

URL: http://svn.apache.org/viewvc?rev=1379892&view=rev
Log:
Make fields private wherever possible.
Code formating.

Modified:
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java
    maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTest.java
    maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTest.java

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java?rev=1379892&r1=1379891&r2=1379892&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java
Sat Sep  1 23:06:54 2012
@@ -37,7 +37,7 @@ public class JqlQueryBuilder
     /**
      * Log for debug output.
      */
-    protected Log log;
+    private Log log;
 
     private StringBuilder query = new StringBuilder();
 

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java?rev=1379892&r1=1379891&r2=1379892&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java
Sat Sep  1 23:06:54 2012
@@ -30,7 +30,7 @@ public class UrlBuilder
     private static final String AMPERSAND = "&";
     private static final String QUESTION_MARK = "?";
 
-    StringBuilder query = new StringBuilder();
+    private StringBuilder query = new StringBuilder();
 
     public UrlBuilder( String url, String context )
     {

Modified: maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTest.java?rev=1379892&r1=1379891&r2=1379892&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTest.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JqlQueryBuilderTest.java
Sat Sep  1 23:06:54 2012
@@ -34,8 +34,7 @@ import java.net.URLEncoder;
 public class JqlQueryBuilderTest
     extends TestCase
 {
-
-    public static final String ENCODING = "UTF-8";
+    private static final String ENCODING = "UTF-8";
 
     public void testEmptyQuery()
     {
@@ -49,121 +48,163 @@ public class JqlQueryBuilderTest
     {
         String expected = URLEncoder.encode( "project = DOXIA", ENCODING );
 
-        String actual = createBuilder().project( "DOXIA" ).build();
+        String actual = createBuilder()
+                .project( "DOXIA" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testFixVersion()
         throws UnsupportedEncodingException
     {
+        String expected = URLEncoder.encode( "fixVersion = \"1.0\"",
+                                             ENCODING );
 
-        String expected = URLEncoder.encode( "fixVersion = \"1.0\"", ENCODING );
-
-        String actual = createBuilder().fixVersion( "1.0" ).build();
+        String actual = createBuilder()
+                .fixVersion( "1.0" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testFixVersionCombinedWithOtherParameters()
         throws UnsupportedEncodingException
     {
-        String expected = URLEncoder.encode( "project = DOXIA AND fixVersion = \"1.0\"",
ENCODING );
+        String expected = URLEncoder.encode( "project = DOXIA AND fixVersion = \"1.0\"",
+                                             ENCODING );
 
-        String actual = createBuilder().project( "DOXIA" ).fixVersion( "1.0" ).build();
+        String actual = createBuilder()
+                .project( "DOXIA" )
+                .fixVersion( "1.0" )
+                .build();
         assertEquals( expected, actual );
-
     }
 
     public void testSingleParameterSingleValue()
         throws UnsupportedEncodingException
     {
-        String expected = URLEncoder.encode( "priority in (Blocker)", ENCODING );
+        String expected = URLEncoder.encode( "priority in (Blocker)",
+                                             ENCODING );
 
-        String actual = createBuilder().priorityIds( "Blocker" ).build();
+        String actual = createBuilder()
+                .priorityIds( "Blocker" )
+                .build();
         assertEquals( expected, actual );
 
-        actual = createBuilder().priorityIds( "  Blocker   " ).build();
+        actual = createBuilder()
+                .priorityIds( "  Blocker   " )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testSingleParameterMultipleValues()
         throws UnsupportedEncodingException
     {
+        String expected = URLEncoder.encode( "priority in (Blocker, Critical, Major)",
+                                             ENCODING );
 
-        String expected = URLEncoder.encode( "priority in (Blocker, Critical, Major)", ENCODING
);
-
-        String actual = createBuilder().priorityIds( "Blocker,Critical,Major" ).build();
+        String actual = createBuilder()
+                .priorityIds( "Blocker,Critical,Major" )
+                .build();
         assertEquals( expected, actual );
 
-        actual = createBuilder().priorityIds( "  Blocker  ,  Critical,  Major" ).build();
+        actual = createBuilder()
+                .priorityIds( "  Blocker  ,  Critical,  Major" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testMultipleParameterCombinedWithAND()
         throws UnsupportedEncodingException
     {
+        String expected = URLEncoder.encode( "priority in (Blocker) AND status in (Resolved)",
+                                             ENCODING );
 
-        String expected = URLEncoder.encode( "priority in (Blocker) AND status in (Resolved)",
ENCODING );
-
-        String actual = createBuilder().priorityIds( "Blocker" ).statusIds( "Resolved" ).build();
+        String actual = createBuilder()
+                .priorityIds( "Blocker" )
+                .statusIds( "Resolved" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testValueWithSpacesAreQuoted()
         throws UnsupportedEncodingException
     {
+        String expected = URLEncoder.encode( "status in (\"In Progress\")",
+                                             ENCODING );
 
-        String expected = URLEncoder.encode( "status in (\"In Progress\")", ENCODING );
-
-        String actual = createBuilder().statusIds( "In Progress" ).build();
+        String actual = createBuilder()
+                .statusIds( "In Progress" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testSortSingleRowAscending()
         throws UnsupportedEncodingException
     {
-        String expected = URLEncoder.encode( "project = DOXIA ORDER BY key ASC", ENCODING
);
+        String expected = URLEncoder.encode( "project = DOXIA ORDER BY key ASC",
+                                             ENCODING );
 
-        String actual = createBuilder().project( "DOXIA" ).sortColumnNames( "key" ).build();
+        String actual = createBuilder()
+                .project( "DOXIA" )
+                .sortColumnNames( "key" )
+                .build();
         assertEquals( expected, actual );
 
-        actual = createBuilder().project( "DOXIA" ).sortColumnNames( "key ASC" ).build();
+        actual = createBuilder()
+                .project( "DOXIA" )
+                .sortColumnNames( "key ASC" )
+                .build();
         assertEquals( expected, actual );
 
-        actual = createBuilder().project( "DOXIA" ).sortColumnNames( "     key    ASC   
" ).build();
+        actual = createBuilder()
+                .project( "DOXIA" )
+                .sortColumnNames( "     key    ASC    " )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testSortSingleDescending()
         throws UnsupportedEncodingException
     {
-        String expected = URLEncoder.encode( "project = DOXIA ORDER BY key DESC", ENCODING
);
+        String expected = URLEncoder.encode( "project = DOXIA ORDER BY key DESC",
+                                             ENCODING );
 
-        String actual = createBuilder().project( "DOXIA" ).sortColumnNames( "key DESC" ).build();
+        String actual = createBuilder()
+                .project( "DOXIA" )
+                .sortColumnNames( "key DESC" )
+                .build();
         assertEquals( expected, actual );
 
-        actual = createBuilder().project( "DOXIA" ).sortColumnNames( "     key    DESC  
 " ).build();
+        actual = createBuilder()
+                .project( "DOXIA" )
+                .sortColumnNames( "     key    DESC    " )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testSortMultipleColumns()
         throws UnsupportedEncodingException
     {
-        String expected =
-            URLEncoder.encode( "project = DOXIA ORDER BY key ASC, assignee DESC, reporter
ASC", ENCODING );
+        String expected = URLEncoder.encode( "project = DOXIA ORDER BY key ASC, assignee
DESC, reporter ASC",
+                                             ENCODING );
 
-        String actual =
-            createBuilder().project( "DOXIA" ).sortColumnNames( "key ASC,assignee DESC, reporter
ASC" ).build();
+        String actual = createBuilder()
+                .project( "DOXIA" )
+                .sortColumnNames( "key ASC,assignee DESC, reporter ASC" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testOrderByIsLastElement()
         throws UnsupportedEncodingException
     {
-        String expected =
-            URLEncoder.encode( "project = DOXIA ORDER BY key ASC, assignee DESC, reporter
ASC", ENCODING );
+        String expected = URLEncoder.encode( "project = DOXIA ORDER BY key ASC, assignee
DESC, reporter ASC",
+                                             ENCODING );
 
-        String actual =
-            createBuilder().sortColumnNames( "key ASC,assignee DESC, reporter ASC" ).project(
"DOXIA" ).build();
+        String actual = createBuilder()
+                .sortColumnNames( "key ASC,assignee DESC, reporter ASC" )
+                .project( "DOXIA" )
+                .build();
         assertEquals( expected, actual );
     }
 
@@ -171,4 +212,4 @@ public class JqlQueryBuilderTest
     {
         return new JqlQueryBuilder( new SystemStreamLog() );
     }
-}
\ No newline at end of file
+}

Modified: maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTest.java?rev=1379892&r1=1379891&r2=1379892&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTest.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/UrlBuilderTest.java
Sat Sep  1 23:06:54 2012
@@ -30,35 +30,39 @@ import junit.framework.TestCase;
 public class UrlBuilderTest
     extends TestCase
 {
-
     public void testUrlWithoutParameters()
     {
         String expected = "http://www.jira.com/context";
-        String actual = new UrlBuilder( "http://www.jira.com", "context" ).build();
+        String actual = new UrlBuilder( "http://www.jira.com", "context" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testUrlWithSingleParameter()
     {
         String expected = "http://www.jira.com/context?key1=value1";
-        String actual = new UrlBuilder( "http://www.jira.com", "context" ).addParameter(
"key1", "value1" ).build();
+        String actual = new UrlBuilder( "http://www.jira.com", "context" )
+                .addParameter( "key1", "value1" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testUrlWithMultipleParameters()
     {
         String expected = "http://www.jira.com/context?key1=value1&key2=value2";
-        String actual =
-            new UrlBuilder( "http://www.jira.com", "context" ).addParameter( "key1", "value1"
).addParameter( "key2",
-                                                                                        
                     "value2" ).build();
+        String actual = new UrlBuilder( "http://www.jira.com", "context" )
+                .addParameter( "key1", "value1" )
+                .addParameter( "key2", "value2" )
+                .build();
         assertEquals( expected, actual );
     }
 
     public void testUrlWithIntParameter()
     {
         String expected = "http://www.jira.com/context?key1=1";
-        String actual = new UrlBuilder( "http://www.jira.com", "context" ).addParameter(
"key1", 1 ).build();
+        String actual = new UrlBuilder( "http://www.jira.com", "context" )
+                .addParameter( "key1", 1 )
+                .build();
         assertEquals( expected, actual );
     }
-
 }



Mime
View raw message