Package me.kafeitu.demo.activiti.dao

Source Code of me.kafeitu.demo.activiti.dao.InitDataTest

package me.kafeitu.demo.activiti.dao;

import static org.junit.Assert.assertNotNull;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import me.kafeitu.demo.activiti.entity.account.Group;
import me.kafeitu.demo.activiti.entity.account.User;
import me.kafeitu.modules.test.spring.SpringTransactionalTestCase;

import org.junit.Test;
import org.springframework.test.context.ContextConfiguration;

/**
* 测试初始化数据
*
* @author HenryYan
*/
@ContextConfiguration(locations = { "/applicationContext-test.xml" })
public class InitDataTest extends SpringTransactionalTestCase {

  @PersistenceContext
  private EntityManager em;
 
  @Test
  public void testUserData() throws Exception {
    Group group = em.find(Group.class, "admin");
    assertNotNull(group);
   
    group = em.find(Group.class, "user");
    assertNotNull(group);
   
    User user = em.find(User.class, "admin");
    assertNotNull(user);
   
    user = em.find(User.class, "kafeitu");
    assertNotNull(user);
  }

}
TOP

Related Classes of me.kafeitu.demo.activiti.dao.InitDataTest

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.