orderd-junit-spring

Sprint junit integration.

License

License

Categories

Categories

JUnit Unit Testing
GroupId

GroupId

com.bestxty
ArtifactId

ArtifactId

orderd-junit-spring
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

orderd-junit-spring
Sprint junit integration.
Project URL

Project URL

https://github.com/swjjxyxty/ordered-junit-build/tree/master/orderd-junit-spring

Download orderd-junit-spring

How to add to project

<!-- https://jarcasting.com/artifacts/com.bestxty/orderd-junit-spring/ -->
<dependency>
    <groupId>com.bestxty</groupId>
    <artifactId>orderd-junit-spring</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.bestxty/orderd-junit-spring/
implementation 'com.bestxty:orderd-junit-spring:1.0.1'
// https://jarcasting.com/artifacts/com.bestxty/orderd-junit-spring/
implementation ("com.bestxty:orderd-junit-spring:1.0.1")
'com.bestxty:orderd-junit-spring:jar:1.0.1'
<dependency org="com.bestxty" name="orderd-junit-spring" rev="1.0.1">
  <artifact name="orderd-junit-spring" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.bestxty', module='orderd-junit-spring', version='1.0.1')
)
libraryDependencies += "com.bestxty" % "orderd-junit-spring" % "1.0.1"
[com.bestxty/orderd-junit-spring "1.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
com.bestxty : orderd-junit jar 1.0.1
org.springframework : spring-test jar 4.3.14.RELEASE

test (2)

Group / Artifact Type Version
org.springframework : spring-context jar 4.3.14.RELEASE
org.springframework : spring-beans jar 4.3.14.RELEASE

Project Modules

There are no modules declared in this project.

ordered-junit-build

支持自定义junit方法排序.

Examples

@RunWith(OrderedRunner.class)
public class OrderedRunnerTest {


    @TestOrder(1)
    @Test
    public void test2() {
        System.out.println("OrderedRunnerTest.test2");
    }


    @TestOrder(2)
    @Test
    public void test1() {
        System.out.println("OrderedRunnerTest.test1");
    }
}
OrderedRunnerTest.test2
OrderedRunnerTest.test1
@RunWith(OrderedSpringRunner.class)
@ContextConfiguration("classpath:spring.xml")
public class OrderedSpringRunnerTest {

    @Autowired
    private TestBean testBean;

    @Test
    public void testHello() {
        testBean.hello("hello1");
    }

    @TestOrder
    @Test
    public void testHello2() {
        testBean.hello("hello2");
    }

}
四月 04, 2018 9:08:14 上午 org.springframework.test.context.support.DefaultTestContextBootstrapper getDefaultTestExecutionListenerClassNames
信息: Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
四月 04, 2018 9:08:14 上午 org.springframework.test.context.support.DefaultTestContextBootstrapper getTestExecutionListeners
信息: Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@1d251891, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@48140564, org.springframework.test.context.support.DirtiesContextTestExecutionListener@58ceff1]
四月 04, 2018 9:08:14 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [spring.xml]
四月 04, 2018 9:08:14 上午 org.springframework.context.support.GenericApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.GenericApplicationContext@7225790e: startup date [Wed Apr 04 09:08:14 CST 2018]; root of context hierarchy
hello2
hello1
四月 04, 2018 9:08:15 上午 org.springframework.context.support.GenericApplicationContext doClose
信息: Closing org.springframework.context.support.GenericApplicationContext@7225790e: startup date [Wed Apr 04 09:08:14 CST 2018]; root of context hierarchy

Versions

Version
1.0.1