You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2014/06/28 13:16:27 UTC

svn commit: r1606317 - in /maven/doxia/doxia/trunk: doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java pom.xml

Author: hboutemy
Date: Sat Jun 28 11:16:26 2014
New Revision: 1606317

URL: http://svn.apache.org/r1606317
Log: (empty)

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java
    maven/doxia/doxia/trunk/pom.xml

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java?rev=1606317&r1=1606316&r2=1606317&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java Sat Jun 28 11:16:26 2014
@@ -207,6 +207,7 @@ public class SnippetMacro
             }
             catch ( IOException e )
             {
+                getLog().debug( "IOException which reading " + url + ": " + e );
                 result = new StringBuffer( "Error during retrieving content skip as ignoreDownloadError activated." );
             }
 

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java?rev=1606317&r1=1606316&r2=1606317&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java Sat Jun 28 11:16:26 2014
@@ -24,6 +24,8 @@ import org.apache.maven.doxia.macro.Macr
 import org.apache.maven.doxia.sink.SinkEventElement;
 import org.apache.maven.doxia.sink.SinkEventTestingSink;
 import org.codehaus.plexus.PlexusTestCase;
+import org.hamcrest.CoreMatchers;
+import org.junit.Assert;
 
 import java.io.File;
 import java.util.HashMap;
@@ -128,7 +130,7 @@ public class SnippetMacroTest
         assertFalse( it.hasNext() );
 
         // no need to verify the absence of the first and second snippets if tests above were successful
-        assertTrue( snippet.contains( "Этот сниппет в формате Unicode (UTF-8)" ) );
+        Assert.assertThat( snippet, CoreMatchers.containsString( "Этот сниппет в формате Unicode (UTF-8)" ) );
     }
 
     public void testIgnoreDownloadError()
@@ -137,7 +139,6 @@ public class SnippetMacroTest
         Map<String, Object> macroParameters = new HashMap<String, Object>();
         macroParameters.put( "debug", "true" );
         macroParameters.put( "ignoreDownloadError", "true" );
-
         macroParameters.put( "url", "http://foo.bar.com/wine.txt" );
 
         File basedir = new File( getBasedir() );
@@ -147,12 +148,12 @@ public class SnippetMacroTest
         MacroRequest request = new MacroRequest( macroParameters, basedir );
         SnippetMacro macro = new SnippetMacro();
         macro.execute( sink, request );
+
         Iterator<SinkEventElement> it = sink.getEventList().iterator();
         assertEquals( "verbatim", ( it.next() ).getName() );
         SinkEventElement event = it.next();
         assertEquals( "text", event.getName() );
         String snippet = (String) event.getArgs()[0];
-        assertTrue( snippet.contains( "Error during retrieving content" ) );
-
+        Assert.assertThat( snippet, CoreMatchers.containsString( "Error during retrieving content" ) );
     }
 }

Modified: maven/doxia/doxia/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/pom.xml?rev=1606317&r1=1606316&r2=1606317&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/pom.xml (original)
+++ maven/doxia/doxia/trunk/pom.xml Sat Jun 28 11:16:26 2014
@@ -305,7 +305,7 @@ under the License.
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>4.10</version>
+      <version>4.11</version>
       <scope>test</scope>
     </dependency>
   </dependencies>