test import modify

This commit is contained in:
geek 2017-08-09 12:52:48 +09:00
parent a010985c5e
commit 28b7215b0c
41 changed files with 113 additions and 182 deletions

View File

@ -1,4 +1,4 @@
datasource.url=jdbc:postgresql://192.168.1.209:5432/overflow datasource.url=jdbc:postgresql://192.168.1.51:5432/overflow
datasource.username=overflow datasource.username=overflow
datasource.password=qwer5795 datasource.password=qwer5795
datasource.driver-class-name=org.postgresql.Driver datasource.driver-class-name=org.postgresql.Driver

View File

@ -2,9 +2,7 @@ package com.loafle.overflow.module.apikey.service;
import com.loafle.overflow.module.apikey.model.ApiKey; import com.loafle.overflow.module.apikey.model.ApiKey;
import com.loafle.overflow.module.domain.model.Domain; import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 6. 28. * Created by snoop on 17. 6. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class ApiKeyServiceTest { public class ApiKeyServiceTest {
@Autowired @Autowired

View File

@ -3,8 +3,7 @@ package com.loafle.overflow.module.domain.service;
import com.loafle.overflow.module.domain.model.Domain; import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.module.domain.model.DomainMember; import com.loafle.overflow.module.domain.model.DomainMember;
import com.loafle.overflow.module.member.model.Member; import com.loafle.overflow.module.member.model.Member;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -19,7 +18,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 6. 28. * Created by snoop on 17. 6. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class DomainMemberServiceTest { public class DomainMemberServiceTest {
@Autowired @Autowired

View File

@ -1,8 +1,7 @@
package com.loafle.overflow.module.domain.service; package com.loafle.overflow.module.domain.service;
import com.loafle.overflow.module.domain.model.Domain; import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -17,7 +16,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 6. 28. * Created by snoop on 17. 6. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class DomainServiceTest { public class DomainServiceTest {
@Autowired @Autowired

View File

@ -1,7 +1,6 @@
package com.loafle.overflow.module.email.service; package com.loafle.overflow.module.email.service;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -15,7 +14,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@Ignore @Ignore
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class,MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class EmailAuthServiceTest { public class EmailAuthServiceTest {
@Autowired @Autowired

View File

@ -1,10 +1,9 @@
package com.loafle.overflow.module.infra.service; package com.loafle.overflow.module.infra.service;
import com.loafle.overflow.module.infra.model.InfraHost; import com.loafle.overflow.module.infra.model.InfraHost;
import com.loafle.overflow.module.infra.model.InfraOS; import com.loafle.overflow.module.infra.model.InfraOS;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
@ -14,11 +13,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class InfraHostServiceTest { public class InfraHostServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,8 @@
package com.loafle.overflow.module.infra.service; package com.loafle.overflow.module.infra.service;
import com.loafle.overflow.module.infra.model.InfraMachine; import com.loafle.overflow.module.infra.model.InfraMachine;
import com.loafle.overflow.spring.AppConfig;
import com.loafle.overflow.spring.JdbcConfiguration; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
@ -13,11 +12,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/** /**
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class InfraMachineServiceTest { public class InfraMachineServiceTest {
@Autowired @Autowired

View File

@ -2,9 +2,7 @@ package com.loafle.overflow.module.infra.service;
import com.loafle.overflow.module.infra.model.InfraOS; import com.loafle.overflow.module.infra.model.InfraOS;
import com.loafle.overflow.module.infra.model.InfraOSApplication; import com.loafle.overflow.module.infra.model.InfraOSApplication;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 28. * Created by snoop on 17. 7. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class InfraOSApplicationServiceTest { public class InfraOSApplicationServiceTest {
@Autowired @Autowired

View File

@ -2,9 +2,7 @@ package com.loafle.overflow.module.infra.service;
import com.loafle.overflow.module.infra.model.InfraOS; import com.loafle.overflow.module.infra.model.InfraOS;
import com.loafle.overflow.module.infra.model.InfraOSDaemon; import com.loafle.overflow.module.infra.model.InfraOSDaemon;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 28. * Created by snoop on 17. 7. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class InfraOSDaemonServiceTest { public class InfraOSDaemonServiceTest {
@Autowired @Autowired

View File

@ -2,9 +2,7 @@ package com.loafle.overflow.module.infra.service;
import com.loafle.overflow.module.infra.model.InfraOS; import com.loafle.overflow.module.infra.model.InfraOS;
import com.loafle.overflow.module.infra.model.InfraOSPort; import com.loafle.overflow.module.infra.model.InfraOSPort;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -18,7 +16,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 28. * Created by snoop on 17. 7. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class InfraOSPortServiceTest { public class InfraOSPortServiceTest {
@Autowired @Autowired

View File

@ -3,9 +3,7 @@ package com.loafle.overflow.module.infra.service;
import com.loafle.overflow.module.infra.model.InfraMachine; import com.loafle.overflow.module.infra.model.InfraMachine;
import com.loafle.overflow.module.infra.model.InfraOS; import com.loafle.overflow.module.infra.model.InfraOS;
import com.loafle.overflow.module.meta.model.MetaInfraVendor; import com.loafle.overflow.module.meta.model.MetaInfraVendor;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -18,7 +16,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class InfraOSServiceTest { public class InfraOSServiceTest {
@Autowired @Autowired

View File

@ -3,11 +3,8 @@ package com.loafle.overflow.module.infra.service;
import com.loafle.overflow.module.infra.model.InfraHost; import com.loafle.overflow.module.infra.model.InfraHost;
import com.loafle.overflow.module.infra.model.InfraService; import com.loafle.overflow.module.infra.model.InfraService;
import com.loafle.overflow.module.meta.model.MetaInfraType;
import com.loafle.overflow.module.meta.model.MetaInfraVendor; import com.loafle.overflow.module.meta.model.MetaInfraVendor;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -22,7 +19,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 28. * Created by snoop on 17. 7. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class InfraServiceServiceTest { public class InfraServiceServiceTest {
@Autowired @Autowired

View File

@ -4,9 +4,7 @@ import com.loafle.overflow.module.infra.model.Infra;
import com.loafle.overflow.module.meta.model.MetaInfraType; import com.loafle.overflow.module.meta.model.MetaInfraType;
import com.loafle.overflow.module.probe.model.Probe; import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.target.model.Target; import com.loafle.overflow.module.target.model.Target;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
@ -20,7 +18,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class InfraServiceTest { public class InfraServiceTest {
@Autowired @Autowired

View File

@ -16,10 +16,10 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* Created by geek on 17. 6. 28. * Created by geek on 17. 6. 28.
*/ */
//@Ignore @Ignore
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("test") @ActiveProfiles("test")
@ContextConfiguration(classes = {AppConfig.class, AppConfigTest.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MemberDAOTest { public class MemberDAOTest {
@Autowired @Autowired

View File

@ -2,9 +2,7 @@ package com.loafle.overflow.module.member.service;
import com.loafle.overflow.module.member.model.Member; import com.loafle.overflow.module.member.model.Member;
import com.loafle.overflow.module.meta.model.MetaMemberStatus; import com.loafle.overflow.module.meta.model.MetaMemberStatus;
import com.loafle.overflow.spring.AppConfig;
import com.loafle.overflow.spring.AppConfigTest; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -19,10 +17,10 @@ import java.util.Date;
/** /**
* Created by insanity on 17. 6. 28. * Created by insanity on 17. 6. 28.
*/ */
//@Ignore @Ignore
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("test") @ActiveProfiles("test")
@ContextConfiguration(classes = {AppConfig.class, AppConfigTest.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MemberServiceTest { public class MemberServiceTest {
@Autowired @Autowired
MemberService memberService; MemberService memberService;

View File

@ -2,9 +2,7 @@ package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaCrawler; import com.loafle.overflow.module.meta.model.MetaCrawler;
import com.loafle.overflow.module.meta.model.MetaCrawlerInputItem; import com.loafle.overflow.module.meta.model.MetaCrawlerInputItem;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaCrawlerInputItemServiceTest { public class MetaCrawlerInputItemServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaCrawler; import com.loafle.overflow.module.meta.model.MetaCrawler;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaCrawlerServiceTest { public class MetaCrawlerServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaInfraType; import com.loafle.overflow.module.meta.model.MetaInfraType;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaInfraTypeServiceTest { public class MetaInfraTypeServiceTest {
@Autowired @Autowired

View File

@ -2,9 +2,7 @@ package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaInfraType; import com.loafle.overflow.module.meta.model.MetaInfraType;
import com.loafle.overflow.module.meta.model.MetaInfraVendor; import com.loafle.overflow.module.meta.model.MetaInfraVendor;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaInfraVendorServiceTest { public class MetaInfraVendorServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaInputType; import com.loafle.overflow.module.meta.model.MetaInputType;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaInputTypeServiceTest { public class MetaInputTypeServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaMemberStatus; import com.loafle.overflow.module.meta.model.MetaMemberStatus;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaMemberStatusServiceTest { public class MetaMemberStatusServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus; import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaNoAuthProbeStatusServiceTest { public class MetaNoAuthProbeStatusServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaProbeArchitecture; import com.loafle.overflow.module.meta.model.MetaProbeArchitecture;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaProbeArchitectureServiceTest { public class MetaProbeArchitectureServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaProbeOs; import com.loafle.overflow.module.meta.model.MetaProbeOs;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaProbeOsServiceTest { public class MetaProbeOsServiceTest {
@Autowired @Autowired

View File

@ -2,9 +2,7 @@ package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaProbeOs; import com.loafle.overflow.module.meta.model.MetaProbeOs;
import com.loafle.overflow.module.meta.model.MetaProbePackage; import com.loafle.overflow.module.meta.model.MetaProbePackage;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -20,7 +18,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaProbePackageServiceTest { public class MetaProbePackageServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaProbeStatus; import com.loafle.overflow.module.meta.model.MetaProbeStatus;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaProbeStatusServiceTest { public class MetaProbeStatusServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaProbeTaskType; import com.loafle.overflow.module.meta.model.MetaProbeTaskType;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaProbeTaskTypeServiceTest { public class MetaProbeTaskTypeServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaProbeVersion; import com.loafle.overflow.module.meta.model.MetaProbeVersion;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaProbeVersionServiceTest { public class MetaProbeVersionServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaSensorItem; import com.loafle.overflow.module.meta.model.MetaSensorItem;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaSensorItemServiceTest { public class MetaSensorItemServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; 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.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaSensorItemTypeServiceTest { public class MetaSensorItemTypeServiceTest {
@Autowired @Autowired

View File

@ -1,9 +1,7 @@
package com.loafle.overflow.module.meta.service; package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaSensorStatus; import com.loafle.overflow.module.meta.model.MetaSensorStatus;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -19,7 +17,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaSensorStatusServiceTest { public class MetaSensorStatusServiceTest {
@Autowired @Autowired

View File

@ -3,9 +3,7 @@ package com.loafle.overflow.module.meta.service;
import com.loafle.overflow.module.meta.model.MetaCrawler; import com.loafle.overflow.module.meta.model.MetaCrawler;
import com.loafle.overflow.module.meta.model.MetaInfraVendor; import com.loafle.overflow.module.meta.model.MetaInfraVendor;
import com.loafle.overflow.module.meta.model.MetaVendorCrawler; import com.loafle.overflow.module.meta.model.MetaVendorCrawler;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -20,7 +18,7 @@ import java.util.List;
* Created by snoop on 17. 7. 27. * Created by snoop on 17. 7. 27.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class MetaVendorCrawlerServiceTest { public class MetaVendorCrawlerServiceTest {
@Autowired @Autowired

View File

@ -3,8 +3,7 @@ package com.loafle.overflow.module.noauthprobe.service;
import com.loafle.overflow.module.domain.model.Domain; import com.loafle.overflow.module.domain.model.Domain;
import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus; import com.loafle.overflow.module.meta.model.MetaNoAuthProbeStatus;
import com.loafle.overflow.module.noauthprobe.model.NoAuthProbe; import com.loafle.overflow.module.noauthprobe.model.NoAuthProbe;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -21,7 +20,7 @@ import static org.junit.Assert.*;
* Created by snoop on 17. 6. 28. * Created by snoop on 17. 6. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class NoAuthProbeServiceTest { public class NoAuthProbeServiceTest {
@Autowired @Autowired

View File

@ -5,9 +5,7 @@ import com.loafle.overflow.module.infra.model.InfraHost;
import com.loafle.overflow.module.member.model.Member; import com.loafle.overflow.module.member.model.Member;
import com.loafle.overflow.module.meta.model.MetaProbeStatus; import com.loafle.overflow.module.meta.model.MetaProbeStatus;
import com.loafle.overflow.module.probe.model.Probe; import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -22,7 +20,7 @@ import java.util.List;
* Created by snoop on 17. 6. 28. * Created by snoop on 17. 6. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class ProbeServiceTest { public class ProbeServiceTest {
@Autowired @Autowired

View File

@ -3,8 +3,7 @@ package com.loafle.overflow.module.probe.service;
import com.loafle.overflow.module.meta.model.MetaProbeTaskType; import com.loafle.overflow.module.meta.model.MetaProbeTaskType;
import com.loafle.overflow.module.probe.model.Probe; import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.module.probe.model.ProbeTask; import com.loafle.overflow.module.probe.model.ProbeTask;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -19,7 +18,7 @@ import java.util.List;
* Created by snoop on 17. 6. 28. * Created by snoop on 17. 6. 28.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class ProbeTaskServiceTest { public class ProbeTaskServiceTest {
@Autowired @Autowired

View File

@ -3,9 +3,7 @@ package com.loafle.overflow.module.sensor.service;
import com.loafle.overflow.module.meta.model.MetaSensorItem; import com.loafle.overflow.module.meta.model.MetaSensorItem;
import com.loafle.overflow.module.sensor.model.Sensor; import com.loafle.overflow.module.sensor.model.Sensor;
import com.loafle.overflow.module.sensor.model.SensorItem; import com.loafle.overflow.module.sensor.model.SensorItem;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
@ -24,7 +22,7 @@ import java.util.List;
*/ */
@Ignore @Ignore
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class SensorItemServiceTest { public class SensorItemServiceTest {
@Autowired @Autowired
SensorItemService sensorItemService; SensorItemService sensorItemService;

View File

@ -4,9 +4,7 @@ import com.loafle.overflow.module.meta.model.MetaCrawler;
import com.loafle.overflow.module.meta.model.MetaSensorStatus; import com.loafle.overflow.module.meta.model.MetaSensorStatus;
import com.loafle.overflow.module.sensor.model.Sensor; import com.loafle.overflow.module.sensor.model.Sensor;
import com.loafle.overflow.module.target.model.Target; import com.loafle.overflow.module.target.model.Target;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
@ -24,7 +22,7 @@ import java.util.List;
*/ */
@Ignore @Ignore
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class SensorServiceTest { public class SensorServiceTest {
@Autowired @Autowired
SensorService sensorService; SensorService sensorService;

View File

@ -2,28 +2,23 @@ package com.loafle.overflow.module.target.service;
import com.loafle.overflow.module.discovery.model.Host; import com.loafle.overflow.module.discovery.model.Host;
import com.loafle.overflow.module.probe.model.Probe; import com.loafle.overflow.module.probe.model.Probe;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.codehaus.jackson.map.DeserializationConfig; import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
import org.junit.Ignore; 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.aop.framework.Advised;
import org.springframework.aop.support.AopUtils; import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.ResourceLoader;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.ReflectionUtils;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType; import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.List; import java.util.List;
@ -32,7 +27,7 @@ import java.util.List;
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class TargetDiscoveryServiceTest { public class TargetDiscoveryServiceTest {
@Autowired @Autowired

View File

@ -1,11 +1,7 @@
package com.loafle.overflow.module.target.service; 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.module.target.model.Target;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -21,7 +17,7 @@ import java.util.Date;
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class TargetServiceTest { public class TargetServiceTest {
@Autowired @Autowired
TargetService targetService; TargetService targetService;

View File

@ -3,9 +3,7 @@ package com.loafle.overflow.proxy;
import com.google.common.primitives.Primitives; import com.google.common.primitives.Primitives;
import com.google.protobuf.ByteString; import com.google.protobuf.ByteString;
import com.loafle.overflow.module.target.service.TargetDiscoveryService; import com.loafle.overflow.module.target.service.TargetDiscoveryService;
import com.loafle.overflow.spring.AppConfig; import com.loafle.overflow.spring.AppConfigTest;
import com.loafle.overflow.spring.JdbcConfiguration;
import com.loafle.overflow.spring.MailConfiguration;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -23,26 +21,25 @@ import static org.junit.Assert.*;
* Created by crusader on 17. 6. 30. * Created by crusader on 17. 6. 30.
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {AppConfig.class, JdbcConfiguration.class, MailConfiguration.class}) @ContextConfiguration(classes = {AppConfigTest.class})
public class ServiceInvokerTest { public class ServiceInvokerTest {
@Autowired @Autowired
private ServiceInvoker serviceInvoker; private ServiceInvoker serviceInvoker;
@Ignore
@Test @Test
public void invoke() throws Exception { public void invoke() throws Exception {
List<ByteString> params = new ArrayList<>(2); // List<ByteString> params = new ArrayList<>(2);
params.add(ByteString.copyFromUtf8("[{\"id\": 1," + // params.add(ByteString.copyFromUtf8("[{\"id\": 1," +
"\"ip\":2312132112," + // "\"ip\":2312132112," +
"\"mac\":12312312," + // "\"mac\":12312312," +
"\"os\": \"Windows\"," + // "\"os\": \"Windows\"," +
"\"target\":true}]")); // "\"target\":true}]"));
params.add(ByteString.copyFromUtf8("{\"id\": 1," + // params.add(ByteString.copyFromUtf8("{\"id\": 1," +
"\"ip\":2312132112," + // "\"ip\":2312132112," +
"\"probeKey\":\"sdfsdfsdfsdfsd\"}")); // "\"probeKey\":\"sdfsdfsdfsdfsd\"}"));
//
serviceInvoker.invoke("TargetDiscoveryService", "saveAllTarget", params); // serviceInvoker.invoke("TargetDiscoveryService", "saveAllTarget", params);
List<ByteString> params2 = new ArrayList<>(1); List<ByteString> params2 = new ArrayList<>(1);
params2.add(ByteString.copyFromUtf8("1")); params2.add(ByteString.copyFromUtf8("1"));

View File

@ -1,12 +1,11 @@
package com.loafle.overflow.spring; package com.loafle.overflow.spring;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.*;
import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource;
import org.springframework.context.annotation.Profile; import org.springframework.core.io.Resource;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.TestPropertySource;
import javax.sql.DataSource;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@ -14,16 +13,22 @@ import static org.junit.Assert.*;
* Created by geek on 17. 8. 8. * Created by geek on 17. 8. 8.
*/ */
@Configuration @Configuration
@Profile("test") @ComponentScan(basePackages = {"com.loafle.overflow"}, excludeFilters = @ComponentScan.Filter({Configuration.class}))
@Import({JdbcConfiguration.class, MailConfiguration.class})
@TestPropertySource({"classpath:database.properties","classpath:mail.properties"})
public class AppConfigTest { public class AppConfigTest {
@Autowired
private DataSource configureDataSource;
@Bean @Bean
public JdbcTemplate jdbcTemplate() { public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
JdbcTemplate template = new JdbcTemplate(); PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
template.setDataSource(configureDataSource); // ppc.setLocation(new ClassPathResource("database.properties"));
return template; ppc.setLocations(new Resource[] {
new ClassPathResource("database.properties"),
new ClassPathResource("mail.properties")
});
ppc.setIgnoreUnresolvablePlaceholders(true);
return ppc;
} }
} }