arranging
This commit is contained in:
parent
1e83857756
commit
ab4241a942
@ -49,7 +49,7 @@ public class Member {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Basic
|
@Basic
|
||||||
@Column(name = "PW", nullable = true, length = 32)
|
@Column(name = "PW", nullable = true, length = 64)
|
||||||
public String getPw() {
|
public String getPw() {
|
||||||
return pw;
|
return pw;
|
||||||
}
|
}
|
||||||
|
@ -239,20 +239,20 @@ INSERT INTO public.meta_sensor_item (id,create_date,"key","name",type_id) VALUES
|
|||||||
--
|
--
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
INSERT INTO public."member" (id,company_name,create_date,email,"name",phone,pw,status_id) VALUES (
|
INSERT INTO public."member" (company_name,create_date,email,"name",phone,pw,status_id) VALUES (
|
||||||
1,'loafle','2017-06-26 11:07:27.625','overflow@loafle.com','overFlow','000-000-0000','qwer5795',2);
|
'loafle','2017-06-26 11:07:27.625','overflow@loafle.com','overFlow','000-000-0000','qwer5795',2);
|
||||||
|
|
||||||
INSERT INTO public."member" (id,company_name,create_date,email,"name",phone,pw,status_id) VALUES (
|
INSERT INTO public."member" (company_name,create_date,email,"name",phone,pw,status_id) VALUES (
|
||||||
2,'loafle','2017-06-26 11:07:27.625','geek@loafle.com','geek','000-000-0000','qwer5795',1);
|
'loafle','2017-06-26 11:07:27.625','geek@loafle.com','geek','000-000-0000','qwer5795',1);
|
||||||
|
|
||||||
INSERT INTO public.email_auth (id,auth_confirm_date,create_date,email_auth_key,member_id) VALUES (
|
INSERT INTO public.email_auth (auth_confirm_date,create_date,email_auth_key,member_id) VALUES (
|
||||||
1,NULL,'2017-06-26 15:28:48.895','dbseogns1234',1);
|
NULL,'2017-06-26 15:28:48.895','dbseogns1234',1);
|
||||||
|
|
||||||
INSERT INTO public."domain" (id,create_date,"name") VALUES (
|
INSERT INTO public."domain" (create_date,"name") VALUES (
|
||||||
1,'2017-06-26 11:25:44.866','overFlow''s domain');
|
'2017-06-26 11:25:44.866','overFlow''s domain');
|
||||||
|
|
||||||
INSERT INTO public.domain_member (id,create_date,domain_id,member_id) VALUES (
|
INSERT INTO public.domain_member (create_date,domain_id,member_id) VALUES (
|
||||||
1,'2017-06-26 11:27:43.023',1,1);
|
'2017-06-26 11:27:43.023',1,1);
|
||||||
|
|
||||||
INSERT INTO public.api_key (api_key,create_date,domain_id) VALUES (
|
INSERT INTO public.api_key (api_key,create_date,domain_id) VALUES (
|
||||||
'52abd6fd57e511e7ac52080027658d13','2017-06-26 13:02:28.347',1);
|
'52abd6fd57e511e7ac52080027658d13','2017-06-26 13:02:28.347',1);
|
||||||
@ -272,12 +272,12 @@ INSERT INTO public.infra (child_id,create_date,type_id) VALUES (
|
|||||||
INSERT INTO public.target (create_date,infra_id,probe_id) VALUES (
|
INSERT INTO public.target (create_date,infra_id,probe_id) VALUES (
|
||||||
'2017-06-26 12:37:22.854',1,1);
|
'2017-06-26 12:37:22.854',1,1);
|
||||||
|
|
||||||
INSERT INTO public.sensor (id,crawler_input_items,create_date,description,crawler_id,status,target_id) VALUES (
|
INSERT INTO public.sensor (crawler_input_items,create_date,description,crawler_id,status,target_id) VALUES (
|
||||||
1,NULL,'2017-06-26 20:19:07.009','My sensor',1,1,1);
|
NULL,'2017-06-26 20:19:07.009','My sensor',1,1,1);
|
||||||
INSERT INTO public.sensor (id,crawler_input_items,create_date,description,crawler_id,status,target_id) VALUES (
|
INSERT INTO public.sensor (crawler_input_items,create_date,description,crawler_id,status,target_id) VALUES (
|
||||||
2,NULL,'2017-06-26 20:19:07.074','My sensor',1,1,1);
|
NULL,'2017-06-26 20:19:07.074','My sensor',1,1,1);
|
||||||
|
|
||||||
INSERT INTO public.sensor_item (id,create_date,item_id,sensor_id) VALUES (
|
INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES (
|
||||||
1,'2017-06-26 20:21:16.626',1,1);
|
'2017-06-26 20:21:16.626',1,1);
|
||||||
INSERT INTO public.sensor_item (id,create_date,item_id,sensor_id) VALUES (
|
INSERT INTO public.sensor_item (create_date,item_id,sensor_id) VALUES (
|
||||||
2,'2017-06-26 20:21:50.988',2,2);
|
'2017-06-26 20:21:50.988',2,2);
|
@ -30,7 +30,6 @@ public class MemberDAOTest {
|
|||||||
m.setName("insanity2");
|
m.setName("insanity2");
|
||||||
m.setCompanyName("loafle");
|
m.setCompanyName("loafle");
|
||||||
m.setPw("bbbbbbbbb");
|
m.setPw("bbbbbbbbb");
|
||||||
m.setPwSalt("salktttt");
|
|
||||||
m.setPhone("000-000-0000");
|
m.setPhone("000-000-0000");
|
||||||
m.setEmail("insanity111@loafle.com");
|
m.setEmail("insanity111@loafle.com");
|
||||||
m.setStatus(new MetaMemberStatus((short)1));
|
m.setStatus(new MetaMemberStatus((short)1));
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.loafle.overflow.module.member.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.module.member.model.Member;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaMemberStatus;
|
||||||
|
import com.loafle.overflow.spring.AppConfig;
|
||||||
|
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by insanity on 17. 6. 28.
|
||||||
|
*/
|
||||||
|
@Ignore
|
||||||
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
|
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||||
|
public class MemberServiceTest {
|
||||||
|
@Autowired
|
||||||
|
MemberService memberService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void regist() throws Exception {
|
||||||
|
Member m = new Member();
|
||||||
|
m.setPw("rawPassword");
|
||||||
|
m.setStatus(new MetaMemberStatus((short)1));
|
||||||
|
m.setCreateDate(new Date());
|
||||||
|
m.setCompanyName("Loafle");
|
||||||
|
m.setEmail("of@loafle.com");
|
||||||
|
m.setName("oF");
|
||||||
|
m.setPhone("00000000");
|
||||||
|
|
||||||
|
Member res = this.memberService.signup(m);
|
||||||
|
Assert.assertNotNull(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.loafle.overflow.module.sensor.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaSensorItem;
|
||||||
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
|
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||||
|
import com.loafle.overflow.spring.AppConfig;
|
||||||
|
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by insanity on 17. 6. 28.
|
||||||
|
*/
|
||||||
|
@Ignore
|
||||||
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
|
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||||
|
public class SensorItemServiceTest {
|
||||||
|
@Autowired
|
||||||
|
SensorItemService sensorItemService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void regist() throws Exception {
|
||||||
|
SensorItem sensorItem = new SensorItem();
|
||||||
|
sensorItem.setCreateDate(new Date());
|
||||||
|
MetaSensorItem item = new MetaSensorItem();
|
||||||
|
item.setId(1);
|
||||||
|
Sensor sensor = new Sensor();
|
||||||
|
sensor.setId(1);
|
||||||
|
sensorItem.setItem(item);
|
||||||
|
sensorItem.setSensor(sensor);
|
||||||
|
|
||||||
|
SensorItem res = this.sensorItemService.regist(sensorItem);
|
||||||
|
Assert.assertNotNull(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void read() throws Exception {
|
||||||
|
SensorItem res = this.sensorItemService.read("1");
|
||||||
|
Assert.assertNotNull(res);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.loafle.overflow.module.sensor.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaCrawler;
|
||||||
|
import com.loafle.overflow.module.meta.model.MetaSensorStatus;
|
||||||
|
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||||
|
import com.loafle.overflow.module.target.model.Target;
|
||||||
|
import com.loafle.overflow.spring.AppConfig;
|
||||||
|
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by insanity on 17. 6. 28.
|
||||||
|
*/
|
||||||
|
@Ignore
|
||||||
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
|
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||||
|
public class SensorServiceTest {
|
||||||
|
@Autowired
|
||||||
|
SensorService sensorService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void regist() throws Exception {
|
||||||
|
Sensor sensor = new Sensor();
|
||||||
|
MetaSensorStatus status = new MetaSensorStatus((short)1);
|
||||||
|
sensor.setStatus(status);
|
||||||
|
MetaCrawler crawler = new MetaCrawler();
|
||||||
|
crawler.setId((short)1);
|
||||||
|
sensor.setCrawler(crawler);
|
||||||
|
Target target = new Target();
|
||||||
|
target.setId(1);
|
||||||
|
sensor.setTarget(target);
|
||||||
|
sensor.setCreateDate(new Date());
|
||||||
|
|
||||||
|
Sensor res = this.sensorService.regist(sensor);
|
||||||
|
Assert.assertNotNull(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void read() throws Exception {
|
||||||
|
Sensor res = this.sensorService.read("1");
|
||||||
|
Assert.assertNotNull(res);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.loafle.overflow.module.target.dao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by insanity on 17. 6. 28.
|
||||||
|
*/
|
||||||
|
public class TargetDAOTest {
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.loafle.overflow.module.target.service;
|
||||||
|
|
||||||
|
import com.loafle.overflow.module.infra.model.Infra;
|
||||||
|
import com.loafle.overflow.module.probe.model.Probe;
|
||||||
|
import com.loafle.overflow.module.target.model.Target;
|
||||||
|
import com.loafle.overflow.spring.AppConfig;
|
||||||
|
import com.loafle.overflow.spring.JdbcConfiguration;
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by insanity on 17. 6. 28.
|
||||||
|
*/
|
||||||
|
@Ignore
|
||||||
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
|
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class})
|
||||||
|
public class TargetServiceTest {
|
||||||
|
@Autowired
|
||||||
|
TargetService targetService;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void regist() throws Exception {
|
||||||
|
Target t = new Target();
|
||||||
|
t.setCreateDate(new Date());
|
||||||
|
Infra infra = new Infra();
|
||||||
|
infra.setId(1);
|
||||||
|
Probe probe = new Probe();
|
||||||
|
probe.setId(1);
|
||||||
|
t.setProbe(probe);
|
||||||
|
t.setInfra(infra);
|
||||||
|
|
||||||
|
Target res = this.targetService.regist(t);
|
||||||
|
Assert.assertNotNull(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void read() throws Exception {
|
||||||
|
Target res = this.targetService.read("1");
|
||||||
|
Assert.assertNotNull(res);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user