ExpressoTestSuite.java :  » J2EE » Expresso » com » jcorporate » expresso » core » Java Open Source

Java Open Source » J2EE » Expresso 
Expresso » com » jcorporate » expresso » core » ExpressoTestSuite.java
/* ====================================================================
 * The Jcorporate Apache Style Software License, Version 1.2 05-07-2002
 *
 * Copyright (c) 1995-2002 Jcorporate Ltd. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by Jcorporate Ltd.
 *        (http://www.jcorporate.com/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. "Jcorporate" and product names such as "Expresso" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written permission,
 *    please contact info@jcorporate.com.
 *
 * 5. Products derived from this software may not be called "Expresso",
 *    or other Jcorporate product names; nor may "Expresso" or other
 *    Jcorporate product names appear in their name, without prior
 *    written permission of Jcorporate Ltd.
 *
 * 6. No product derived from this software may compete in the same
 *    market space, i.e. framework, without prior written permission
 *    of Jcorporate Ltd. For written permission, please contact
 *    partners@jcorporate.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL JCORPORATE LTD OR ITS CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Jcorporate Ltd. Contributions back
 * to the project(s) are encouraged when you make modifications.
 * Please send them to support@jcorporate.com. For more information
 * on Jcorporate Ltd. and its products, please see
 * <http://www.jcorporate.com/>.
 *
 * Portions of this software are based upon other open source
 * products and are subject to their respective licenses.
 */

package com.jcorporate.expresso.core;

import com.jcorporate.expresso.core.security.CryptoTests;
import com.jcorporate.expresso.core.utility.DBToolTests;
import com.jcorporate.expresso.services.test.DBTestSuite;
import com.jcorporate.expresso.services.test.TestSystemInitializer;

import java.util.Vector;


/**
 * This class provides all the client side test suites.  They can be
 * run without an application server running.  To unit test your controllers
 * you want to run the ServerSideTestSuite
 *
 * @author Michael Rimov
 * @version $Revision: 1.4 $ $Date: 2004/11/17 20:48:22 $
 * @since Expresso 4.0
 */
public class ExpressoTestSuite
        extends DBTestSuite {
    public ExpressoTestSuite() {
        super();
    }

    public static void main(String[] args)
            throws Exception {

        //Set the system properties we need
        junit.textui.TestRunner.run(suite());
    }

    /**
     * Lists all the unit tests
     *
     * @return instantiated Test Suite object
     */
    public static junit.framework.Test suite()
            throws Exception {
        TestSystemInitializer.setUp();

        //Order Matters here
        ExpressoTestSuite ts = new ExpressoTestSuite();


        ts.addTest(DBToolTests.suite());
        ts.addTestSuite(com.jcorporate.expresso.kernel.digester.test.TestComponentMetadataConfig.class);
        ts.addTestSuite(com.jcorporate.expresso.kernel.digester.test.TestExpressoServicesConfig.class);
        ts.addTestSuite(com.jcorporate.expresso.kernel.util.test.TestLocatorUtils.class);
        ts.addTestSuite(com.jcorporate.expresso.kernel.util.test.FastStringBufferTest.class);

        ts.addTestSuite(com.jcorporate.expresso.core.security.filters.FilterTreeTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.db.tests.DBConnectionPoolTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.controller.tests.InputTests.class);
        ts.addTestSuite(com.jcorporate.expresso.core.controller.tests.OutputTests.class);
        ts.addTestSuite(com.jcorporate.expresso.core.controller.tests.TransitionTests.class);
        ts.addTestSuite(com.jcorporate.expresso.core.controller.tests.BlockTests.class);
        ts.addTestSuite(com.jcorporate.expresso.core.controller.tests.ControllerResponseTests.class);
        ts.addTestSuite(com.jcorporate.expresso.core.registry.TestMutableRequestRegistry.class);
        ts.addTestSuite(com.jcorporate.expresso.core.registry.TestExpressoThread.class);
        ts.addTestSuite(com.jcorporate.expresso.core.i18n.MessagesTest.class);

        ts.addTestSuite(com.jcorporate.expresso.core.misc.tests.TestXmlDocTypeFilter.class);
        ts.addTestSuite(com.jcorporate.expresso.core.misc.tests.Base64Test.class);
        ts.addTestSuite(com.jcorporate.expresso.core.misc.tests.HexEncoderTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.misc.tests.CookieBase64Test.class);
        ts.addTestSuite(com.jcorporate.expresso.core.misc.tests.FileUtilTests.class);

        ts.addTestSuite(com.jcorporate.expresso.core.logging.tests.LogManagerTests.class);
        ts.addTestSuite(CryptoTests.class);
        ts.addTestSuite(com.jcorporate.expresso.core.misc.tests.CookieTests.class);
        ts.addTestSuite(com.jcorporate.expresso.core.security.filters.FilterTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.cache.CacheTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.cache.tests.TTLTest.class);

        //DBObject and related tests.
        ts.addTestSuite(com.jcorporate.expresso.core.dbobj.tests.DBObjectTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.dbobj.tests.SerializationTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.dataobjects.test.TestDataTransferObject.class);
        ts.addTestSuite(com.jcorporate.expresso.core.dbobj.tests.MultiDBObjectTest.class);
        ts.addTestSuite(com.jcorporate.expresso.services.dbobj.tests.DBObjSecurityTests.class);
        ts.addTestSuite(com.jcorporate.expresso.core.dbobj.tests.RowSecuredDBObjectTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.dbobj.tests.AutoDBObjTest.class);

        ts.addTestSuite(com.jcorporate.expresso.core.security.tests.UserGroupTest.class);
        ts.addTestSuite(com.jcorporate.expresso.core.security.tests.UserTest.class);

        ts.addTestSuite(com.jcorporate.expresso.services.crontab.tests.TestCrontabEntry.class);
        ts.addTestSuite(com.jcorporate.expresso.services.dbobj.tests.MimeTypesTests.class);
        ts.addTestSuite(com.jcorporate.expresso.services.dbobj.tests.SetupTests.class);

        return ts;
    }

    /**
     * Allows the test schema to be automatically be created and cleaned up as
     * well
     *
     * @param schemas a vector of schemas to be automatically created and destroyed
     *                at the end of the test
     * @throws Exception upon error
     */
    protected void addSchema(Vector schemas)
            throws Exception {
        TestSystemInitializer.setUp();
        schemas.add(Class.forName("com.jcorporate.expresso.core.dbobj.tests.TestSchema").newInstance());
        super.addSchema(schemas);
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.