// Path: mardao-maven-plugin/src/test/java/net/sf/mardao/test/domain/DCachedEntity.java
// @Entity
// @Cached
// public class DCachedEntity extends DEntity {
// 
// }


import edu.emory.mathcs.backport.java.util.Arrays;
import net.sf.mardao.core.CacheConfig;
import net.sf.mardao.test.domain.DCachedEntity;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import javax.cache.annotation.*;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Collection;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
package net.sf.mardao.test.dao;




public class DCachedEntityDaoTest {

  @Before
  public void setUp() throws Exception {
  }

  @After
  public void tearDown() throws Exception {
  }

  @Test
  public void testCrudAnnotations() throws Exception {

    // Check that jsr107 annotations were added to crud methods

    Method readMethod = DCachedEntityDaoBean.class.getMethod("get", Object.class, Long.class);
    assertTrue(readMethod.isAnnotationPresent(CacheResult.class));
    Annotation[][] paramsAnnotations = readMethod.getParameterAnnotations();
    assertTrue(hasAnnotation(Arrays.asList(paramsAnnotations[0]), CacheKey.class));
    assertTrue(hasAnnotation(Arrays.asList(paramsAnnotations[1]), CacheKey.class));

// Path: mardao-maven-plugin/src/test/java/net/sf/mardao/test/domain/DCachedEntity.java
// @Entity
// @Cached
// public class DCachedEntity extends DEntity {
// 
// }


// Path: mardao-maven-plugin/src/test/java/net/sf/mardao/test/dao/DCachedEntityDaoTest.java
import edu.emory.mathcs.backport.java.util.Arrays;
import net.sf.mardao.core.CacheConfig;
import net.sf.mardao.test.domain.DCachedEntity;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import javax.cache.annotation.*;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.Collection;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

package net.sf.mardao.test.dao;




public class DCachedEntityDaoTest {

  @Before
  public void setUp() throws Exception {
  }

  @After
  public void tearDown() throws Exception {
  }

  @Test
  public void testCrudAnnotations() throws Exception {

    // Check that jsr107 annotations were added to crud methods

    Method readMethod = DCachedEntityDaoBean.class.getMethod("get", Object.class, Long.class);
    assertTrue(readMethod.isAnnotationPresent(CacheResult.class));
    Annotation[][] paramsAnnotations = readMethod.getParameterAnnotations();
    assertTrue(hasAnnotation(Arrays.asList(paramsAnnotations[0]), CacheKey.class));
    assertTrue(hasAnnotation(Arrays.asList(paramsAnnotations[1]), CacheKey.class));

    Method putMethod = DCachedEntityDaoBean.class.getMethod("put", Object.class, Long.class, DCachedEntity.class);