fixed
probe task
This commit is contained in:
parent
909a7bd585
commit
be4f579d3a
|
@ -43,7 +43,7 @@ public class MetaProbeTaskType {
|
|||
}
|
||||
|
||||
@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() {
|
||||
return createDate;
|
||||
}
|
||||
|
|
|
@ -51,27 +51,6 @@ public class ProbeTask {
|
|||
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)
|
||||
public String getData() {
|
||||
return data;
|
||||
|
@ -81,8 +60,7 @@ public class ProbeTask {
|
|||
this.data = data;
|
||||
}
|
||||
|
||||
@Basic
|
||||
@Column(name = "CREATE_DATE", nullable = false)
|
||||
@Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = false)
|
||||
public Date getCreateDate() {
|
||||
return createDate;
|
||||
}
|
||||
|
@ -91,7 +69,6 @@ public class ProbeTask {
|
|||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
@Basic
|
||||
@Column(name = "SEND_DATE", nullable = true)
|
||||
public Date getSendDate() {
|
||||
return sendDate;
|
||||
|
@ -101,7 +78,6 @@ public class ProbeTask {
|
|||
this.sendDate = sendDate;
|
||||
}
|
||||
|
||||
@Basic
|
||||
@Column(name = "START_DATE", nullable = true)
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
|
@ -111,7 +87,6 @@ public class ProbeTask {
|
|||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
@Basic
|
||||
@Column(name = "END_DATE", nullable = true)
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
|
@ -121,7 +96,6 @@ public class ProbeTask {
|
|||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
@Basic
|
||||
@Column(name = "SUCCEED", nullable = true)
|
||||
public Boolean getSucceed() {
|
||||
return succeed;
|
||||
|
|
|
@ -238,4 +238,7 @@ INSERT INTO public.infra (id,child_id,create_date,type_id) VALUES (
|
|||
1,0,'2017-06-26 12:12:11.809',1);
|
||||
|
||||
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