/**
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 2005 Bull S.A.
 * Contact: jonas-team@objectweb.org
 *
 * This library 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 1any later version.
 *
 * This library 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 library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.jonasadmin.test.service.jtm;

import javax.management.MBeanServerConnection;
import javax.management.ObjectName;

import junit.framework.TestSuite;

import org.objectweb.jonas.jonasadmin.test.util.JonasAdminAuth;
import org.objectweb.jonas.jonasadmin.test.util.JonasAdminTestCase;
import org.objectweb.jonas.jonasadmin.test.util.JonasAdminUtils;

import com.meterware.httpunit.Button;
import com.meterware.httpunit.HttpUnitOptions;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebForm;
import com.meterware.httpunit.WebLink;
import com.meterware.httpunit.WebResponse;
import com.meterware.httpunit.WebTable;

/**
 * Class for testing transaction service
 * @author Paul Kemler
 *
 */
public class F_JonasAdminServiceTransaction extends JonasAdminTestCase {

    /**
     * URL of transaction
     */
    private static final String URL_JONASADMIN_TRANSACTION = "EditJtmService.do";

    /**
     * URL of transaction Statistics
     */
    private static final String URL_JONASADMIN_TRANSACTION_STATISTICS = "EditTransactionStatistic.do";

    /**
     * URL of transaction Monitor
     */
    private static final String URL_JONASADMIN_TRANSACTION_MONITOR = "EditTransactionMonitor.do";

    /**
     * URL of transaction Recovery
     */
    private static final String URL_JONASADMIN_TRANSACTION_RECOVERY = "EditTransactionRecovery.do";

    /**
     * URL of reset button
     */
    private static final String URL_JONASADMIN_TRANSACTION_RESET = "ResetCounters.do";

    /**
     * number of tabs when you are in the transaction tabs
     */
    private static final int NUMBER_OF_TABS_FOR_TRANSACTION = 4;

    /**
     * Constructor with a specified name
     * @param s name
     */
    public F_JonasAdminServiceTransaction(String s) {
        super(s, URL_JONASADMIN);
    }

    /**
     * Main method
     * @param args the arguments
     */
    public static void main(String[] args) {

        String testtorun = null;
        // Get args
        for (int argn = 0; argn < args.length; argn++) {
            String sArg = args[argn];
            if (sArg.equals("-n")) {
                testtorun = args[++argn];
            }
        }
        if (testtorun == null) {
            junit.textui.TestRunner.run(suite());
        } else {
            junit.textui.TestRunner.run(new F_JonasAdminServiceTransaction(testtorun));
        }
    }

    /**
     * Get a new TestSuite for this class
     * @return a new TestSuite for this class
     */
    public static TestSuite suite() {
        return new TestSuite(F_JonasAdminServiceTransaction.class);
    }

    /**
     * Setup need for these tests
     * jonasAdmin is required
     * @throws Exception if it fails
     */
    protected void setUp() throws Exception {
        super.setUp();

        if (wc.getCurrentPage().getURL() == null) {
            useWar("jonasAdmin");
            // login to jonas admin
            try {
                JonasAdminAuth.doValidAuth(wc, url);
            } catch (Exception e) {
                fail("authentification failed :  " + e);
            }
        } else {
            // if there was an error, the connection must be restablished
            try {
                wc.getFrameContents(FRAME_TREE);
            } catch (Exception e) {
                wc.getResponse(urlLogOut);
                // login to jonas admin
                try {
                    JonasAdminAuth.doValidAuth(wc, url);
                } catch (Exception auth) {
                    fail("authentification failed :  " + auth);
                }
            }
        }
    }

    /**
     * Test Transaction Manager infos
     * @throws Exception if error occurs
     *
     */
    public void testTransactionManagerInfos() throws Exception {

        WebResponse wr;
        WebLink link;
        WebTable table;
        WebTable tabTable;
        int selectedTab;
        String location;
        String hostName;
        String port;
        JonasAdminUtils utils = new JonasAdminUtils();

        // Disable errors of javascript
        HttpUnitOptions.setExceptionsThrownOnScriptError(false);
        // Disable exception thrown on error status
        HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);

        // Test only if the transaction service is enabled
        if (jProp.isJtm()) {

            // Go to transaction
            wr = wc.getFrameContents(FRAME_TREE);
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);
            selectedTab = 1;

            // Verify transaction manager infos
            table = utils.getTable(wr, 0);
            location = getLocation();
            hostName = getHostName();
            port = getPortNumber();
            if (port.equals("0")) {
                port = "undefined";
            }
            // Location         collocated
            assertEquals("It is not the expected location value. ", location, table.getTableCell(0, 2).getText());
            // Host name        mururoa.frec.bull.fr
            assertEquals("It is not the expected host name value. ", hostName, table.getTableCell(1, 2).getText());
            // Port number      undefined
            assertEquals("It is not the expected port number. ", port, table.getTableCell(2, 2).getText());

            // Verify tabs
            tabTable = utils.getTabTable(wr);
            testTabs(tabTable, NUMBER_OF_TABS_FOR_TRANSACTION, selectedTab, "Problem in 'alarm.jar' tab.");
            // - links
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_STATISTICS + " is not found in the second tab. ",
                    tabTable.getTableCell(0, 2).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_STATISTICS));
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_MONITOR + " is not found in the third tab. ",
                    tabTable.getTableCell(0, 4).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_MONITOR));
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_RECOVERY + " is not found in the fourth tab. ",
                    tabTable.getTableCell(0, 6).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_RECOVERY));

        }
    }

    /**
     * Test to modify time-out
     * @throws Exception if an error occurs.
     */
    public void testTransactionTimeOut() throws Exception {

        WebResponse wr;
        WebLink link;
        WebTable table;
        JonasAdminUtils utils = new JonasAdminUtils();

        // Disable errors of javascript
        HttpUnitOptions.setExceptionsThrownOnScriptError(false);
        // Disable exception thrown on error status
        HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);

        // Test only if the transaction service is enabled
        if (jProp.isJtm()) {

            // Go to transaction
            wr = wc.getFrameContents(FRAME_TREE);
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Modify time-out
            WebForm form = wr.getForms()[0];
            form.setParameter("timeOutText", "0");

            // Apply
            Button button = form.getButtons()[0];
            button.click();

            // Verify "timeOutText" value
            wr = wc.getFrameContents(FRAME_CONTENT);
            form = wr.getForms()[0];
            assertEquals("The Transaction time-out is not '0'. ", "0", form.getParameterValue("timeOutText"));
        }
    }

    /**
     * Test transaction statistics with transactions of the cmp2.ear example.
     * @throws Exception if an error occurs.
     */
    public void testTransactionStatistics() throws Exception {

        WebResponse wr;
        WebLink link;
        WebTable table;
        WebTable tabTable;
        int selectedTab;
        JonasAdminUtils utils = new JonasAdminUtils();

        // Disable errors of javascript
        HttpUnitOptions.setExceptionsThrownOnScriptError(false);
        // Disable exception thrown on error status
        HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);

        // Test only if the transaction service is enabled
        if (jProp.isJtm() && jProp.isEar()) {

            // Add cmp2.ear
            useEar("cmp2");

            // Go to transaction
            wr = wc.getFrameContents(FRAME_TREE);
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);
            selectedTab = 1;

            // Go to Statistics
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION_STATISTICS);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);
            selectedTab = 2;

            // Verify tabs
            tabTable = utils.getTabTable(wr);
            testTabs(tabTable, NUMBER_OF_TABS_FOR_TRANSACTION, selectedTab, "Problem in 'statistics' tab.");
            // - links
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION + " is not found in the first tab. ",
                    tabTable.getTableCell(0, 0).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION));
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_MONITOR + " is not found in the third tab. ",
                    tabTable.getTableCell(0, 4).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_MONITOR));
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_RECOVERY + " is not found in the fourth tab. ",
                    tabTable.getTableCell(0, 6).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_RECOVERY));

            // Create transactions
            executeCMP2Example2();

            // Refresh
            wc.sendRequest(wr.getRefreshRequest());
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Verify statistics
            table = utils.getTable(wr, 3);
            // Current number of transactions
            int currentNbTransaction = Integer.parseInt(table.getTableCell(0, 2).getText());
            // Number of begun transactions
            int nbBegunTransaction = Integer.parseInt(table.getTableCell(1, 2).getText());
            // Number of commited transactions
            int nbCommitedTransaction = Integer.parseInt(table.getTableCell(2, 2).getText());
            // Number of rolledback transactions
            int nbRolledbackTransaction = Integer.parseInt(table.getTableCell(3, 2).getText());
            // Number of transactions with expired time-out
            int nbTransactionExpiredTimeOut = Integer.parseInt(table.getTableCell(4, 2).getText());

            // nbBegunTransaction > 0
            assertTrue("'Number of begun transactions' is not positif. ", nbBegunTransaction > 0);
            // currentNbTransaction + nbCommitedTransaction + nbRolledbackTransaction > 0
            assertTrue("The sum of 'Number of begun transactions', 'Number of commited transactions' and 'Number of rolledback transactions' is not positif. ", currentNbTransaction + nbCommitedTransaction + nbRolledbackTransaction > 0);

            //  0 <= nbTransactionExpiredTimeOut
            assertTrue("'Number of transactions with expired time-out' is not positif. ", nbTransactionExpiredTimeOut >= 0);
        }
    }

    /**
     * Test the 'Reset Counters' button in statistics.
     * @throws Exception if an error occurs
     */
    public void testResetCounters() throws Exception {

        WebResponse wr;
        WebLink link;
        WebTable table;
        JonasAdminUtils utils = new JonasAdminUtils();

        // Disable errors of javascript
        HttpUnitOptions.setExceptionsThrownOnScriptError(false);
        // Disable exception thrown on error status
        HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);

        // Test only if the transaction service is enabled
        if (jProp.isJtm() && jProp.isEar()) {

            // Add cmp2.ear
            useEar("cmp2");

            // Go to transaction
            wr = wc.getFrameContents(FRAME_TREE);
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Go to Statistics
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION_STATISTICS);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Create transactions
            executeCMP2Example1();

            // Refresh
            wc.sendRequest(wr.getRefreshRequest());
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Verify statistics
            table = utils.getTable(wr, 3);
            // Current number of transactions
            int currentNbTransaction = Integer.parseInt(table.getTableCell(0, 2).getText());
            // Number of begun transactions
            int nbBegunTransaction = Integer.parseInt(table.getTableCell(1, 2).getText());
            // Number of commited transactions
            int nbCommitedTransaction = Integer.parseInt(table.getTableCell(2, 2).getText());
            // Number of rolledback transactions
            int nbRolledbackTransaction = Integer.parseInt(table.getTableCell(3, 2).getText());
            // Number of transactions with expired time-out
            int nbTransactionExpiredTimeOut = Integer.parseInt(table.getTableCell(4, 2).getText());
            int total = currentNbTransaction + nbBegunTransaction + nbCommitedTransaction + nbRolledbackTransaction + nbTransactionExpiredTimeOut;
            // total > 0
            assertTrue("Counters are all at '0' after executing cmp2 example.", total > 0);

            // Reset counters
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION_RESET);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Verify statistics
            table = utils.getTable(wr, 3);
            // Current number of transactions
            currentNbTransaction = Integer.parseInt(table.getTableCell(0, 2).getText());
            // Number of begun transactions
            nbBegunTransaction = Integer.parseInt(table.getTableCell(1, 2).getText());
            // Number of commited transactions
            nbCommitedTransaction = Integer.parseInt(table.getTableCell(2, 2).getText());
            // Number of rolledback transactions
            nbRolledbackTransaction = Integer.parseInt(table.getTableCell(3, 2).getText());
            // Number of transactions with expired time-out
            nbTransactionExpiredTimeOut = Integer.parseInt(table.getTableCell(4, 2).getText());

            // currentNbTransaction = 0
            assertEquals("'Current number of transactions' is not '0'", 0, currentNbTransaction);
            // nbBegunTransaction = 0
            assertEquals("'Number of begun transactions' is not '0'", 0, nbBegunTransaction);
            // nbCommitedTransaction = 0
            assertEquals("'Number of commited transactions' is not '0'", 0, nbCommitedTransaction);
            // nbRolledbackTransaction = 0
            assertEquals("'Number of rolledback transactions' is not '0'", 0, nbRolledbackTransaction);
            // nbTransactionExpiredTimeOut = 0
            assertEquals("'Number of transactions with expired time-out' is not '0'", 0, nbTransactionExpiredTimeOut);

            // Create transactions
            executeCMP2Example1();

            // Refresh
            wc.sendRequest(wr.getRefreshRequest());
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Verify statistics
            table = utils.getTable(wr, 3);
            // Current number of transactions
            currentNbTransaction = Integer.parseInt(table.getTableCell(0, 2).getText());
            // Number of begun transactions
            nbBegunTransaction = Integer.parseInt(table.getTableCell(1, 2).getText());
            // Number of commited transactions
            nbCommitedTransaction = Integer.parseInt(table.getTableCell(2, 2).getText());
            // Number of rolledback transactions
            nbRolledbackTransaction = Integer.parseInt(table.getTableCell(3, 2).getText());
            // Number of transactions with expired time-out
            nbTransactionExpiredTimeOut = Integer.parseInt(table.getTableCell(4, 2).getText());
            total = currentNbTransaction + nbBegunTransaction + nbCommitedTransaction + nbRolledbackTransaction + nbTransactionExpiredTimeOut;
            // total > 0
            assertTrue("Counters are all at '0' after re-executing cmp2 example.", total > 0);
        }
    }

    /**
     * Test transaction Monitor
     * @throws Exception if an error occurs
     */
    public void testTransactionMonitor() throws Exception {

        WebResponse wr;
        WebLink link;
        WebTable table;
        WebTable tabTable;
        int selectedTab;
        String location;
        String hostName;
        String port;
        JonasAdminUtils utils = new JonasAdminUtils();

        // Disable errors of javascript
        HttpUnitOptions.setExceptionsThrownOnScriptError(false);
        // Disable exception thrown on error status
        HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);

        // Test only if the transaction service is enabled
        if (jProp.isJtm()) {

            // Go to transaction
            wr = wc.getFrameContents(FRAME_TREE);
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Go to 'Monitor'
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION_MONITOR);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);
            selectedTab = 3;

            // Verify 'Monitor' table
            table = utils.getTable(wr, 0);
			if (!table.getTableCell(0, 0).getText().equals("Date")) {
                // No Transactions in Execution !
                assertEquals("There is not the message: 'No Transactions in Execution !'. ", "No Transactions in Execution !", table.getTableCell(0, 0).getText());
            } else {
                // There is one transaction (or more)
                assertTrue("There is no text for the date. ", table.getTableCell(1, 0).getText().length() > 0);
                assertTrue("There is no text for the transaction. ", table.getTableCell(1, 1).getText().length() > 0);
                assertTrue("There is no text for the resource. ", table.getTableCell(1, 2).getText().length() > 0);
                assertTrue("There is no text for the state. ", table.getTableCell(1, 3).getText().length() > 0);
            }

            // Verify tabs
            tabTable = utils.getTabTable(wr);
            testTabs(tabTable, NUMBER_OF_TABS_FOR_TRANSACTION, selectedTab, "Problem in 'Monitor' tab.");
            // - links
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION + " is not found in the first tab. ",
                    tabTable.getTableCell(0, 0).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION));
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_STATISTICS + " is not found in the second tab. ",
                    tabTable.getTableCell(0, 2).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_STATISTICS));
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_RECOVERY + " is not found in the fourth tab. ",
                    tabTable.getTableCell(0, 6).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_RECOVERY));
        }
    }

    /**
     * Test transaction Recovery
     * @throws Exception if an error occurs
     */
    public void testTransactionRecovery() throws Exception {

        WebResponse wr;
        WebLink link;
        WebTable table;
        WebTable tabTable;
        int selectedTab;
        String location;
        String hostName;
        String port;
        JonasAdminUtils utils = new JonasAdminUtils();

        // Disable errors of javascript
        HttpUnitOptions.setExceptionsThrownOnScriptError(false);
        // Disable exception thrown on error status
        HttpUnitOptions.setExceptionsThrownOnErrorStatus(false);

        // Test only if the transaction service is enabled
        if (jProp.isJtm()) {

            // Go to transaction
            wr = wc.getFrameContents(FRAME_TREE);
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);

            // Go to 'Recovery'
            link = wr.getFirstMatchingLink( WebLink.MATCH_URL_STRING, URL_JONASADMIN_TRANSACTION_RECOVERY);
            link.click();
            wr = wc.getFrameContents(FRAME_CONTENT);
            selectedTab = 4;

            // Verify 'Recovery' table
            table = utils.getTable(wr, 0);
            // No Transactions in Execution !
            assertEquals("There is not the message: 'No Transactions to Recover !'. ", "No Transactions to Recover !", table.getTableCell(0, 0).getText());

            // Verify tabs
            tabTable = utils.getTabTable(wr);
            testTabs(tabTable, NUMBER_OF_TABS_FOR_TRANSACTION, selectedTab, "Problem in 'Monitor' tab.");
            // - links
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION + " is not found in the first tab. ",
                    tabTable.getTableCell(0, 0).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION));
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_STATISTICS + " is not found in the second tab. ",
                    tabTable.getTableCell(0, 2).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_STATISTICS));
            assertTrue("The link " + URL_JONASADMIN_TRANSACTION_MONITOR + " is not found in the third tab. ",
                    tabTable.getTableCell(0, 4).getLinks()[0].getURLString().endsWith(URL_JONASADMIN_TRANSACTION_MONITOR));
        }
    }

    /**
     * Get jtm location
     * @return "collocated" or "Remote"
     * @throws Exception if an error occurs
     */
    private String getLocation() throws Exception {
        MBeanServerConnection server;
        String location = "";
        boolean localJtm;
        server = getMBeanServer();
        ObjectName on = new ObjectName("jonas:j2eeType=JTAResource,name=JTAResource,J2EEServer=jonas");
        localJtm = ((Boolean) server.getAttribute(on, "localJtm")).booleanValue();
        if (localJtm) {
            location = "collocated";
        } else {
            location = "Remote";
        }
        return location;
    }

    /**
     * Get jtm Host Name
     * @return jtm host name
     * @throws Exception if an error occurs
     */
    private String getHostName() throws Exception {
        MBeanServerConnection server = getMBeanServer();
        String hostName = "";
        ObjectName on = new ObjectName("jonas:j2eeType=JTAResource,name=JTAResource,J2EEServer=jonas");
        hostName = (String) server.getAttribute(on, "hostName");
        return hostName;
    }

    /**
     * Get jtm port number
     * @return jtm port number
     * @throws Exception if an error occurs
     */
    private String getPortNumber() throws Exception {
        MBeanServerConnection server = getMBeanServer();
        String port = "0";
        ObjectName on = new ObjectName("jonas:j2eeType=JTAResource,name=JTAResource,J2EEServer=jonas");
        port = ((Integer) server.getAttribute(on, "portNumber")).toString();
        return port;
    }

    /**
     * Execute the test1 of cmp2
     * @throws Exception if an error occurs
     */
    private void executeCMP2Example1() throws Exception {
        WebConversation wc2 = new WebConversation();
        String urlExample1 = prefixUrl + "/cmp2/test1?";
        WebResponse wr = wc2.getResponse(urlExample1);
    }

    /**
     * Execute the test2 of cmp2
     * @throws Exception if an error occurs
     */
    private void executeCMP2Example2() throws Exception {
        WebConversation wc2 = new WebConversation();
        String urlExample2 = prefixUrl + "/cmp2/test2?";
        WebResponse wr = wc2.getResponse(urlExample2);
    }

    /**
     * Execute the test3 of cmp2
     * @throws Exception if an error occurs
     */
    private void executeCMP2Example3() throws Exception {
        WebConversation wc2 = new WebConversation();
        String urlExample3 = prefixUrl + "/cmp2/test3?";
        WebResponse wr = wc2.getResponse(urlExample3);
    }

    /**
     * Tear Down cleanUp action
     * @throws Exception if an error occurs
     */
    public void tearDown() throws Exception {
        super.tearDown();
    }

}
