init.sql
This commit is contained in:
@@ -1,26 +1,82 @@
|
||||
package com.loafle.overflow.infra.dao;
|
||||
|
||||
import com.loafle.overflow.AppConfig;
|
||||
import com.loafle.overflow.JdbcConfiguration;
|
||||
import com.loafle.overflow.module.infra.dao.InfraDAO;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||
public class JPAInfraDAOTest {
|
||||
|
||||
@Autowired
|
||||
private InfraDAO repo;
|
||||
|
||||
|
||||
@Test
|
||||
public void create() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//package com.loafle.overflow.infra.dao;
|
||||
//
|
||||
//import com.loafle.overflow.AppConfig;
|
||||
//import com.loafle.overflow.JdbcConfiguration;
|
||||
//import com.loafle.overflow.meta.dao.MetaInfraTypeDAO;
|
||||
//import com.loafle.overflow.meta.model.MetaInfraType;
|
||||
//import com.loafle.overflow.module.infra.dao.InfraDAO;
|
||||
//import com.loafle.overflow.module.infra.dao.InfraHostDAO;
|
||||
//import com.loafle.overflow.module.infra.dao.InfraOSDAO;
|
||||
//import com.loafle.overflow.module.infra.model.Infra;
|
||||
//import com.loafle.overflow.module.infra.model.InfraHost;
|
||||
//import com.loafle.overflow.module.infra.model.InfraOS;
|
||||
//import org.junit.After;
|
||||
//import org.junit.Before;
|
||||
//import org.junit.Test;
|
||||
//import org.junit.runner.RunWith;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.test.context.ContextConfiguration;
|
||||
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
//
|
||||
//import java.util.Date;
|
||||
//
|
||||
//@RunWith(SpringJUnit4ClassRunner.class)
|
||||
//@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||
//public class JPAInfraDAOTest {
|
||||
//
|
||||
// @Autowired
|
||||
// private InfraDAO infraRepo;
|
||||
// @Autowired
|
||||
// private MetaInfraTypeDAO infraTypeRepo;
|
||||
// @Autowired
|
||||
// private InfraHostDAO infraHostRepo;
|
||||
// @Autowired
|
||||
// private InfraOSDAO infraOSRepo;
|
||||
//
|
||||
// @Before
|
||||
// public void setUp() throws Exception {
|
||||
//// MetaInfraType type1 = new MetaInfraType();
|
||||
//// type1.setName("HOST");
|
||||
//// type1.setCreateDate(new Date());
|
||||
////
|
||||
//// MetaInfraType type2 = new MetaInfraType();
|
||||
//// type2.setName("MACHINE");
|
||||
//// type2.setCreateDate(new Date());
|
||||
////
|
||||
//// MetaInfraType type3 = new MetaInfraType();
|
||||
//// type3.setName("SERVICE");
|
||||
//// type3.setCreateDate(new Date());
|
||||
////
|
||||
//// infraTypeRepo.save(type1);
|
||||
//// infraTypeRepo.save(type2);
|
||||
//// infraTypeRepo.save(type3);
|
||||
////
|
||||
//// InfraOS os = new InfraOS();
|
||||
//// os.setCreateDate(new Date());
|
||||
////
|
||||
//// InfraHost host = new InfraHost();
|
||||
//// host.setIp(111111);
|
||||
//// host.setMac(22222222);
|
||||
//// host.setCreateDate(new Date());
|
||||
//// host.setOs();
|
||||
////
|
||||
//// infraHostRepo.save(host);
|
||||
// }
|
||||
//
|
||||
// @After
|
||||
// public void tearDown() throws Exception {
|
||||
// Infra infra = new Infra();
|
||||
// infra.setCreateDate(new Date());
|
||||
// MetaInfraType t = new MetaInfraType();
|
||||
// t.setId(1);
|
||||
// infra.setType(t);
|
||||
// infra.setChildId();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void create() {
|
||||
// Infra infra = new Infra();
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
@@ -25,7 +25,7 @@ public class DomainDAOTest {
|
||||
|
||||
Domain domain = new Domain();
|
||||
|
||||
domain.setName("snoop's domain");
|
||||
domain.setName("overFlow's domain");
|
||||
|
||||
this.domainDAO.save(domain);
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@ package com.loafle.overflow.module.domain.dao;
|
||||
|
||||
import com.loafle.overflow.AppConfig;
|
||||
import com.loafle.overflow.JdbcConfiguration;
|
||||
import com.loafle.overflow.module.domain.model.Domain;
|
||||
import com.loafle.overflow.module.domain.model.DomainMember;
|
||||
import com.loafle.overflow.module.member.model.Member;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -15,12 +18,16 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||
public class DomainMemberDAOTest {
|
||||
|
||||
@Autowired
|
||||
private DomainMemberDAO repo;
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
|
||||
DomainMember domainMember = new DomainMember();
|
||||
domainMember.setDomain(new Domain(1));
|
||||
domainMember.setMember(new Member(1));
|
||||
|
||||
repo.save(domainMember);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user