Package org.jboss.cache.optimistic

Source Code of org.jboss.cache.optimistic.LocalTest

/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.cache.optimistic;

import org.jboss.cache.TreeCache;

/**
* A simple test that runs through N loops of the test and measures time taken using a local, no cacheloader config.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani (manik@jboss.org)</a>
*/
public class LocalTest extends OptimisticPerfTestBase
{
    protected void configure() throws Exception
    {
        testName = "localTest";
        cache = new TreeCache();
        cache.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup");
        cache.setNodeLockingScheme("OPTIMISTIC");
        cache.setCacheMode(TreeCache.LOCAL);
        cache.setLockAcquisitionTimeout(2000l);
        System.out.println("TO " + cache.getLockAcquisitionTimeout());
        cache.startService();
        System.out.println("TO " + cache.getLockAcquisitionTimeout());
    }

    public static void main(String[] args) throws Exception
    {
        LocalTest test = new LocalTest();
        test.runTests();
        System.out.println(test.results);
    }
}
TOP

Related Classes of org.jboss.cache.optimistic.LocalTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.