From 61bd6b896a5d4e161b411473cde3a45ffa154364 Mon Sep 17 00:00:00 2001 From: snoop Date: Mon, 26 Jun 2017 16:00:23 +0900 Subject: [PATCH 1/2] added ignore --- .../com/loafle/overflow/meta/dao/MetaProbeTaskTypeDAOTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/loafle/overflow/meta/dao/MetaProbeTaskTypeDAOTest.java b/src/test/java/com/loafle/overflow/meta/dao/MetaProbeTaskTypeDAOTest.java index 1488aa3..35269fb 100644 --- a/src/test/java/com/loafle/overflow/meta/dao/MetaProbeTaskTypeDAOTest.java +++ b/src/test/java/com/loafle/overflow/meta/dao/MetaProbeTaskTypeDAOTest.java @@ -3,6 +3,7 @@ package com.loafle.overflow.meta.dao; import com.loafle.overflow.AppConfig; import com.loafle.overflow.JdbcConfiguration; import com.loafle.overflow.meta.model.MetaProbeTaskType; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -24,7 +25,7 @@ public class MetaProbeTaskTypeDAOTest { @Autowired private MetaProbeTaskTypeDAO metaProbeTaskTypeDAO; - + @Ignore @Test public void Create() { From ba0609fb6d82e3b420829ef764075d915b0bdd9d Mon Sep 17 00:00:00 2001 From: snoop Date: Mon, 26 Jun 2017 16:05:38 +0900 Subject: [PATCH 2/2] added probe task --- .../module/probe/dao/ProbeTaskDAO.java | 12 +++++ .../module/probe/dao/ProbeTaskDAOTest.java | 48 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 src/main/java/com/loafle/overflow/module/probe/dao/ProbeTaskDAO.java create mode 100644 src/test/java/com/loafle/overflow/module/probe/dao/ProbeTaskDAOTest.java diff --git a/src/main/java/com/loafle/overflow/module/probe/dao/ProbeTaskDAO.java b/src/main/java/com/loafle/overflow/module/probe/dao/ProbeTaskDAO.java new file mode 100644 index 0000000..f5da8e9 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/probe/dao/ProbeTaskDAO.java @@ -0,0 +1,12 @@ +package com.loafle.overflow.module.probe.dao; + +import com.loafle.overflow.module.probe.model.ProbeTask; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +/** + * Created by snoop on 17. 6. 26. + */ +@Repository +public interface ProbeTaskDAO extends JpaRepository { +} diff --git a/src/test/java/com/loafle/overflow/module/probe/dao/ProbeTaskDAOTest.java b/src/test/java/com/loafle/overflow/module/probe/dao/ProbeTaskDAOTest.java new file mode 100644 index 0000000..20303ab --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/probe/dao/ProbeTaskDAOTest.java @@ -0,0 +1,48 @@ +package com.loafle.overflow.module.probe.dao; + +import com.loafle.overflow.AppConfig; +import com.loafle.overflow.JdbcConfiguration; +import com.loafle.overflow.meta.model.MetaProbeTaskType; +import com.loafle.overflow.module.probe.model.Probe; +import com.loafle.overflow.module.probe.model.ProbeTask; +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 snoop on 17. 6. 26. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class}) +public class ProbeTaskDAOTest { + + @Autowired + private ProbeTaskDAO probeTaskDAO; + + + @Test + public void Create() { + + ProbeTask probeTask = new ProbeTask(); + + MetaProbeTaskType typeDiscovery = new MetaProbeTaskType(); + typeDiscovery.setId((short)1); + + probeTask.setMetaProbeTaskType(typeDiscovery); + probeTask.setData(""); + + Probe probe = new Probe(); + probe.setId(1); + + probeTask.setProbe(probe); + + this.probeTaskDAO.save(probeTask); + + + + } +} \ No newline at end of file