package com.vci.server.framework.appConfig; import static org.junit.Assert.*; import java.util.Date; import java.util.List; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import com.vci.common.objects.UserEntity; /** * AppConfigCategory DAO Service Test * */ public class AppConfigCategoryServiceTest { private UserEntity userEntity = new UserEntity(); @BeforeClass public static void setUpBeforeClass() throws Exception { } @AfterClass public static void tearDownAfterClass() throws Exception { } @Before public void setUp() throws Exception { userEntity.setUserName("xc"); userEntity.setModule(this.getClass().getName()); userEntity.setIp("192.168.0.26"); } @After public void tearDown() throws Exception { } @Test public void testSaveAppConfigCategory() { AppConfigCategory object = new AppConfigCategory(); AppConfigCategoryService service = new AppConfigCategoryService(userEntity); object.setId(""); object.setName(""); object.setDesc(""); boolean res = service.saveAppConfigCategory(object); assertEquals(true, res); } @Test public void testUpdateAppConfigCategory() { AppConfigCategory object = new AppConfigCategory(); AppConfigCategoryService service = new AppConfigCategoryService(userEntity); object.setId(""); object.setName(""); object.setDesc(""); boolean res = service.updateAppConfigCategory(object); assertEquals(true, res); } @Test public void testDeleteAppConfigCategoryStringArray() { AppConfigCategoryService service = new AppConfigCategoryService(userEntity); boolean res = service.deleteAppConfigCategory(new String[]{"123", "456"}); assertEquals(true, res); } @Test public void testGetAppConfigCategorys() { AppConfigCategoryService service = new AppConfigCategoryService(userEntity); List objects = service.getAppConfigCategorys(); int size = objects.size(); for(AppConfigCategory object : objects){ System.out.println(object); } assertEquals(2, size); } @Test public void testGetAppConfigCategoryById() { AppConfigCategoryService service = new AppConfigCategoryService(userEntity); AppConfigCategory object = service.getAppConfigCategoryById("123"); assertEquals("123", object.getId()); } }