Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
fc97953724
|
@ -43,7 +43,7 @@ public class MetaProbeTaskType {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
@Column(name = "CREATE_DATE", nullable = false)
|
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
|
||||||
public Date getCreateDate() {
|
public Date getCreateDate() {
|
||||||
return createDate;
|
return createDate;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,27 +51,6 @@ public class ProbeTask {
|
||||||
this.probe = probe;
|
this.probe = probe;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Basic
|
|
||||||
// @Column(name = "TYPE_ID", nullable = false)
|
|
||||||
// public short getTypeId() {
|
|
||||||
// return typeId;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void setTypeId(short typeId) {
|
|
||||||
// this.typeId = typeId;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Basic
|
|
||||||
// @Column(name = "PROBE_ID", nullable = false)
|
|
||||||
// public long getProbeId() {
|
|
||||||
// return probeId;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void setProbeId(long probeId) {
|
|
||||||
// this.probeId = probeId;
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Basic
|
|
||||||
@Column(name = "DATA", nullable = true, length = 255)
|
@Column(name = "DATA", nullable = true, length = 255)
|
||||||
public String getData() {
|
public String getData() {
|
||||||
return data;
|
return data;
|
||||||
|
@ -81,8 +60,7 @@ public class ProbeTask {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Basic
|
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
|
||||||
@Column(name = "CREATE_DATE", nullable = false)
|
|
||||||
public Date getCreateDate() {
|
public Date getCreateDate() {
|
||||||
return createDate;
|
return createDate;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +69,6 @@ public class ProbeTask {
|
||||||
this.createDate = createDate;
|
this.createDate = createDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Basic
|
|
||||||
@Column(name = "SEND_DATE", nullable = true)
|
@Column(name = "SEND_DATE", nullable = true)
|
||||||
public Date getSendDate() {
|
public Date getSendDate() {
|
||||||
return sendDate;
|
return sendDate;
|
||||||
|
@ -101,7 +78,6 @@ public class ProbeTask {
|
||||||
this.sendDate = sendDate;
|
this.sendDate = sendDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Basic
|
|
||||||
@Column(name = "START_DATE", nullable = true)
|
@Column(name = "START_DATE", nullable = true)
|
||||||
public Date getStartDate() {
|
public Date getStartDate() {
|
||||||
return startDate;
|
return startDate;
|
||||||
|
@ -111,7 +87,6 @@ public class ProbeTask {
|
||||||
this.startDate = startDate;
|
this.startDate = startDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Basic
|
|
||||||
@Column(name = "END_DATE", nullable = true)
|
@Column(name = "END_DATE", nullable = true)
|
||||||
public Date getEndDate() {
|
public Date getEndDate() {
|
||||||
return endDate;
|
return endDate;
|
||||||
|
@ -121,7 +96,6 @@ public class ProbeTask {
|
||||||
this.endDate = endDate;
|
this.endDate = endDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Basic
|
|
||||||
@Column(name = "SUCCEED", nullable = true)
|
@Column(name = "SUCCEED", nullable = true)
|
||||||
public Boolean getSucceed() {
|
public Boolean getSucceed() {
|
||||||
return succeed;
|
return succeed;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.loafle.overflow.db.api.DBInput;
|
||||||
import com.loafle.overflow.db.api.DBOutput;
|
import com.loafle.overflow.db.api.DBOutput;
|
||||||
import com.loafle.overflow.module.domain.dao.DomainDAO;
|
import com.loafle.overflow.module.domain.dao.DomainDAO;
|
||||||
import com.loafle.overflow.module.email.dao.EmailAuthDAO;
|
import com.loafle.overflow.module.email.dao.EmailAuthDAO;
|
||||||
|
import com.loafle.overflow.module.infra.dao.*;
|
||||||
import com.loafle.overflow.module.member.dao.MemberDAO;
|
import com.loafle.overflow.module.member.dao.MemberDAO;
|
||||||
import com.loafle.overflow.module.noauthprobe.dao.NoAuthProbeDAO;
|
import com.loafle.overflow.module.noauthprobe.dao.NoAuthProbeDAO;
|
||||||
import com.loafle.overflow.module.probe.dao.ProbeDAO;
|
import com.loafle.overflow.module.probe.dao.ProbeDAO;
|
||||||
|
@ -42,14 +43,21 @@ public class DBProxy {
|
||||||
|
|
||||||
daoMap.put("member", ctx.getBean(MemberDAO.class));
|
daoMap.put("member", ctx.getBean(MemberDAO.class));
|
||||||
daoMap.put("probe", ctx.getBean(ProbeDAO.class));
|
daoMap.put("probe", ctx.getBean(ProbeDAO.class));
|
||||||
|
|
||||||
daoMap.put("noauthProbe", ctx.getBean(NoAuthProbeDAO.class));
|
daoMap.put("noauthProbe", ctx.getBean(NoAuthProbeDAO.class));
|
||||||
daoMap.put("emailAuth", ctx.getBean(EmailAuthDAO.class));
|
daoMap.put("emailAuth", ctx.getBean(EmailAuthDAO.class));
|
||||||
daoMap.put("sensor", ctx.getBean(SensorDao.class));
|
daoMap.put("sensor", ctx.getBean(SensorDao.class));
|
||||||
daoMap.put("sensorItem", ctx.getBean(SensorItemDao.class));
|
daoMap.put("sensorItem", ctx.getBean(SensorItemDao.class));
|
||||||
daoMap.put("domain", ctx.getBean(DomainDAO.class));
|
daoMap.put("domain", ctx.getBean(DomainDAO.class));
|
||||||
|
daoMap.put("target", ctx.getBean(DomainDAO.class));
|
||||||
|
daoMap.put("infra", ctx.getBean(InfraDAO.class));
|
||||||
|
daoMap.put("infraHost", ctx.getBean(InfraHostDAO.class));
|
||||||
|
daoMap.put("infraMachine", ctx.getBean(InfraMachineDAO.class));
|
||||||
|
daoMap.put("infraOS", ctx.getBean(InfraOSDAO.class));
|
||||||
|
daoMap.put("infraOSApplication", ctx.getBean(InfraOSApplicationDAO.class));
|
||||||
|
daoMap.put("infraOSDaemon", ctx.getBean(InfraOSDaemonDAO.class));
|
||||||
|
daoMap.put("infraOSPort", ctx.getBean(InfraOSPortDAO.class));
|
||||||
|
daoMap.put("infraService", ctx.getBean(InfraServiceDAO.class));
|
||||||
|
|
||||||
// daoMap.put("target", targetDAO);
|
|
||||||
// daoMap.put("crawler", crawlerDAO);
|
// daoMap.put("crawler", crawlerDAO);
|
||||||
// daoMap.put("crawlerInputItem", crawlerInputItemDAO);
|
// daoMap.put("crawlerInputItem", crawlerInputItemDAO);
|
||||||
// daoMap.put("crawlerInputItemMapping", crawlerInputItemMappingDAO);
|
// daoMap.put("crawlerInputItemMapping", crawlerInputItemMappingDAO);
|
||||||
|
|
|
@ -239,3 +239,6 @@ INSERT INTO public.infra (id,child_id,create_date,type_id) VALUES (
|
||||||
|
|
||||||
INSERT INTO public.target (id,create_date,infra_id,probe_id) VALUES (
|
INSERT INTO public.target (id,create_date,infra_id,probe_id) VALUES (
|
||||||
1,'2017-06-26 12:37:22.854',1,1);
|
1,'2017-06-26 12:37:22.854',1,1);
|
||||||
|
|
||||||
|
INSERT INTO public.meta_probe_task_type (id,create_date,description,"name") VALUES (
|
||||||
|
1,'2017-06-26 15:58:02.397','DISCOVERY START','DISCOVERY');
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
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.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.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by snoop on 17. 6. 26.
|
||||||
|
*/
|
||||||
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
|
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||||
|
public class MetaProbeTaskTypeDAOTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MetaProbeTaskTypeDAO metaProbeTaskTypeDAO;
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void Create() {
|
||||||
|
|
||||||
|
MetaProbeTaskType metaDiscovery = new MetaProbeTaskType();
|
||||||
|
|
||||||
|
metaDiscovery.setDescription("DISCOVERY START");
|
||||||
|
metaDiscovery.setName("DISCOVERY");
|
||||||
|
|
||||||
|
|
||||||
|
List<MetaProbeTaskType> pttlist = new ArrayList<>();
|
||||||
|
|
||||||
|
pttlist.add(metaDiscovery);
|
||||||
|
|
||||||
|
for(int indexI = 1; indexI <= pttlist.size() ;++indexI) {
|
||||||
|
MetaProbeTaskType type = pttlist.get(indexI - 1);
|
||||||
|
type.setId((short)indexI);
|
||||||
|
this.metaProbeTaskTypeDAO.save(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user