jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jalka...@apache.org
Subject svn commit: r829984 - /incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java
Date Mon, 26 Oct 2009 21:34:23 GMT
Author: jalkanen
Date: Mon Oct 26 21:34:22 2009
New Revision: 829984

URL: http://svn.apache.org/viewvc?rev=829984&view=rev
Log:
Fixed the testAttachmentChange() test to conform to the new API.

Modified:
    incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java

Modified: incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java?rev=829984&r1=829983&r2=829984&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java (original)
+++ incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java Mon Oct
26 21:34:22 2009
@@ -248,19 +248,27 @@
         att = m_engine.getAttachmentManager().getAttachmentInfo("RenamedTest/bar.jpg");
         assertNotNull("barjpg",att);
         
-        att = m_engine.getAttachmentManager().getAttachmentInfo("TestPage/bar.jpg");
-        assertNull("testpage/bar.jpg exists",att);
+        try
+        {
+            att = m_engine.getAttachmentManager().getAttachmentInfo("TestPage/bar.jpg");
+            fail("testpage/bar.jpg exists");
+        }
+        catch( PageNotFoundException e ) {}
         
-        att = m_engine.getAttachmentManager().getAttachmentInfo("TestPage/foo.txt");
-        assertNull("testpage/foo.txt exists",att);
+        try
+        {
+            att = m_engine.getAttachmentManager().getAttachmentInfo("TestPage/foo.txt");
+            fail("testpage/foo.txt exists");
+        }
+        catch( PageNotFoundException e ) {}
         
         Collection<WikiPath> refs = findReferrers("TestPage/bar.jpg");
     
-        assertNull( "oldpage", refs );
+        assertTrue( "oldpage", refs.isEmpty() );
     
         refs = findReferrers( "RenamedTest/bar.jpg" );
         assertEquals( "new size", 1, refs.size() );
-        assertEquals( "wrong ref", "TestPage2", refs.iterator().next() );
+        assertEquals( "wrong ref", WikiPath.valueOf("Main:TestPage2"), refs.iterator().next()
);
     }
 
     public void testSamePage() throws Exception



Mime
View raw message