Return-Path: Delivered-To: apmail-roller-commits-archive@www.apache.org Received: (qmail 86963 invoked from network); 7 Apr 2007 18:01:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Apr 2007 18:01:43 -0000 Received: (qmail 19390 invoked by uid 500); 7 Apr 2007 18:01:49 -0000 Delivered-To: apmail-roller-commits-archive@roller.apache.org Received: (qmail 19355 invoked by uid 500); 7 Apr 2007 18:01:49 -0000 Mailing-List: contact commits-help@roller.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@roller.apache.org Delivered-To: mailing list commits@roller.apache.org Received: (qmail 19346 invoked by uid 500); 7 Apr 2007 18:01:49 -0000 Delivered-To: apmail-incubator-roller-commits@incubator.apache.org Received: (qmail 19343 invoked by uid 99); 7 Apr 2007 18:01:49 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Apr 2007 11:01:49 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Apr 2007 11:01:41 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id CDE571A983A; Sat, 7 Apr 2007 11:01:21 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r526462 - in /incubator/roller/trunk/tests/org/apache/roller: business/ ui/ ui/rendering/plugins/ util/ webservices/ webservices/xmlrpc/ Date: Sat, 07 Apr 2007 18:01:21 -0000 To: roller-commits@incubator.apache.org From: snoopdave@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070407180121.CDE571A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: snoopdave Date: Sat Apr 7 11:01:20 2007 New Revision: 526462 URL: http://svn.apache.org/viewvc?view=rev&rev=526462 Log: Fixes to make UI tests run again (broken since Acegi added?) Added: incubator/roller/trunk/tests/org/apache/roller/ui/MockAcegiUserDetailsService.java incubator/roller/trunk/tests/org/apache/roller/ui/UITestSuite.java incubator/roller/trunk/tests/org/apache/roller/util/UtilitiesTestSuite.java incubator/roller/trunk/tests/org/apache/roller/webservices/WebServicesTestSuite.java Modified: incubator/roller/trunk/tests/org/apache/roller/business/PlanetManagerLocalTest.java incubator/roller/trunk/tests/org/apache/roller/business/WeblogEntryTest.java incubator/roller/trunk/tests/org/apache/roller/ui/MockRollerContext.java incubator/roller/trunk/tests/org/apache/roller/ui/ServletTestBase.java incubator/roller/trunk/tests/org/apache/roller/ui/StrutsActionTestBase.java incubator/roller/trunk/tests/org/apache/roller/ui/UIPluginManagerTest.java incubator/roller/trunk/tests/org/apache/roller/ui/rendering/plugins/SmileysTest.java incubator/roller/trunk/tests/org/apache/roller/webservices/xmlrpc/RollerXmlRpcServerTest.java Modified: incubator/roller/trunk/tests/org/apache/roller/business/PlanetManagerLocalTest.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/business/PlanetManagerLocalTest.java?view=diff&rev=526462&r1=526461&r2=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/business/PlanetManagerLocalTest.java (original) +++ incubator/roller/trunk/tests/org/apache/roller/business/PlanetManagerLocalTest.java Sat Apr 7 11:01:20 2007 @@ -27,11 +27,12 @@ import org.apache.roller.TestUtils; import org.apache.roller.planet.business.PlanetFactory; import org.apache.roller.planet.business.PlanetManager; -import org.apache.roller.business.RollerFactory; +import org.apache.roller.planet.pojos.PlanetData; +import org.apache.roller.planet.pojos.PlanetGroupData; import org.apache.roller.pojos.UserData; import org.apache.roller.pojos.WeblogEntryData; import org.apache.roller.pojos.WebsiteData; -import org.apache.roller.planet.tasks.RefreshEntriesTask; +import org.apache.roller.planet.tasks.RefreshPlanetTask; import org.apache.roller.planet.tasks.SyncWebsitesTask; @@ -124,11 +125,12 @@ syncTask.init(); syncTask.run(); - RefreshEntriesTask refreshTask = new RefreshEntriesTask(); - refreshTask.init(); + RefreshPlanetTask refreshTask = new RefreshPlanetTask(); refreshTask.run(); - List agg = planet.getAggregation(null, null, 0, -1); + PlanetData planetObject = planet.getPlanet("default"); + PlanetGroupData group = planet.getGroup(planetObject, "all"); + List agg = planet.getEntries(group, 0, -1); assertEquals(3, agg.size()); } catch (Exception e) { Modified: incubator/roller/trunk/tests/org/apache/roller/business/WeblogEntryTest.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/business/WeblogEntryTest.java?view=diff&rev=526462&r1=526461&r2=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/business/WeblogEntryTest.java (original) +++ incubator/roller/trunk/tests/org/apache/roller/business/WeblogEntryTest.java Sat Apr 7 11:01:20 2007 @@ -213,7 +213,7 @@ // get all (non-future) PUBLISHED entries only entries = null; - entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, null, WeblogEntryData.PUBLISHED, null, null, null, 0, -1); + entries = mgr.getWeblogEntries(testWeblog, null, null, null, null, null, WeblogEntryData.PUBLISHED, null, null, null, null, 0, -1); assertNotNull(entries); assertEquals(3, entries.size()); Added: incubator/roller/trunk/tests/org/apache/roller/ui/MockAcegiUserDetailsService.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/ui/MockAcegiUserDetailsService.java?view=auto&rev=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/ui/MockAcegiUserDetailsService.java (added) +++ incubator/roller/trunk/tests/org/apache/roller/ui/MockAcegiUserDetailsService.java Sat Apr 7 11:01:20 2007 @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. The ASF licenses this file to You + * under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. For additional information regarding + * copyright in this work, please see the NOTICE file in the top level + * directory of this distribution. + */ + +package org.apache.roller.ui; + +import org.acegisecurity.GrantedAuthority; +import org.acegisecurity.GrantedAuthorityImpl; +import org.acegisecurity.userdetails.User; +import org.acegisecurity.userdetails.UserDetails; +import org.acegisecurity.userdetails.UserDetailsService; +import org.acegisecurity.userdetails.UsernameNotFoundException; +import org.springframework.dao.DataAccessException; + +/** + * Mock service that alaways returns user test/test with all authorities. + */ +public class MockAcegiUserDetailsService implements UserDetailsService { + + public UserDetails loadUserByUsername(String string) throws UsernameNotFoundException, DataAccessException { + GrantedAuthority[] authorities = new GrantedAuthority[] { + new GrantedAuthorityImpl("editor"), + new GrantedAuthorityImpl("admin")}; + return new User("test", "test", true, true, true, true, authorities); + } + +} Modified: incubator/roller/trunk/tests/org/apache/roller/ui/MockRollerContext.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/ui/MockRollerContext.java?view=diff&rev=526462&r1=526461&r2=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/ui/MockRollerContext.java (original) +++ incubator/roller/trunk/tests/org/apache/roller/ui/MockRollerContext.java Sat Apr 7 11:01:20 2007 @@ -1 +1 @@ -/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. The ASF licenses this file to You * under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. For additional information regarding * copyright in this work, please see the NOTICE file in the top level * directory of this distribution. */ /* * Created on Mar 4, 2004 */ package org.apache.roller.ui; import java.io.File; import javax.servlet.ServletContext; import javax.servlet.ServletC ontextEvent; import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.roller.RollerException; import org.apache.roller.ui.core.*; /** * @author lance.lavandowska */ public class MockRollerContext extends RollerContext { private static Log mLogger = LogFactory.getFactory().getInstance(MockRollerContext.class); private static ServletContext mContext = null; public void init(ServletContext sc) { mLogger.debug("MockRollerContext initializing"); // initialize super super.contextInitialized(new ServletContextEvent(sc)); // Save context in self and self in context mContext = sc; mContext.setAttribute("org.apache.roller.absoluteContextURL", "/"); } //----------------------------------------------------------------------- /** Because I cannot set the super's values, I have to * overide the methods as well */ public static ServletContext getServletContext() { return mContext; } //----------------------------------------------------------------------- /** Because I cannot set the super's values, I have to * overide the methods as well */ public String getAbsoluteContextUrl() { return ""; } //----------------------------------------------------------------------- /** Because I cannot set the super's values, I have to * overide the methods as well */ public String getAbsoluteContextUrl(HttpServletRequest request) { return "http://localhost:8080/roller"; } //----------------------------------------------------------------------- /** Because I cannot set the super's values, I have to * overide the methods as well */ /* not available anymore ... use the new config classes instead -- Allen G public RollerConfigData getRollerConfig() { ret urn super.getRollerConfig(); } */ //------------------------------------------------------------------------ public String getConfigPath() { String root = System.getProperty("ro.build"); String configPath = root + File.separator + "roller" + File.separator + "WEB-INF" + File.separator + "roller-config.xml"; return configPath; } protected void upgradeDatabaseIfNeeded() throws RollerException { // for now, this is a no-op } } \ No newline at end of file +/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. The ASF licenses this file to You * under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. For additional information regarding * copyright in this work, please see the NOTICE file in the top level * directory of this distribution. */ /* * Created on Mar 4, 2004 */ package org.apache.roller.ui; import java.io.File; import javax.servlet.ServletContext; import javax.servlet.ServletC ontextEvent; import javax.servlet.http.HttpServletRequest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.roller.RollerException; import org.apache.roller.ui.core.*; /** * @author lance.lavandowska */ public class MockRollerContext extends RollerContext { private static Log mLogger = LogFactory.getFactory().getInstance(MockRollerContext.class); private static ServletContext mContext = null; public void init(ServletContext sc) { mLogger.debug("MockRollerContext initializing"); // initialize super super.contextInitialized(new ServletContextEvent(sc)); // Save context in self and self in context mContext = sc; mContext.setAttribute("org.apache.roller.absoluteContextURL", "/"); } //----------------------------------------------------------------------- /** Because I cannot set the super's values, I have t o * overide the methods as well */ public static ServletContext getServletContext() { return mContext; } //----------------------------------------------------------------------- /** Because I cannot set the super's values, I have to * overide the methods as well */ public String getAbsoluteContextUrl() { return ""; } //----------------------------------------------------------------------- /** Because I cannot set the super's values, I have to * overide the methods as well */ public String getAbsoluteContextUrl(HttpServletRequest request) { return "http://localhost:8080/roller"; } } \ No newline at end of file Modified: incubator/roller/trunk/tests/org/apache/roller/ui/ServletTestBase.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/ui/ServletTestBase.java?view=diff&rev=526462&r1=526461&r2=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/ui/ServletTestBase.java (original) +++ incubator/roller/trunk/tests/org/apache/roller/ui/ServletTestBase.java Sat Apr 7 11:01:20 2007 @@ -19,12 +19,11 @@ import com.mockrunner.mock.web.ActionMockObjectFactory; import com.mockrunner.mock.web.MockHttpServletRequest; -import com.mockrunner.mock.web.MockServletConfig; import com.mockrunner.mock.web.MockServletContext; import com.mockrunner.mock.web.WebMockObjectFactory; import com.mockrunner.servlet.ServletTestModule; import com.mockrunner.struts.ActionTestModule; -import com.mockrunner.struts.MapMessageResources; +import java.io.File; import java.io.FileInputStream; @@ -38,6 +37,7 @@ import javax.servlet.jsp.PageContext; import junit.framework.TestCase; +import org.apache.roller.config.RollerRuntimeConfig; import org.apache.roller.ui.core.filters.PersistenceSessionFilter; import org.apache.roller.ui.core.filters.RequestFilter; @@ -47,10 +47,10 @@ * MockRunner mocks for Servlet context, request and JSP factory objects. */ public abstract class ServletTestBase extends TestCase { - protected ServletTestModule servletModule; + protected ServletTestModule servletModule; private WebMockObjectFactory mockFactory; - protected MockRollerContext rollerContext; - protected ActionTestModule strutsModule; // need Struts for message resources + protected MockRollerContext rollerContext; + protected ActionTestModule strutsModule; // need Struts for message resources public void setUp() throws Exception { getMockFactory().refresh(); @@ -58,30 +58,27 @@ servletModule = new ServletTestModule(getMockFactory()); strutsModule = new ActionTestModule(getStrutsMockFactory()); - MockServletContext ctx = getMockFactory().getMockServletContext(); - ctx.setServletContextName("/roller"); - ctx.setRealPath("/", ""); - rollerContext = new MockRollerContext(); - rollerContext.init(ctx); - MockHttpServletRequest request = getMockFactory().getMockRequest(); request.setContextPath("/roller"); + + RollerRuntimeConfig.setAbsoluteContextURL("http://localhost:8080/roller"); JspFactory.setDefaultFactory(new MockJspFactory(getMockFactory())); + + MockServletContext ctx = getMockFactory().getMockServletContext(); + ctx.setServletContextName("/roller"); + ctx.setRealPath("/", "."); + + + ctx.setInitParameter("contextConfigLocation", "WEB-INF/security.xml"); + ctx.setResourceAsStream("/WEB-INF/security.xml", + new FileInputStream("WEB-INF" + File.separator + "security.xml")); - // setup resources needed for running Velocity - MockServletContext app = getMockFactory().getMockServletContext(); - app.addResourcePath("/WEB-INF/toolbox.xml","/WEB-INF/toolbox.xml"); - app.setResourceAsStream( - "/WEB-INF/toolbox.xml", - new FileInputStream("./WEB-INF/toolbox.xml")); - MockServletConfig config = getMockFactory().getMockServletConfig(); - config.setInitParameter( - "org.apache.velocity.properties","WEB-INF/velocity.properties"); - MapMessageResources resources = new MapMessageResources(); - resources.putMessages( - "WEB-INF/classes/ApplicationResources.properties"); - strutsModule.setResources(resources); + ctx.setResourceAsStream("/WEB-INF/velocity.properties", + new FileInputStream("WEB-INF" + File.separator + "velocity.properties")); + + rollerContext = new MockRollerContext(); + rollerContext.init(ctx); } /** Convenience method for placing username in role via mockRequest. */ Modified: incubator/roller/trunk/tests/org/apache/roller/ui/StrutsActionTestBase.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/ui/StrutsActionTestBase.java?view=diff&rev=526462&r1=526461&r2=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/ui/StrutsActionTestBase.java (original) +++ incubator/roller/trunk/tests/org/apache/roller/ui/StrutsActionTestBase.java Sat Apr 7 11:01:20 2007 @@ -18,6 +18,8 @@ package org.apache.roller.ui; +import com.mockrunner.mock.jdbc.JDBCMockObjectFactory; +import com.mockrunner.mock.jdbc.MockDataSource; import com.mockrunner.mock.web.ActionMockObjectFactory; import com.mockrunner.mock.web.MockHttpServletRequest; import com.mockrunner.mock.web.MockServletContext; @@ -25,6 +27,9 @@ import com.mockrunner.servlet.ServletTestModule; import com.mockrunner.struts.ActionTestModule; import com.mockrunner.struts.MapMessageResources; +import java.io.File; +import java.io.FileInputStream; +import javax.naming.InitialContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; @@ -35,9 +40,8 @@ import org.apache.roller.RollerException; import org.apache.roller.business.RollerFactory; import org.apache.roller.business.UserManager; +import org.apache.roller.config.RollerRuntimeConfig; import org.apache.roller.pojos.UserData; -import org.apache.roller.ui.MockPrincipal; -import org.apache.roller.ui.MockRollerContext; import org.apache.roller.ui.core.RollerSession; import org.apache.roller.ui.core.filters.PersistenceSessionFilter; import org.apache.roller.ui.core.filters.RequestFilter; @@ -58,13 +62,25 @@ strutsModule = new ActionTestModule(getStrutsMockFactory()); servletModule = new ServletTestModule(getStrutsMockFactory()); - // Setup mocks needed to run a Struts action + // Setup mocks needed to run a Struts action + MapMessageResources resources = new MapMessageResources(); resources.putMessages("WEB-INF/classes/ApplicationResources.properties"); strutsModule.setResources(resources); + RollerRuntimeConfig.setAbsoluteContextURL("http://localhost:8080/roller"); + MockServletContext ctx = getMockFactory().getMockServletContext(); - ctx.setRealPath("/", ""); + ctx.setServletContextName("/roller"); + ctx.setRealPath("/", "."); + + ctx.setInitParameter("contextConfigLocation", "WEB-INF/security.xml"); + ctx.setResourceAsStream("/WEB-INF/security.xml", + new FileInputStream("WEB-INF" + File.separator + "security.xml")); + + ctx.setResourceAsStream("/WEB-INF/velocity.properties", + new FileInputStream("WEB-INF" + File.separator + "velocity.properties")); + rollerContext = new MockRollerContext(); rollerContext.init(ctx); } Modified: incubator/roller/trunk/tests/org/apache/roller/ui/UIPluginManagerTest.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/ui/UIPluginManagerTest.java?view=diff&rev=526462&r1=526461&r2=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/ui/UIPluginManagerTest.java (original) +++ incubator/roller/trunk/tests/org/apache/roller/ui/UIPluginManagerTest.java Sat Apr 7 11:01:20 2007 @@ -57,10 +57,10 @@ assertEquals(2, pmgr.getWeblogEntryEditors().size()); // test getting a single editor - assertEquals("TextEditor", pmgr.getWeblogEntryEditor("TextEditor").getId()); + assertEquals("editor-text.jsp", pmgr.getWeblogEntryEditor("TextEditor").getId()); // make sure we return default editor if editor id is not found - assertEquals("TextEditor", pmgr.getWeblogEntryEditor(null).getId()); + assertEquals("editor-text.jsp", pmgr.getWeblogEntryEditor(null).getId()); } } Added: incubator/roller/trunk/tests/org/apache/roller/ui/UITestSuite.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/ui/UITestSuite.java?view=auto&rev=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/ui/UITestSuite.java (added) +++ incubator/roller/trunk/tests/org/apache/roller/ui/UITestSuite.java Sat Apr 7 11:01:20 2007 @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. The ASF licenses this file to You + * under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. For additional information regarding + * copyright in this work, please see the NOTICE file in the top level + * directory of this distribution. + */ + +package org.apache.roller.ui; + +import junit.framework.Test; +import junit.framework.TestSuite; +import org.apache.roller.ui.authoring.struts.actions.BookmarksActionTest; +import org.apache.roller.ui.authoring.struts.actions.WeblogEntryActionTest; +import org.apache.roller.ui.rendering.plugins.SmileysTest; +import org.apache.roller.ui.rendering.util.CommentValidatorTest; + + +/** + * Test UI classes, some tests require mock web container. + */ +public class UITestSuite { + + public static Test suite() { + + TestSuite suite = new TestSuite(); + + suite.addTestSuite(CommentValidatorTest.class); + + suite.addTestSuite(BookmarksActionTest.class); + suite.addTestSuite(WeblogEntryActionTest.class); + + suite.addTestSuite(UIPluginManagerTest.class); + + suite.addTestSuite(SmileysTest.class); + + return suite; + } + +} Modified: incubator/roller/trunk/tests/org/apache/roller/ui/rendering/plugins/SmileysTest.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/ui/rendering/plugins/SmileysTest.java?view=diff&rev=526462&r1=526461&r2=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/ui/rendering/plugins/SmileysTest.java (original) +++ incubator/roller/trunk/tests/org/apache/roller/ui/rendering/plugins/SmileysTest.java Sat Apr 7 11:01:20 2007 @@ -25,9 +25,8 @@ import org.apache.roller.TestUtils; import org.apache.roller.pojos.UserData; import org.apache.roller.pojos.WebsiteData; -import org.apache.roller.ui.authoring.struts.actions.WeblogEntryActionTest; import org.apache.roller.ui.ServletTestBase; - +import org.apache.roller.ui.authoring.struts.actions.WeblogEntryActionTest; /** * Test smileys plugin. Added: incubator/roller/trunk/tests/org/apache/roller/util/UtilitiesTestSuite.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/util/UtilitiesTestSuite.java?view=auto&rev=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/util/UtilitiesTestSuite.java (added) +++ incubator/roller/trunk/tests/org/apache/roller/util/UtilitiesTestSuite.java Sat Apr 7 11:01:20 2007 @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. The ASF licenses this file to You + * under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. For additional information regarding + * copyright in this work, please see the NOTICE file in the top level + * directory of this distribution. + */ + +package org.apache.roller.util; + +import junit.framework.Test; +import junit.framework.TestSuite; + + +/** + * Test various Roller utility classes that do not require a database or container. + */ +public class UtilitiesTestSuite { + + public static Test suite() { + + TestSuite suite = new TestSuite(); + + suite.addTestSuite(BlacklistTest.class); + suite.addTestSuite(LRUCache2Test.class); + suite.addTestSuite(LinkbackExtractorTest.class); + suite.addTestSuite(PropertyExpanderTest.class); + suite.addTestSuite(RegexUtilTest.class); + suite.addTestSuite(UtilitiesTest.class); + + return suite; + } + +} Added: incubator/roller/trunk/tests/org/apache/roller/webservices/WebServicesTestSuite.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/webservices/WebServicesTestSuite.java?view=auto&rev=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/webservices/WebServicesTestSuite.java (added) +++ incubator/roller/trunk/tests/org/apache/roller/webservices/WebServicesTestSuite.java Sat Apr 7 11:01:20 2007 @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. The ASF licenses this file to You + * under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. For additional information regarding + * copyright in this work, please see the NOTICE file in the top level + * directory of this distribution. + */ + +package org.apache.roller.webservices; + +import junit.framework.Test; +import junit.framework.TestSuite; +import org.apache.roller.webservices.adminapi.AappTest; +import org.apache.roller.webservices.adminapi.HandlerBaseTest; +import org.apache.roller.webservices.adminapi.MemberHandlerTest; +import org.apache.roller.webservices.adminapi.UserHandlerTest; +import org.apache.roller.webservices.adminapi.WeblogHandlerTest; +import org.apache.roller.webservices.adminapi.sdk.MemberEntryTest; +import org.apache.roller.webservices.adminapi.sdk.UserEntryTest; +import org.apache.roller.webservices.adminapi.sdk.WeblogEntryTest; +import org.apache.roller.webservices.xmlrpc.RollerXmlRpcServerTest; + + +/** + * Test web services classes, some tests require mock web container. + */ +public class WebServicesTestSuite { + + public static Test suite() { + + TestSuite suite = new TestSuite(); + + suite.addTestSuite(RollerXmlRpcServerTest.class); + + suite.addTestSuite(AappTest.class); + suite.addTestSuite(HandlerBaseTest.class); + suite.addTestSuite(MemberHandlerTest.class); + suite.addTestSuite(UserHandlerTest.class); + suite.addTestSuite(WeblogHandlerTest.class); + + suite.addTestSuite(MemberEntryTest.class); + suite.addTestSuite(UserEntryTest.class); + suite.addTestSuite(WeblogEntryTest.class); + + return suite; + } + +} Modified: incubator/roller/trunk/tests/org/apache/roller/webservices/xmlrpc/RollerXmlRpcServerTest.java URL: http://svn.apache.org/viewvc/incubator/roller/trunk/tests/org/apache/roller/webservices/xmlrpc/RollerXmlRpcServerTest.java?view=diff&rev=526462&r1=526461&r2=526462 ============================================================================== --- incubator/roller/trunk/tests/org/apache/roller/webservices/xmlrpc/RollerXmlRpcServerTest.java (original) +++ incubator/roller/trunk/tests/org/apache/roller/webservices/xmlrpc/RollerXmlRpcServerTest.java Sat Apr 7 11:01:20 2007 @@ -48,6 +48,8 @@ import org.apache.roller.ui.MockRollerContext; import org.apache.roller.ui.core.RollerRequest; import org.apache.roller.util.RegexUtil; +import org.apache.xmlrpc.webserver.XmlRpcServlet; + /** * Makes calls to the RollerXmlRpcServer, which should handle a @@ -160,7 +162,7 @@ mockRequest, mockFactory.getMockServletContext()); servletTestModule = new ServletTestModule(mockFactory); - servletTestModule.createServlet(RollerXMLRPCServlet.class); + servletTestModule.createServlet(XmlRpcServlet.class); testUser = TestUtils.setupUser("entryTestUser"); testWeblog = TestUtils.setupWeblog("entryTestWeblog", testUser);