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

package org.jboss.cache;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jboss.cache.TreeCache;
import org.jboss.cache.marshall.MethodDeclarations;

/**
 * Checks CRUD methods
 *
 * @author Bela Ban
 * @version $Id: CrudMethodTest.java 1927 2006-05-16 22:43:21Z gzamarreno $
 */
public class CrudMethodTest extends TestCase {


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

   public void testCrudMethods() {
      assertTrue(MethodDeclarations.isCrudMethod(MethodDeclarations.putDataEraseMethodLocal));
      assertTrue(MethodDeclarations.isCrudMethod(MethodDeclarations.putDataMethodLocal));
      assertTrue(MethodDeclarations.isCrudMethod(MethodDeclarations.putKeyValMethodLocal));
      assertTrue(MethodDeclarations.isCrudMethod(MethodDeclarations.removeDataMethodLocal));
      assertTrue(MethodDeclarations.isCrudMethod(MethodDeclarations.removeKeyMethodLocal));
      assertTrue(MethodDeclarations.isCrudMethod(MethodDeclarations.removeNodeMethodLocal));

      assertFalse(MethodDeclarations.isCrudMethod(MethodDeclarations.getKeyValueMethodLocal));
      assertFalse(MethodDeclarations.isCrudMethod(MethodDeclarations.getNodeMethodLocal));
      assertFalse(MethodDeclarations.isCrudMethod(MethodDeclarations.getKeysMethodLocal));
      assertFalse(MethodDeclarations.isCrudMethod(MethodDeclarations.getChildrenNamesMethodLocal));
   }



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

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


}
