This commit is contained in:
insanity 2017-11-06 17:46:06 +09:00
parent 7968d4f8db
commit 6527e84a9a
6 changed files with 628 additions and 593 deletions

View File

@ -16,7 +16,6 @@ public class MetaSensorItem {
private Date createDate;
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
public int getId() {
return id;
}

View File

@ -14,6 +14,13 @@ public class MetaSensorItemType {
private String description;
private Date createDate;
public MetaSensorItemType() {
}
public MetaSensorItemType(short id) {
this.id = id;
}
@Id
public short getId() {
return id;

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List;
import static org.junit.Assert.*;
/**
* Created by snoop on 17. 7. 27.
*/
@ -32,4 +30,5 @@ public class MetaSensorItemServiceTest {
}
}

View File

@ -10,8 +10,6 @@ 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.Date;
import java.util.List;
/**
@ -32,90 +30,4 @@ public class MetaSensorItemTypeServiceTest {
Assert.assertNotEquals(metaSensorItemTypes.size(), 0);
}
@Test
public void regist() throws Exception {
List<MetaSensorItemType> list = new ArrayList<>();
//SSH
MetaSensorItemType sshload = new MetaSensorItemType();
sshload.setId((short)1);
sshload.setCreateDate(new Date());
sshload.setName("ssh.load");
list.add(sshload);
MetaSensorItemType sshcpu = new MetaSensorItemType();
sshcpu.setId((short)2);
sshcpu.setCreateDate(new Date());
sshcpu.setName("ssh.cpu");
list.add(sshcpu);
MetaSensorItemType sshmem = new MetaSensorItemType();
sshmem.setId((short)3);
sshmem.setCreateDate(new Date());
sshmem.setName("ssh.mem");
list.add(sshmem);
MetaSensorItemType sshdiskio = new MetaSensorItemType();
sshdiskio.setId((short)4);
sshdiskio.setCreateDate(new Date());
sshdiskio.setName("ssh.disk_io");
list.add(sshdiskio);
MetaSensorItemType sshdiskfree = new MetaSensorItemType();
sshdiskfree.setId((short)5);
sshdiskfree.setCreateDate(new Date());
sshdiskfree.setName("ssh.disk_free");
list.add(sshdiskfree);
MetaSensorItemType sshnetwork = new MetaSensorItemType();
sshnetwork.setId((short)6);
sshnetwork.setCreateDate(new Date());
sshnetwork.setName("ssh.network");
list.add(sshnetwork);
MetaSensorItemType sshps = new MetaSensorItemType();
sshps.setId((short)7);
sshps.setCreateDate(new Date());
sshps.setName("ssh.process");
list.add(sshps);
//WMI
MetaSensorItemType wmicpu = new MetaSensorItemType();
wmicpu.setId((short)8);
wmicpu.setCreateDate(new Date());
wmicpu.setName("wmi.cpu");
list.add(wmicpu);
List<MetaSensorItemType> result = this.sensorItemTypeService.registAll(list);
Assert.assertEquals(list.size(), result.size());
}
}
/*
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'1','2017-06-26 19:49','CPU blah blah blah','CPU');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'2','2017-06-26 19:49','MEMORY blah blah blah','MEMORY');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'3','2017-06-26 19:49','DISK blah blah blah','DISK');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'4','2017-06-26 19:49','INNODB MYSQL','INNODB.MYSQL');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'5','2017-06-26 19:49','NET MYSQL','NET.MYSQL');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'6','2017-06-26 19:49','PERFOMANCE MYSQL','PERFOMANCE.MYSQL');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'7','2017-06-26 19:49','JMX Tomcat Thread Info','ThreadPool');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'8','2017-06-26 19:49','JMX Tomcat GlobalRequest Info','GlobalRequestProcessor');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'9','2017-06-26 19:49','JMX Tomcat Servlet Info','Servlet');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'10','2017-06-26 19:49','JMX Tomcat StringCache Info','StringCache');
INSERT INTO meta_sensor_item_type (id,create_date,description,name) VALUES (
'11','2017-06-26 19:49','JMX Tomcat JspMonitor Info','JspMonitor');
*/

View File

@ -2,6 +2,7 @@ package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaSensorItemUnit;
import com.loafle.overflow.spring.AppConfigTest;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,7 +20,16 @@ public class MetaSensorItemUnitServiceTest {
private MetaSensorItemUnitService service;
@Test
@Ignore
public void regist() throws Exception {
MetaSensorItemUnit defaultValue = new MetaSensorItemUnit();
defaultValue.setId((short)0);
defaultValue.setUnit("");
defaultValue.setMark("");
this.service.regist(defaultValue);
MetaSensorItemUnit unit1 = new MetaSensorItemUnit();
unit1.setId((short)1);
unit1.setUnit("Percentage");