Skip to content

Commit

Permalink
测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
spjich committed Dec 29, 2018
1 parent 94be635 commit 4680cb2
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.concurrent.TimeUnit;
Expand All @@ -20,7 +21,7 @@
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ApplicationTest.class)
@ComponentScan
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,classes = MainTest.class)})
@EnableAutoConfiguration
public class ApplicationTest {
private Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.dot.fashion.retrieval.spring;

import com.dot.fashion.retrieval.spring.annotation.service.TestService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
* title:
* author:吉
* since:2018/12/29
*/
@SpringBootApplication
public class MainTest implements ApplicationListener<ContextRefreshedEvent> {
/**
* title:
* author:吉
* since:2018/12/28
*/
private Logger logger = LoggerFactory.getLogger(com.dot.fashion.retrieval.spring.ApplicationTest.class);
@Autowired
private TestService testService;

public void test() {
}

@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
logger.info("执行结果:" + testService.test(1));

}

public static void main(String[] args) {
SpringApplication.run(com.dot.fashion.retrieval.spring.ApplicationTest.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TestServiceImpl implements TestService {

@Retrieval(retry = 3,
delayMilli = 1000,
module = RetryModule.SYNC,
module = RetryModule.ASYNC,
timeLimitMilli = 15000)
public List<String> test(int a) {
logger.info("执行test");
Expand Down

0 comments on commit 4680cb2

Please sign in to comment.