jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1504731 - in /incubator/jspwiki/trunk: ./ jspwiki-war/ jspwiki-war/src/main/java/org/apache/wiki/ jspwiki-war/src/main/java/org/apache/wiki/event/ jspwiki-war/src/main/java/org/apache/wiki/parser/ jspwiki-war/src/main/webapp/WEB-INF/ jspwi...
Date Fri, 19 Jul 2013 00:25:25 GMT
Author: gmazza
Date: Fri Jul 19 00:25:25 2013
New Revision: 1504731

URL: http://svn.apache.org/r1504731
Log:
Fixed (I hope) failing SearchManagerTest, more Sonar fixes and pom cleanups as mentioned in
Changelog file

Modified:
    incubator/jspwiki/trunk/ChangeLog
    incubator/jspwiki/trunk/jspwiki-war/pom.xml
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/event/WikiEventUtils.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParser.java
    incubator/jspwiki/trunk/jspwiki-war/src/main/webapp/WEB-INF/web.xml
    incubator/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
    incubator/jspwiki/trunk/pom.xml

Modified: incubator/jspwiki/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/ChangeLog?rev=1504731&r1=1504730&r2=1504731&view=diff
==============================================================================
--- incubator/jspwiki/trunk/ChangeLog (original)
+++ incubator/jspwiki/trunk/ChangeLog Fri Jul 19 00:25:25 2013
@@ -1,5 +1,17 @@
 2013-07-18  Glen Mazza (gmazza AT apache DOT org)
 
+       * 2.10.0-svn-21
+
+       * Some Sonar fixes on trailing comments
+
+       * Combined our two maven-war-plugin definitions in jspwiki-war, added a Maven 3 requirement
to the base POM
+         so we can run mvn versions:display-[plugin|dependency]-updates
+       
+       * Tightened up SearchManagerTest, now deleting page created after each test (was failing
on Jenkins although
+         for some reason still working fine on my computer).
+
+2013-07-18  Glen Mazza (gmazza AT apache DOT org)
+
        * 2.10.0-svn-20
 
        * Some Sonar fixes on minor matters.

Modified: incubator/jspwiki/trunk/jspwiki-war/pom.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/pom.xml?rev=1504731&r1=1504730&r2=1504731&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/pom.xml (original)
+++ incubator/jspwiki/trunk/jspwiki-war/pom.xml Fri Jul 19 00:25:25 2013
@@ -242,13 +242,6 @@
         </configuration>
       </plugin>
       
-      <plugin>
-        <artifactId>maven-war-plugin</artifactId>
-        <configuration>
-          <attachClasses>true</attachClasses>
-        </configuration>
-      </plugin>
-      
       <!-- Compress certain CSS and JS files using the YUICompressor 
          (http://alchim.sourceforge.net/yuicompressor-maven-plugin/)
       -->
@@ -312,6 +305,7 @@
       <plugin>
         <artifactId>maven-war-plugin</artifactId>
         <configuration>
+          <attachClasses>true</attachClasses>
           <webResources>
             <resource>
               <directory>src/main/webapp/WEB-INF</directory>

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java?rev=1504731&r1=1504730&r2=1504731&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java (original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/Release.java Fri Jul
19 00:25:25 2013
@@ -75,7 +75,7 @@ public final class Release
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "20";
+    public static final String     BUILD         = "21";
     
     /**
      *  This is the generic version string you should use

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/event/WikiEventUtils.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/event/WikiEventUtils.java?rev=1504731&r1=1504730&r2=1504731&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/event/WikiEventUtils.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/event/WikiEventUtils.java
Fri Jul 19 00:25:25 2013
@@ -100,27 +100,32 @@ public class WikiEventUtils
         // tie us into known types, but WikiEvent.isValidType() will return true so
         // long as the type was set to any non-ERROR or non-UNKNOWN value
 
-        if ( WikiEngineEvent.isValidType(type) ) // add listener directly to WikiEngine
+        if ( WikiEngineEvent.isValidType(type) )
         {
+            // add listener directly to WikiEngine
             WikiEventManager.addWikiEventListener( client, listener );
         }
-        else if ( WikiPageEvent.isValidType(type) ) // add listener to one of several options
+        else if ( WikiPageEvent.isValidType(type) )
         {
+            // add listener to one of several options
             if(  type == WikiPageEvent.PAGE_LOCK
-              || type == WikiPageEvent.PAGE_UNLOCK ) // attach to PageManager
+              || type == WikiPageEvent.PAGE_UNLOCK )
             {
+                // attach to PageManager
                 if( client instanceof WikiEngine )
                 {
                     WikiEventManager.addWikiEventListener( ((WikiEngine)client).getPageManager(),
listener );
                 }
-                else // if ( client instanceof PageManager ) // no filter?
+                else
                 {
+                    // client instanceof PageManager
                     WikiEventManager.addWikiEventListener( client, listener );
                 }
             }
             else if(  type == WikiPageEvent.PAGE_REQUESTED
-                   || type == WikiPageEvent.PAGE_DELIVERED ) // attach directly to WikiServletFilter
+                   || type == WikiPageEvent.PAGE_DELIVERED )
             {
+                // attach directly to WikiServletFilter
                 WikiEventManager.addWikiEventListener( client, listener );
             }
             else if(  type == WikiPageEvent.PRE_TRANSLATE_BEGIN
@@ -130,8 +135,9 @@ public class WikiEventUtils
                    || type == WikiPageEvent.PRE_SAVE_BEGIN
                    || type == WikiPageEvent.PRE_SAVE_END
                    || type == WikiPageEvent.POST_SAVE_BEGIN
-                   || type == WikiPageEvent.POST_SAVE_END ) // attach to FilterManager
+                   || type == WikiPageEvent.POST_SAVE_END )
             {
+                // attach to FilterManager
                 FilterManager fm = ((WikiEngine)client).getFilterManager();
                 WikiEventManager.addWikiEventListener( fm, listener );
             }
@@ -143,17 +149,19 @@ public class WikiEventUtils
                 WikiEventManager.addWikiEventListener( client, listener );
             }
         }
-        else if( WikiSecurityEvent.isValidType(type) ) // add listener to the client
+        else if( WikiSecurityEvent.isValidType(type) )
         {
             // currently just attach it to the client (we are ignorant of other options)
             WikiEventManager.addWikiEventListener( client, listener );
         }
-        else if( WikiEvent.isValidType(type) ) // we don't know what to do
+        else if( WikiEvent.isValidType(type) )
         {
+            // we don't know what to do
             WikiEventManager.addWikiEventListener( client, listener );
         }
-        else // is error or unknown
+        else
         {
+            // is error or unknown
             // why are we being called with this?
         }
     }

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParser.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParser.java?rev=1504731&r1=1504730&r2=1504731&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParser.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/java/org/apache/wiki/parser/LinkParser.java
Fri Jul 19 00:25:25 2013
@@ -202,43 +202,54 @@ public class LinkParser
 
             if ( cut2 == -1 )
             {
-                //  link form 2:  [Acme | http://www.acme.com/]
-                String text = linktext.substring( 0, cut1 ).trim(); // to cut1
-                String ref  = linktext.substring( cut1+1 ).trim();  // cut1 to end
+                // link form 2:  [Acme | http://www.acme.com/]
+                // text = Acme
+                String text = linktext.substring( 0, cut1 ).trim();
+                // ref = http://www.acme.com/
+                String ref  = linktext.substring( cut1+1 ).trim();
                 return new Link( text, ref );
             }
 
-            // otherwise:           link form 3:  [Acme | http://www.acme.com/ | id='foo'
rel='Next']
-            String text    = linktext.substring( 0, cut1 ).trim();      // to cut1
-            String ref     = linktext.substring( cut1+1, cut2 ).trim(); // cut1 to cut2
-            String attribs = linktext.substring( cut2+1 ).trim();       // cut2 to end
+            // link form 3:  [Acme | http://www.acme.com/ | id='foo' rel='Next']
+            String text    = linktext.substring( 0, cut1 ).trim();
+            String ref     = linktext.substring( cut1+1, cut2 ).trim();
+            // attribs = id='foo' rel='Next'
+            String attribs = linktext.substring( cut2+1 ).trim();
 
             link = new Link( text, ref );
 
             // parse attributes
-            if( attribs.indexOf(EQSQUO) != -1 ) // contains "='" that looks like attrib spec
+            // contains "='" that looks like attrib spec
+            if( attribs.indexOf(EQSQUO) != -1 )
             {
                 try
                 {
                     StringTokenizer tok = new StringTokenizer(attribs,DELIMS,true);
                     while ( tok.hasMoreTokens() )
                     {
-                        String token = tok.nextToken(DELIMS).trim(); // get attribute name
token
+                        // get attribute name token
+                        String token = tok.nextToken(DELIMS).trim();
                         while ( isSpace(token) && tok.hasMoreTokens() )
                         {
-                            token = tok.nextToken(DELIMS).trim(); // eat any WS
+                            // remove all whitespace
+                            token = tok.nextToken(DELIMS).trim();
                         }
 
-                        require( tok, EQ ); // eat '=', break after '='
-                        require( tok, SQUO ); // eat opening delim
-                        String value = tok.nextToken(SQUO);  // using existing delim
-                        require( tok, SQUO ); // eat closing delim
+                        // eat '=', break after '='
+                        require( tok, EQ );
+                        // eat opening delim
+                        require( tok, SQUO );
+                        // using existing delim
+                        String value = tok.nextToken(SQUO);
+                        // eat closing delim
+                        require( tok, SQUO );
 
                         if( token != null && value != null )
                         {
                             if( Arrays.binarySearch( PERMITTED_ATTRIBUTES, token ) >=
0 )
                             {
-                                if( !token.equals(TARGET) // _blank _self _parent _top
+                                // _blank _self _parent _top
+                                if( !token.equals(TARGET)
                                         || Arrays.binarySearch( PERMITTED_TARGET_VALUES,
value ) >= 0 )
                                 {
                                     Attribute a = new Attribute(token,value);
@@ -290,7 +301,7 @@ public class LinkParser
         String s = tok.nextToken(required);
         if( !s.equals(required) )
         {
-            throw new ParseException("expected '"+required+"' not '"+s+"'"); // I18N
+            throw new ParseException("expected '"+required+"' not '"+s+"'");
         }
         return s;
     }
@@ -322,13 +333,14 @@ public class LinkParser
      */
     public static final boolean isSpace( char c )
     {
+        // 0x20 = SPACE, 0x0A = LF, 0x0D = CR, 0x09 = TAB, 0x85 = NEL, 0x2028 = Line separator
         return
-           0x20 == c    // SPACE
-        || 0x0A == c    // LF
-        || 0x0D == c    // CR
-        || 0x09 == c    // TAB
-        || 0x85 == c    // NEL
-        || 0x2028 == c; // LS (line separator)
+           0x20 == c
+        || 0x0A == c
+        || 0x0D == c
+        || 0x09 == c
+        || 0x85 == c
+        || 0x2028 == c;
     }
 
 
@@ -560,7 +572,7 @@ public class LinkParser
             return sb.toString();
         }
 
-    } // end inner class
+    }
+    // end inner class
 
 }
-

Modified: incubator/jspwiki/trunk/jspwiki-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/main/webapp/WEB-INF/web.xml?rev=1504731&r1=1504730&r2=1504731&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/main/webapp/WEB-INF/web.xml Fri Jul 19 00:25:25
2013
@@ -26,7 +26,6 @@
    <description>
        JSPWiki is an open source JSP-based WikiClone.  It is licensed
        under the Apache 2.0 license.
-
        For more information, please come to http://www.jspwiki.org/
    </description>
    <display-name>JSPWiki</display-name>
@@ -46,7 +45,7 @@
       execute first. Note that if you configure a filter *before* this one that returns
       non-null values for getUserPrincipal() or getRemoteUser(), WikiSecurityFilter
       will pick the credentials up, and set the user's WikiSession state to
-      "authenticated." WikiServletFlter will also set the WikiSession's' state
+      "authenticated." WikiServletFilter will also set the WikiSession's' state
       to "authenticated" if jspwiki.properties property "jspwiki.cookieAuthentication"
       is set to true, and the user possesses the correct authentication cookie.
 

Modified: incubator/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java?rev=1504731&r1=1504730&r2=1504731&view=diff
==============================================================================
--- incubator/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
(original)
+++ incubator/jspwiki/trunk/jspwiki-war/src/test/java/org/apache/wiki/search/SearchManagerTest.java
Fri Jul 19 00:25:25 2013
@@ -56,8 +56,6 @@ public class SearchManagerTest extends T
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        
-        m_engine.deleteTestPage("TestPage");
     }
 
     public void testDefaultProvider()
@@ -101,6 +99,7 @@ public class SearchManagerTest extends T
         assertEquals( "no pages", 1, res.size() );
         
         assertEquals( "page","TestPage", ((SearchResult)res.iterator().next()).getPage().getName()
);
+        m_engine.deleteTestPage("TestPage");
     }
 
     public void testSimpleSearch2()
@@ -119,6 +118,7 @@ public class SearchManagerTest extends T
         assertEquals( "no pages", 1, res.size() );
     
         assertEquals( "page","TestPage", ((SearchResult)res.iterator().next()).getPage().getName()
);
+        m_engine.deleteTestPage("TestPage");
     }
 
     public void testSimpleSearch3()
@@ -148,6 +148,7 @@ public class SearchManagerTest extends T
         assertEquals( "no pages", 1, res.size() );
      
         assertEquals( "page","TestPage", ((SearchResult)res.iterator().next()).getPage().getName()
);
+        m_engine.deleteTestPage("TestPage");
     }
 
     public void testTitleSearch()
@@ -164,6 +165,7 @@ public class SearchManagerTest extends T
         assertEquals( "no pages", 1, res.size() );
  
         assertEquals( "page","TestPage", ((SearchResult)res.iterator().next()).getPage().getName()
);
+        m_engine.deleteTestPage("TestPage");
     }
 
     public void testTitleSearch2()
@@ -180,10 +182,11 @@ public class SearchManagerTest extends T
         assertEquals( "no pages", 1, res.size() );
 
         assertEquals( "page","TestPage", ((SearchResult)res.iterator().next()).getPage().getName()
);
+        m_engine.deleteTestPage("TestPage");
     }
 
     public static Test suite()
     {
         return new TestSuite( SearchManagerTest.class );
     }
-}
+}
\ No newline at end of file

Modified: incubator/jspwiki/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/pom.xml?rev=1504731&r1=1504730&r2=1504731&view=diff
==============================================================================
--- incubator/jspwiki/trunk/pom.xml (original)
+++ incubator/jspwiki/trunk/pom.xml Fri Jul 19 00:25:25 2013
@@ -42,7 +42,11 @@
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     <jdk.version>1.6</jdk.version>
   </properties>
-  
+
+  <prerequisites>
+    <maven>3.0</maven>
+  </prerequisites>
+
   <scm>
     <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/jspwiki/trunk</connection>
     <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/jspwiki/trunk</developerConnection>



Mime
View raw message