You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2008/02/23 20:47:03 UTC

svn commit: r630522 - in /incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki: render/ rss/ search/ ui/ util/ xmlrpc/

Author: ajaquith
Date: Sat Feb 23 11:47:00 2008
New Revision: 630522

URL: http://svn.apache.org/viewvc?rev=630522&view=rev
Log:
Initial Stripes component commit.

Modified:
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/CreoleRendererTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/RenderingManagerTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/WysiwygEditingRendererTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/rss/RSSGeneratorTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/search/SearchManagerTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/AllTests.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/InputValidatorTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/util/MailUtilTest.java
    incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/xmlrpc/RPCHandlerTest.java

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/CreoleRendererTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/CreoleRendererTest.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/CreoleRendererTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/CreoleRendererTest.java Sat Feb 23 11:47:00 2008
@@ -29,7 +29,7 @@
     private String render(String s) throws IOException
     {
         WikiPage dummyPage = new WikiPage(m_testEngine,"TestPage");
-        WikiContext ctx = new WikiContext(m_testEngine,dummyPage);
+        WikiContext ctx = m_testEngine.getWikiActionBeanFactory().newViewActionBean( dummyPage );
         
         StringReader in = new StringReader(s);
         

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/RenderingManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/RenderingManagerTest.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/RenderingManagerTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/RenderingManagerTest.java Sat Feb 23 11:47:00 2008
@@ -55,7 +55,7 @@
             WikiPage page = m_engine.getPage( "TestPage" );
             String pagedata = m_engine.getPureText( page );
             
-            WikiContext context = new WikiContext( m_engine, page );
+            WikiContext context = m_engine.getWikiActionBeanFactory().newViewActionBean( page );
             
             MarkupParser p = m_manager.getParser( context, pagedata );
             
@@ -78,7 +78,7 @@
             WikiPage page = m_engine.getPage( "TestPage" );
             String pagedata = m_engine.getPureText( page );
             
-            WikiContext context = new WikiContext( m_engine, page );
+            WikiContext context = m_engine.getWikiActionBeanFactory().newViewActionBean( page );
             
             String html = m_manager.getHTML( context, pagedata );
             

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/WysiwygEditingRendererTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/WysiwygEditingRendererTest.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/WysiwygEditingRendererTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/render/WysiwygEditingRendererTest.java Sat Feb 23 11:47:00 2008
@@ -38,7 +38,7 @@
     private String render(String s) throws IOException
     {
         WikiPage dummyPage = new WikiPage(m_testEngine,"TestPage");
-        WikiContext ctx = new WikiContext(m_testEngine,dummyPage);
+        WikiContext ctx = m_testEngine.getWikiActionBeanFactory().newViewActionBean( dummyPage );
 
         StringReader in = new StringReader(s);
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/rss/RSSGeneratorTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/rss/RSSGeneratorTest.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/rss/RSSGeneratorTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/rss/RSSGeneratorTest.java Sat Feb 23 11:47:00 2008
@@ -63,7 +63,7 @@
 
         RSSGenerator gen = m_testEngine.getRSSGenerator();
 
-        WikiContext context = new WikiContext( m_testEngine, m_testEngine.getPage("TestBlog") );
+        WikiContext context = m_testEngine.getWikiActionBeanFactory().newViewActionBean( m_testEngine.getPage("TestBlog") );
 
         WeblogPlugin blogplugin = new WeblogPlugin();
 
@@ -93,7 +93,7 @@
 
         RSSGenerator gen = m_testEngine.getRSSGenerator();
 
-        WikiContext context = new WikiContext( m_testEngine, m_testEngine.getPage("TestBlog") );
+        WikiContext context = m_testEngine.getWikiActionBeanFactory().newViewActionBean( m_testEngine.getPage("TestBlog") );
 
         WeblogPlugin blogplugin = new WeblogPlugin();
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/search/SearchManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/search/SearchManagerTest.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/search/SearchManagerTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/search/SearchManagerTest.java Sat Feb 23 11:47:00 2008
@@ -7,11 +7,15 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
+import net.sourceforge.stripes.mock.MockHttpServletRequest;
+import net.sourceforge.stripes.mock.MockHttpServletResponse;
+import net.sourceforge.stripes.mock.MockRoundtrip;
 
 import com.ecyrd.jspwiki.SearchResult;
 import com.ecyrd.jspwiki.TestEngine;
-import com.ecyrd.jspwiki.TestHttpServletRequest;
 import com.ecyrd.jspwiki.WikiContext;
+import com.ecyrd.jspwiki.action.EditActionBean;
+import com.ecyrd.jspwiki.action.ViewActionBean;
 
 public class SearchManagerTest extends TestCase
 {
@@ -96,10 +100,12 @@
     {
         String txt = "It was the dawn of the third age of mankind, ten years after the Earth-Minbari War.";
  
-        TestHttpServletRequest request = new TestHttpServletRequest();
-        request.setParameter("page","TestPage");
+        MockRoundtrip trip = m_engine.guestTrip( ViewActionBean.class );
+        MockHttpServletRequest request = trip.getRequest();
+        MockHttpServletResponse response = trip.getResponse();
+        request.getParameterMap().put("page",new String[]{ "TestPage" });
         
-        WikiContext ctx = m_engine.createContext( request, WikiContext.EDIT );
+        WikiContext ctx = (WikiContext)m_engine.getWikiActionBeanFactory().newActionBean( request, response, EditActionBean.class );
         
         m_engine.saveText( ctx, txt );
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/AllTests.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/AllTests.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/AllTests.java Sat Feb 23 11:47:00 2008
@@ -13,12 +13,7 @@
     public static Test suite()
     {
         TestSuite suite = new TestSuite("UI tests");
-        suite.addTest( CommandResolverTest.suite() );
-        suite.addTest( GroupCommandTest.suite() );
         suite.addTest( InputValidatorTest.suite() );
-        suite.addTest( PageCommandTest.suite() );
-        suite.addTest( RedirectCommandTest.suite() );
-        suite.addTest( WikiCommandTest.suite() );
         return suite;
     }
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/InputValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/InputValidatorTest.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/InputValidatorTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/ui/InputValidatorTest.java Sat Feb 23 11:47:00 2008
@@ -12,8 +12,8 @@
 import junit.framework.TestSuite;
 
 import com.ecyrd.jspwiki.TestEngine;
-import com.ecyrd.jspwiki.TestHttpServletRequest;
 import com.ecyrd.jspwiki.WikiSession;
+import com.ecyrd.jspwiki.action.ViewActionBean;
 
 public class InputValidatorTest extends TestCase
 {
@@ -28,7 +28,7 @@
         Properties props = new Properties();
         props.load( TestEngine.findTestProperties() );
         testEngine = new TestEngine( props );
-        WikiSession session = WikiSession.getWikiSession( testEngine, new TestHttpServletRequest() );
+        WikiSession session = WikiSession.getWikiSession( testEngine, testEngine.guestTrip( ViewActionBean.class ).getRequest() );
         val = new InputValidator( TEST, session );
     }
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/util/MailUtilTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/util/MailUtilTest.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/util/MailUtilTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/util/MailUtilTest.java Sat Feb 23 11:47:00 2008
@@ -52,8 +52,7 @@
         
         TestEngine testEngine = new TestEngine( m_props );
         
-        m_context = new WikiContext( testEngine,
-                                     new WikiPage( testEngine, PAGE_NAME ) );
+        m_context = testEngine.getWikiActionBeanFactory().newViewActionBean( new WikiPage( testEngine, PAGE_NAME ) );
     }
 
     public void tearDown()

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/xmlrpc/RPCHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/xmlrpc/RPCHandlerTest.java?rev=630522&r1=630521&r2=630522&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/xmlrpc/RPCHandlerTest.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/tests/com/ecyrd/jspwiki/xmlrpc/RPCHandlerTest.java Sat Feb 23 11:47:00 2008
@@ -30,7 +30,7 @@
         m_engine = new TestEngine( m_props );
 
         m_handler = new RPCHandler();
-        WikiContext ctx = new WikiContext( m_engine, new WikiPage(m_engine, "Dummy") );
+        WikiContext ctx = m_engine.getWikiActionBeanFactory().newViewActionBean( new WikiPage(m_engine, "Dummy") );
         m_handler.initialize( ctx );
     }