@SuiteClasses(value = { MonthlyTest.class })@RunWith(VertxUnitRunner.class)public class TestSuite {}
public class MonthlyTest { private static StrategyImpl icos;
@ClassRule public static RunTestOnContext rule = new RunTestOnContext();
@BeforeClass public void before(TestContext tc) { icos = new StrategyImpl(); }
@After public void after(TestContext tc) { }
@Test public void MonthlyNonLeapYear(TestContext tc) { LocalDate ld = LocalDate.of(2017, Month.JANUARY, 31); LocalDate expected = LocalDate.of(2017, Month.FEBRUARY, 28); tc.assertEquals(icos.calculateNextPaymentDate(ld, PaymentFrequency.MONTHLY), expected); }.... (continues on)
Tests in error: initializationError(MonthlyTest): Method before() should be static initializationError(MonthlyTest): Method before should have no parameters initializationError(MonthlyTest): Method after should have no parameters initializationError(MonthlyTest): Method MonthlyFirstOfMonth1 should have no parameters initializationError(MonthlyTest): Method MonthlyFirstOfMonth2 should have no parameters initializationError(MonthlyTest): Method MonthlyFirstOfMonth3 should have no parameters initializationError(MonthlyTest): Method MonthlyLeapYear should have no parameters initializationError(MonthlyTest): Method MonthlyNonLeapYear should have no parameters initializationError(MonthlyTest): Method MonthlyMidMonth1 should have no parameters initializationError(MonthlyTest): Method MonthlyMidMonth2 should have no parameters initializationError(MonthlyTest): Method MonthlyMidMonth3 should have no parameters
@Category({ CriticalTest.class })@RunWith(VertxUnitRunner.class)public class MonthlyTest { private StrategyImpl icos; private Vertx vertx;
@Before public void before(TestContext tc) { vertx = Vertx.vertx(); icos = new StrategyImpl().setVertx(vertx);
}
@After public void after(TestContext tc) {
vertx.close(tc.asyncAssertSuccess()); }
@Test public void monthlyNonLeapYear(TestContext tc) {
LocalDate ld = LocalDate.of(2017, Month.JANUARY, 31); LocalDate expected = LocalDate.of(2017, Month.FEBRUARY, 28); tc.assertEquals(icos.calculateNextPaymentDate(ld, PaymentFrequency.MONTHLY), expected); }
... (continues on)
<!-- Change groups to pick suites. --><plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven-surefire-plugin.version}</version> <dependencies> <dependency> <groupId>org.apache.maven.surefire</groupId> <artifactId>common-junit48</artifactId> <version>${maven-surefire-plugin.version}</version> </dependency> </dependencies> <configuration> <parallel>classes</parallel> <useUnlimitedThreads>true</useUnlimitedThreads> <trimStackTrace>false</trimStackTrace> <groups>com.xyz.test.CriticalTest,com.xyz.test.NonCriticalTest</groups> </configuration></plugin>