/*
 * Copyright 2007, 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.
 *
 */
package com.xpn.xwiki.test;

import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.Project;

/**
 * Allow logging Ant messages to the console. This is used by the {@link XWikiTestSetup
 */
public class AntBuildListener implements BuildListener
{
    private boolean isDebugModeOn;

    public AntBuildListener(boolean isDebugModeOn)
    {
        this.isDebugModeOn = isDebugModeOn;
    }

    public void buildStarted(BuildEvent event) {
        // Voluntarily do nothing
    }

    public void buildFinished(BuildEvent event) {
        // Voluntarily do nothing
    }

    public void targetStarted(BuildEvent event) {
        // Voluntarily do nothing
    }

    public void targetFinished(BuildEvent event) {
        // Voluntarily do nothing
    }

    public void taskStarted(BuildEvent event) {
        // Voluntarily do nothing
    }

    public void taskFinished(BuildEvent event) {
        // Voluntarily do nothing
    }

    public void messageLogged(BuildEvent event)
    {
        if ((event.getPriority() != Project.MSG_DEBUG) || isDebugModeOn) {
            System.out.println(event.getMessage());
        }
    }
}

@@ -1112,23 +1112,94 @@
 link
- XWikiTestSetup
+%0A * com.xpn.xwiki.test.XWikiTestSetup%7D class which uses Ant tasks to start/stop XWiki.
 %0A */
@@ -1292,16 +1292,115 @@
 odeOn;%0A%0A
+    /**%0A     * @param isDebugModeOn if true then display debug messages too on the console%0A     */%0A
     publ
@@ -1537,32 +1537,36 @@
 uildEvent event)
+%0A   
  %7B%0A        // Vo
@@ -1632,32 +1632,36 @@
 uildEvent event)
+%0A   
  %7B%0A        // Vo
@@ -1727,32 +1727,36 @@
 uildEvent event)
+%0A   
  %7B%0A        // Vo
@@ -1823,32 +1823,36 @@
 uildEvent event)
+%0A   
  %7B%0A        // Vo
@@ -1916,32 +1916,36 @@
 uildEvent event)
+%0A   
  %7B%0A        // Vo
@@ -2018,16 +2018,20 @@
 t event)
+%0A   
  %7B%0A     

Add new shared-test module for test framework classes shared between functional modules