You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ja...@apache.org on 2009/10/26 22:34:23 UTC

svn commit: r829984 - /incubator/jspwiki/trunk/tests/java/org/apache/wiki/content/PageRenamerTest.java

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