Merge remote-tracking branch 'origin/master'

This commit is contained in:
snoop 2017-11-07 11:19:56 +09:00
commit c02f035623
7 changed files with 625 additions and 516 deletions

View File

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

View File

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

View File

@ -19,4 +19,12 @@ public class MetaSensorItemTypeService {
public List<MetaSensorItemType> readAll() { public List<MetaSensorItemType> readAll() {
return this.sensorItemTypeDAO.findAll(); return this.sensorItemTypeDAO.findAll();
} }
public MetaSensorItemType regist(MetaSensorItemType type){
return this.sensorItemTypeDAO.save(type);
}
public List<MetaSensorItemType> registAll(List<MetaSensorItemType> list) {
return this.sensorItemTypeDAO.save(list);
}
} }

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 java.util.List;
import static org.junit.Assert.*;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@ -32,4 +30,5 @@ public class MetaSensorItemServiceTest {
} }
} }

View File

@ -3,6 +3,7 @@ package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaSensorItemType; import com.loafle.overflow.module.meta.model.MetaSensorItemType;
import com.loafle.overflow.spring.AppConfigTest; import com.loafle.overflow.spring.AppConfigTest;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -11,8 +12,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.List; import java.util.List;
import static org.junit.Assert.*;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@ -24,6 +23,7 @@ public class MetaSensorItemTypeServiceTest {
private MetaSensorItemTypeService sensorItemTypeService; private MetaSensorItemTypeService sensorItemTypeService;
@Test @Test
@Ignore
public void readAll() throws Exception { public void readAll() throws Exception {
List<MetaSensorItemType> metaSensorItemTypes = this.sensorItemTypeService.readAll(); List<MetaSensorItemType> metaSensorItemTypes = this.sensorItemTypeService.readAll();

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