diff --git a/src/main/java/com/loafle/overflow/module/meta/dao/MetaProbePackageDAO.java b/src/main/java/com/loafle/overflow/module/meta/dao/MetaProbePackageDAO.java index 445166f..b05873c 100644 --- a/src/main/java/com/loafle/overflow/module/meta/dao/MetaProbePackageDAO.java +++ b/src/main/java/com/loafle/overflow/module/meta/dao/MetaProbePackageDAO.java @@ -1,13 +1,17 @@ package com.loafle.overflow.module.meta.dao; +import com.loafle.overflow.module.meta.model.MetaProbeOs; import com.loafle.overflow.module.meta.model.MetaProbePackage; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; + /** * Created by insanity on 17. 6. 23. */ @Repository public interface MetaProbePackageDAO extends JpaRepository { + List findAllByOs(MetaProbeOs metaProbeOs); } diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaProbePackageService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbePackageService.java new file mode 100644 index 0000000..f62c45c --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbePackageService.java @@ -0,0 +1,24 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaProbePackageDAO; +import com.loafle.overflow.module.meta.model.MetaProbeOs; +import com.loafle.overflow.module.meta.model.MetaProbePackage; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaProbePackageService") +public class MetaProbePackageService { + + @Autowired + private MetaProbePackageDAO probePackageDAO; + + public List readAllByOs(MetaProbeOs metaProbeOs) { + return this.probePackageDAO.findAllByOs(metaProbeOs); + } + +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeStatusService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeStatusService.java new file mode 100644 index 0000000..60cd624 --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeStatusService.java @@ -0,0 +1,23 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaProbeStatusDAO; +import com.loafle.overflow.module.meta.model.MetaProbeStatus; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaProbeStatusService") +public class MetaProbeStatusService { + + @Autowired + private MetaProbeStatusDAO probeStatusDAO; + + public List readAll() { + return this.probeStatusDAO.findAll(); + } + +} diff --git a/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeService.java b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeService.java new file mode 100644 index 0000000..d2c781a --- /dev/null +++ b/src/main/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeService.java @@ -0,0 +1,22 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.dao.MetaProbeTaskTypeDAO; +import com.loafle.overflow.module.meta.model.MetaProbeTaskType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * Created by snoop on 17. 7. 27. + */ +@Service("MetaProbeTaskTypeService") +public class MetaProbeTaskTypeService { + + @Autowired + private MetaProbeTaskTypeDAO probeTaskTypeDAO; + + public List readAll() { + return this.probeTaskTypeDAO.findAll(); + } +} diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbePackageServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbePackageServiceTest.java new file mode 100644 index 0000000..e8c6763 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbePackageServiceTest.java @@ -0,0 +1,41 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.model.MetaProbeOs; +import com.loafle.overflow.module.meta.model.MetaProbePackage; +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 MetaProbePackageServiceTest { + + @Autowired + private MetaProbePackageService probePackageService; + + @Test + public void readAllByOs() throws Exception { + + MetaProbeOs metaProbeOs = new MetaProbeOs(); + metaProbeOs.setId((short)1); + + List metaProbePackages = this.probePackageService.readAllByOs(metaProbeOs); + + Assert.assertNotEquals(metaProbePackages.size(), 0); + + } + +} \ No newline at end of file diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeStatusServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeStatusServiceTest.java new file mode 100644 index 0000000..c178729 --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeStatusServiceTest.java @@ -0,0 +1,36 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.model.MetaProbeStatus; +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 MetaProbeStatusServiceTest { + + @Autowired + private MetaProbeStatusService probeStatusService; + + @Test + public void readAll() throws Exception { + + List metaProbeStatuses = this.probeStatusService.readAll(); + + Assert.assertNotEquals(metaProbeStatuses.size(), 0); + } + +} \ No newline at end of file diff --git a/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeServiceTest.java b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeServiceTest.java new file mode 100644 index 0000000..2a5ea1a --- /dev/null +++ b/src/test/java/com/loafle/overflow/module/meta/service/MetaProbeTaskTypeServiceTest.java @@ -0,0 +1,37 @@ +package com.loafle.overflow.module.meta.service; + +import com.loafle.overflow.module.meta.model.MetaProbeTaskType; +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 MetaProbeTaskTypeServiceTest { + + @Autowired + private MetaProbeTaskTypeService probeTaskTypeService; + + @Test + public void readAll() throws Exception { + + List probeTaskTypes = this.probeTaskTypeService.readAll(); + + Assert.assertNotEquals(probeTaskTypes.size(), 0 ); + + } + +} \ No newline at end of file