diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeVersionService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeVersionService.java new file mode 100644 index 0000000..bbfc93f --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeVersionService.java @@ -0,0 +1,22 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaProbeVersionDAO; +import com.loafle.overflow.module.meta.model.MetaProbeVersion; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaProbeVersionService") +public class MetaProbeVersionService { + + @Autowired + private MetaProbeVersionDAO probeVersionDAO; + + public List readAll() { + return this.probeVersionDAO.findAll(); + } +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorItemService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorItemService.java new file mode 100644 index 0000000..0a90c1d --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorItemService.java @@ -0,0 +1,24 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaSensorItemDAO; +import com.loafle.overflow.module.meta.model.MetaSensorItem; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaSensorItemService") +public class MetaSensorItemService { + + @Autowired + private MetaSensorItemDAO metaSensorItemDAO; + + + public List readAll() { + return this.metaSensorItemDAO.findAll(); + } + +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorStatusService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorStatusService.java new file mode 100644 index 0000000..7239106 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaSensorStatusService.java @@ -0,0 +1,23 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaSensorStatusDAO; +import com.loafle.overflow.module.meta.model.MetaSensorStatus; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaSensorStatusService") +public class MetaSensorStatusService { + + @Autowired + private MetaSensorStatusDAO sensorStatusDAO; + + List readAll() { + return this.sensorStatusDAO.findAll(); + } + +} diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeVersionServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeVersionServiceTest.java new file mode 100644 index 0000000..08aa4b1 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeVersionServiceTest.java @@ -0,0 +1,38 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.model.MetaProbeVersion; +import com.loafle.overflow.spring.AppConfig; +import com.loafle.overflow.spring.JdbcConfiguration; +import com.loafle.overflow.spring.MailConfiguration; +import org.junit.Assert; +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.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaProbeVersionServiceTest { + + @Autowired + private MetaProbeVersionService probeVersionService; + + @Test + public void readAll() throws Exception { + + List probeVersionList = this.probeVersionService.readAll(); + + Assert.assertNotEquals(probeVersionList.size(), 0); + + } + + +} \ No newline at end of file diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemServiceTest.java new file mode 100644 index 0000000..fdf31be --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorItemServiceTest.java @@ -0,0 +1,37 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.model.MetaSensorItem; +import com.loafle.overflow.spring.AppConfig; +import com.loafle.overflow.spring.JdbcConfiguration; +import com.loafle.overflow.spring.MailConfiguration; +import org.junit.Assert; +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.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaSensorItemServiceTest { + + @Autowired + private MetaSensorItemService metaSensorItemService; + + @Test + public void readAll() throws Exception { + + List metaSensorItems = this.metaSensorItemService.readAll(); + + Assert.assertNotEquals(metaSensorItems.size(), 0); + + } + +} \ No newline at end of file diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorStatusServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorStatusServiceTest.java new file mode 100644 index 0000000..5b7ffaf --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaSensorStatusServiceTest.java @@ -0,0 +1,37 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.model.MetaSensorStatus; +import com.loafle.overflow.spring.AppConfig; +import com.loafle.overflow.spring.JdbcConfiguration; +import com.loafle.overflow.spring.MailConfiguration; +import org.junit.Assert; +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.List; + +import static org.junit.Assert.*; + +/** + * Created by snoop on 17. 7. 27. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) +public class MetaSensorStatusServiceTest { + + @Autowired + private MetaSensorStatusService sensorStatusService; + + @Test + public void readAll() throws Exception { + + List sensorStatuses = this.sensorStatusService.readAll(); + + Assert.assertNotEquals(sensorStatuses.size(), 0); + + } + +} \ No newline at end of file