/*
 *
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package org.jboss.test.cache.test.local;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jboss.cache.TreeCache;
import org.jboss.cache.Fqn;
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.transaction.DummyTransactionManager;
import org.jboss.logging.Logger;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.transaction.UserTransaction;
import java.util.Properties;

/**
 * Checks CRUD methods
 *
 * @author Bela Ban
 * @version $Id: CrudMethodUnitTestCase.java,v 1.1.2.2 2004/09/23 18:43:48 bwang00 Exp $
 */
public class CrudMethodUnitTestCase extends TestCase {


   public CrudMethodUnitTestCase(String name) {
      super(name);
   }

   public void testCrudMethods() {
      assertTrue(TreeCache.isCrudMethod(TreeCache.put_data_erase_method));
      assertTrue(TreeCache.isCrudMethod(TreeCache.put_data_method));
      assertTrue(TreeCache.isCrudMethod(TreeCache.put_key_val_method));
      assertTrue(TreeCache.isCrudMethod(TreeCache.remove_data_method));
      assertTrue(TreeCache.isCrudMethod(TreeCache.remove_key_method));
      assertTrue(TreeCache.isCrudMethod(TreeCache.remove_node_method));

      assertFalse(TreeCache.isCrudMethod(TreeCache.getKeyValueMethod));
      assertFalse(TreeCache.isCrudMethod(TreeCache.getNodeMethod));
      assertFalse(TreeCache.isCrudMethod(TreeCache.getKeysMethod));
      assertFalse(TreeCache.isCrudMethod(TreeCache.getChildrenNamesMethod));
   }



   public static Test suite() throws Exception {
      return new TestSuite(CrudMethodUnitTestCase.class);
   }

   public static void main(String[] args) throws Exception {
      junit.textui.TestRunner.run(suite());
   }


}
