r1565 - in xwiki/trunk: . core/src/test core/src/test/java core/src/test/java/com core/src/test/java/com/xpn core/src/test/java/com/xpn/xwiki core/src/test/java/com/xpn/xwiki/atom src/test/java/com/xpn/xwiki
Vincent Massol
vmassol at users.forge.objectweb.org
Wed Nov 15 10:00:56 CET 2006
Author: vmassol
Date: 2006-11-15 10:00:55 +0100 (Wed, 15 Nov 2006)
New Revision: 1565
Added:
xwiki/trunk/core/src/test/java/
xwiki/trunk/core/src/test/java/com/
xwiki/trunk/core/src/test/java/com/xpn/
xwiki/trunk/core/src/test/java/com/xpn/xwiki/
xwiki/trunk/core/src/test/java/com/xpn/xwiki/atom/
Removed:
xwiki/trunk/core/src/test/java/com/xpn/xwiki/atom/XWikiHelperTest.java
xwiki/trunk/src/test/java/com/xpn/xwiki/atom/
Modified:
xwiki/trunk/build.xml
Log:
XWIKI-12: Reorganize directory structure to match Maven2 best practices and cleanup build
* First stab at moving tests from src/test/java to core/src/test/java
* Moved one test: WSSEHeaderTest
* Removed XWikiHelperTest as it's all commented out. It can always be found in the svn history later on should it be needed (but I doubt it)
* The Ant build will currently run the tests from both src/test and core/src/test.
Modified: xwiki/trunk/build.xml
===================================================================
--- xwiki/trunk/build.xml 2006-11-15 03:57:25 UTC (rev 1564)
+++ xwiki/trunk/build.xml 2006-11-15 09:00:55 UTC (rev 1565)
@@ -50,8 +50,10 @@
<property name="core.dir" value="${basedir}/core" />
<property name="core.src.dir" value="${core.dir}/src" />
<property name="core.main.src.dir" value="${core.src.dir}/main" />
+ <property name="core.test.src.dir" value="${core.src.dir}/test" />
<property name="core.java.main.src.dir" value="${core.main.src.dir}/java" />
<property name="core.resources.main.src.dir" value="${core.main.src.dir}/resources" />
+ <property name="core.test.main.src.dir" value="${core.test.src.dir}/java" />
<property name="web.dir" value="${basedir}/web" />
<property name="web.standard.dir" value="${web.dir}/standard" />
@@ -330,12 +332,40 @@
<src path="${java.test.src.dir}" />
<src path="${cactus.test.src.dir}" />
</javac>
+ <!-- We're currently migrating the unit tests to the core/src/test directory. During this
+ migration we need to compile tests in both locations -->
+ <javac destdir="${tests.build.dir}"
+ classpath="${libs};${libs.tests};${tests.build.dir};${classes.dir}"
+ debug="on" optimize="on" deprecation="on" source="1.4"
+ sourcepath=""
+ encoding="ISO-8859-1" >
+ <src path="${core.test.main.src.dir}" />
+ </javac>
</target>
<target name="test.client" depends="xwiki, tests">
<mkdir dir="${test.reports.dir}" />
- <!-- TODO: Remove the dir attibute which should not be needed if all tests get
+ <!-- We're currently migrating the unit tests to the core/src/test directory. During this
+ migration we need to run tests in both locations -->
+ <junit printsummary="yes" dir="${tests.build.dir}" haltonfailure="no" fork="on" maxmemory="1400m">
+ <classpath>
+ <pathelement path="${tests.build.dir}" />
+ <pathelement path="${classes.dir}" />
+ <pathelement path="${libs}" />
+ <pathelement path="${libs.tests}" />
+ </classpath>
+ <formatter type="xml" />
+
+ <batchtest todir="${test.reports.dir}">
+ <fileset dir="${core.test.main.src.dir}">
+ <include name="**/*Test.java"/>
+ <exclude name="**/Abstract*.java"/>
+ </fileset>
+ </batchtest>
+ </junit>
+
+ <!-- TODO: Remove the dir attibute which should not be needed if all tests get
their resources from the classpath -->
<junit printsummary="yes" dir="${tests.build.dir}" haltonfailure="no" fork="on" maxmemory="1400m">
@@ -366,6 +396,7 @@
</fileset>
</batchtest>
</junit>
+
</target>
<target name="test.server.prepare" depends="release,prepare-tests">
Copied: xwiki/trunk/core/src/test/java/com/xpn/xwiki/atom (from rev 1527, xwiki/trunk/src/test/java/com/xpn/xwiki/atom)
Deleted: xwiki/trunk/core/src/test/java/com/xpn/xwiki/atom/XWikiHelperTest.java
===================================================================
--- xwiki/trunk/src/test/java/com/xpn/xwiki/atom/XWikiHelperTest.java 2006-11-09 09:01:03 UTC (rev 1527)
+++ xwiki/trunk/core/src/test/java/com/xpn/xwiki/atom/XWikiHelperTest.java 2006-11-15 09:00:55 UTC (rev 1565)
@@ -1,68 +0,0 @@
-/*
- * Copyright 2006, XpertNet SARL, and individual contributors as indicated
- * by the contributors.txt.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
- * @author ludovic
- * @author vmassol
- */
-package com.xpn.xwiki.atom;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts.action.ActionMapping;
-import org.jmock.Mock;
-
-import com.xpn.xwiki.XWikiException;
-
-public class XWikiHelperTest extends org.jmock.cglib.MockObjectTestCase {
-
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /*
- TODO: this test is known to fail
- public void testInitXWikiContextNotNull() throws XWikiException {
- // Create mocks
- Mock mockActionMapping = mock(ActionMapping.class, "mockActionMapping");
- Mock mockServletRequest = mock(HttpServletRequest.class, "mockServletRequest");
- Mock mockServletResponse = mock(HttpServletResponse.class, "mockServletResponse");
- Mock mockServletContext = mock(ServletContext.class, "mockServletContext");
-
- // Set expectations
- mockServletRequest.expects(once()).method("getRequestURL").will(returnValue(new StringBuffer("http://127.0.0.1:9080/xwiki/bin/lifeblog")));
- mockServletRequest.expects(once()).method("getQueryString").will(returnValue(""));
- mockServletRequest.expects(once()).method("getServletPath").will(returnValue("/bin/lifeblog"));
-
- XWikiHelper xwikiHelper = new XWikiHelper();
- xwikiHelper.initXWikiContext(
- "lifeblog",
- (HttpServletRequest)mockServletRequest.proxy(),
- (HttpServletResponse)mockServletResponse.proxy(),
- (ServletContext)mockServletContext.proxy());
-
- assertNotNull("XWikiContext should not be null", xwikiHelper.getXwikiContext());
- }
- */
-}
More information about the Xwiki-notifications
mailing list