diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaCrawler.java b/src/main/java/com/loafle/overflow/meta/model/MetaCrawler.java index 5fe20e1..8ec8cb2 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaCrawler.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaCrawler.java @@ -15,7 +15,6 @@ public class MetaCrawler { private String description; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public short getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaCrawlerInputItem.java b/src/main/java/com/loafle/overflow/meta/model/MetaCrawlerInputItem.java index eb24a4e..583a1bf 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaCrawlerInputItem.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaCrawlerInputItem.java @@ -22,7 +22,6 @@ public class MetaCrawlerInputItem { private String keyValue; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public int getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaInfraType.java b/src/main/java/com/loafle/overflow/meta/model/MetaInfraType.java index b051c4f..7a93771 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaInfraType.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaInfraType.java @@ -14,7 +14,6 @@ public class MetaInfraType { private Date createDate; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public int getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaInfraVendor.java b/src/main/java/com/loafle/overflow/meta/model/MetaInfraVendor.java index 4da3da3..2e69bd4 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaInfraVendor.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaInfraVendor.java @@ -15,7 +15,6 @@ public class MetaInfraVendor { private MetaInfraType metaInfraType; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public int getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaInputType.java b/src/main/java/com/loafle/overflow/meta/model/MetaInputType.java index 4f55226..1431d8b 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaInputType.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaInputType.java @@ -15,7 +15,6 @@ public class MetaInputType { private Date createDate; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public short getId() { return id; } @@ -45,7 +44,7 @@ public class MetaInputType { } @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = true) + @Column(name = "CREATE_DATE", nullable = false) public Date getCreateDate() { return createDate; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaMemberStatus.java b/src/main/java/com/loafle/overflow/meta/model/MetaMemberStatus.java index 707840f..ee9094b 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaMemberStatus.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaMemberStatus.java @@ -1,6 +1,9 @@ package com.loafle.overflow.meta.model; -import javax.persistence.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; /** * Created by root on 17. 6. 22. @@ -20,7 +23,6 @@ public class MetaMemberStatus { } @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public short getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaNotification.java b/src/main/java/com/loafle/overflow/meta/model/MetaNotification.java index a1a7a06..216b4fe 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaNotification.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaNotification.java @@ -15,7 +15,6 @@ public class MetaNotification { private String description; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public long getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaProbeArchitecture.java b/src/main/java/com/loafle/overflow/meta/model/MetaProbeArchitecture.java index bef78a8..7a9b492 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaProbeArchitecture.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaProbeArchitecture.java @@ -14,7 +14,6 @@ public class MetaProbeArchitecture { private Date createDate; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public short getId() { return id; } @@ -34,7 +33,7 @@ public class MetaProbeArchitecture { } @Temporal(TemporalType.TIMESTAMP) - @Column(name = "CREATE_DATE", nullable = true) + @Column(name = "CREATE_DATE", nullable = false) public Date getCreateDate() { return createDate; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaProbeOs.java b/src/main/java/com/loafle/overflow/meta/model/MetaProbeOs.java index 6ac1a38..c2c6bdb 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaProbeOs.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaProbeOs.java @@ -14,7 +14,6 @@ public class MetaProbeOs { private Date createDate; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public short getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaProbeTaskType.java b/src/main/java/com/loafle/overflow/meta/model/MetaProbeTaskType.java index c14eebe..d944010 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaProbeTaskType.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaProbeTaskType.java @@ -15,7 +15,6 @@ public class MetaProbeTaskType { private Date createDate; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public short getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaSensorItemType.java b/src/main/java/com/loafle/overflow/meta/model/MetaSensorItemType.java index 71d9013..fe32e19 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaSensorItemType.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaSensorItemType.java @@ -15,7 +15,6 @@ public class MetaSensorItemType { private Date createDate; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public short getId() { return id; } diff --git a/src/main/java/com/loafle/overflow/meta/model/MetaVendorCrawler.java b/src/main/java/com/loafle/overflow/meta/model/MetaVendorCrawler.java index 19687e8..82433f3 100644 --- a/src/main/java/com/loafle/overflow/meta/model/MetaVendorCrawler.java +++ b/src/main/java/com/loafle/overflow/meta/model/MetaVendorCrawler.java @@ -15,7 +15,6 @@ public class MetaVendorCrawler { private Date createDate; @Id - @GeneratedValue(strategy= GenerationType.IDENTITY) public int getId() { return id; } diff --git a/src/test/java/com/loafle/overflow/module/domain/dao/DomainDAOTest.java b/src/test/java/com/loafle/overflow/module/domain/dao/DomainDAOTest.java new file mode 100644 index 0000000..f4b26c3 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/domain/dao/DomainDAOTest.java @@ -0,0 +1,39 @@ +package com.loafle.overflow.module.domain.dao; + +import com.loafle.overflow.AppConfig; +import com.loafle.overflow.JdbcConfiguration; +import com.loafle.overflow.module.domain.Domain; +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; + +import static org.junit.Assert.*; + +/** + * Created by root on 17. 6. 23. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class}) +public class DomainDAOTest { + + @Autowired + private DomainDAO domainDAO; + + @Test + public void testCreate() { + + Domain domain = new Domain(); + + domain.setCreateDate(new Date()); + domain.setName("snoop's domain"); + + this.domainDAO.save(domain); + + + } + +} \ No newline at end of file diff --git a/src/test/java/com/loafle/overflow/module/domain/dao/DomainMemberDAOTest.java b/src/test/java/com/loafle/overflow/module/domain/dao/DomainMemberDAOTest.java new file mode 100644 index 0000000..0ab7960 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/domain/dao/DomainMemberDAOTest.java @@ -0,0 +1,28 @@ +package com.loafle.overflow.module.domain.dao; + +import com.loafle.overflow.AppConfig; +import com.loafle.overflow.JdbcConfiguration; +import com.loafle.overflow.module.domain.DomainMember; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.junit.Assert.*; + +/** + * Created by root on 17. 6. 23. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class}) +public class DomainMemberDAOTest { + + + @Test + public void testCreate() { + + DomainMember domainMember = new DomainMember(); + + } + +} \ No newline at end of file diff --git a/src/test/java/com/loafle/overflow/module/noauthprobe/dao/NoAuthProbeDAOTest.java b/src/test/java/com/loafle/overflow/module/noauthprobe/dao/NoAuthProbeDAOTest.java index 3474380..f8e10e4 100644 --- a/src/test/java/com/loafle/overflow/module/noauthprobe/dao/NoAuthProbeDAOTest.java +++ b/src/test/java/com/loafle/overflow/module/noauthprobe/dao/NoAuthProbeDAOTest.java @@ -2,8 +2,10 @@ package com.loafle.overflow.module.noauthprobe.dao; import com.loafle.overflow.AppConfig; import com.loafle.overflow.JdbcConfiguration; +import com.loafle.overflow.module.domain.Domain; import com.loafle.overflow.module.noauthprobe.model.NoAuthProbe; import com.loafle.overflow.module.noauthprobe.type.AuthType; +import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -45,6 +47,13 @@ public class NoAuthProbeDAOTest { noAuthProbe.setStatus(AuthType.PROCESS); noAuthProbe.setTempProbeKey("4444"); + Domain d = new Domain(); + d.setId(1); + noAuthProbe.setDomain(d); + + System.out.println(noAuthProbe.getId()); + + Assert.assertNotEquals(noAuthProbe.getId(), 0); } diff --git a/src/test/java/com/loafle/overflow/noauthagent/dao/JPANoAuthAgentDAOTest.java b/src/test/java/com/loafle/overflow/noauthagent/dao/JPANoAuthAgentDAOTest.java deleted file mode 100644 index c2e6dc0..0000000 --- a/src/test/java/com/loafle/overflow/noauthagent/dao/JPANoAuthAgentDAOTest.java +++ /dev/null @@ -1,58 +0,0 @@ -//package com.loafle.overflow.noauthagent.dao; -// -//import com.loafle.overflow.module.noauthagent.dao.JPANoAuthAgentDAO; -//import com.loafle.overflow.module.noauthagent.model.NoAuthAgent; -//import com.loafle.overflow.module.noauthagent.type.AuthType; -//import org.junit.Before; -//import org.junit.Test; -// -//import java.util.Date; -// -///** -// * Created by root on 17. 6. 4. -// */ -//public class JPANoAuthAgentDAOTest { -// -// private JPANoAuthAgentDAO jpaNoAuthAgentDAO = null; -// -// @Before -// public void Before() { -// this.jpaNoAuthAgentDAO = new JPANoAuthAgentDAO(); -// } -// -// @Test -// public void findByTempKey() throws Exception { -// -// NoAuthAgent noAuthAgent = new NoAuthAgent(); -// noAuthAgent.setTempKey("3398473-90847903874"); -// -// NoAuthAgent aa = this.jpaNoAuthAgentDAO.findByTempKey(noAuthAgent); -// -// System.out.println(aa.getAuthStatus()); -// -// } -// -// @Test -// public void findAllByNoAuth() throws Exception { -// } -// -// -// @Test -// public void createNoAuthAgent() { -// NoAuthAgent noAuthAgent = new NoAuthAgent(); -// -// -// noAuthAgent.setApiKey("aaaaaaa"); -// noAuthAgent.setDate(new Date()); -// noAuthAgent.setHostName("Snoop pc"); -// noAuthAgent.setLocalIP(4123); -// noAuthAgent.setTempKey("3398473-90847903874"); -// noAuthAgent.setAuthStatus(AuthType.WAIT); -// -// this.jpaNoAuthAgentDAO.create(noAuthAgent); -// } -// -// -// -// -//} \ No newline at end of file