model
This commit is contained in:
@@ -4,7 +4,6 @@ package com.loafle;
|
||||
import com.loafle.overflow.db.api.DBGrpc;
|
||||
import com.loafle.overflow.db.api.DBInput;
|
||||
import com.loafle.overflow.db.api.DBOutput;
|
||||
import com.loafle.overflow.module.member.model.Member;
|
||||
import io.grpc.ManagedChannel;
|
||||
import io.grpc.ManagedChannelBuilder;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//package com.loafle.overflow.agent.dao;
|
||||
//
|
||||
//import com.loafle.overflow.module.agent.dao.JPAAgentDAO;
|
||||
//import com.loafle.overflow.module.agent.model.Agent;
|
||||
//import com.loafle.overflow.module.probe.dao.JPAAgentDAO;
|
||||
//import com.loafle.overflow.module.probe.model.Agent;
|
||||
//import com.loafle.overflow.module.member.model.Member;
|
||||
//import org.junit.Before;
|
||||
//import org.junit.Ignore;
|
||||
@@ -25,10 +25,10 @@
|
||||
// public void createAgent() {
|
||||
// Member m = new Member();
|
||||
// m.setId(Long.valueOf(1));
|
||||
// Agent agent = new Agent();
|
||||
// agent.setDescription("test agent");
|
||||
// agent.setMember(m);
|
||||
// Agent savedAgent = jpaAgentDAO.create(agent);
|
||||
// Agent probe = new Agent();
|
||||
// probe.setDescription("test probe");
|
||||
// probe.setMember(m);
|
||||
// Agent savedAgent = jpaAgentDAO.create(probe);
|
||||
//
|
||||
// System.out.println(savedAgent.getDescription());
|
||||
// }
|
||||
|
||||
@@ -2,15 +2,12 @@ package com.loafle.overflow.module.member.dao;
|
||||
|
||||
import com.loafle.overflow.AppConfig;
|
||||
import com.loafle.overflow.JdbcConfiguration;
|
||||
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;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Created by root on 17. 6. 22.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.loafle.overflow.target.dao;
|
||||
|
||||
import com.loafle.overflow.module.infra.Infra;
|
||||
import com.loafle.overflow.module.target.dao.TargetDAO;
|
||||
import com.loafle.overflow.module.target.model.Target;
|
||||
import com.loafle.overflow.module.probe.model.Probe;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
|
||||
public class JPATargetDaoTest {
|
||||
|
||||
@Autowired
|
||||
private TargetDAO repo;
|
||||
|
||||
|
||||
@Test
|
||||
public void create() {
|
||||
Target t = new Target();
|
||||
t.setCreateDate(new Timestamp(new Date().getTime()));
|
||||
|
||||
Infra i = new Infra();
|
||||
i.setId(1);
|
||||
t.setInfra(i);
|
||||
|
||||
Probe p = new Probe();
|
||||
p.setId(1);
|
||||
|
||||
Target ret = repo.save(t);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user