[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[jetty-dev] New @RunWith(AdvancedRunner.class) - @Slow
|
Based on feedback, we've rolled in some new support in the jetty-test-helper for classifying test methods.
Example:
@RunWith(AdvancedRunner.class)
public class AdvancedExampleTest
{
@Test
@Slow
public void testSomethingSlow()
{
for (int i = 0; i < 1000; i++)
{
Assert.assertEquals("m" + i,String.format("m%d",i));
TimeUnit.MINUTES.sleep(2);
}
}
@Test
public void testNormal()
{
// should have run
Assert.assertEquals("123",Integer.toString(123));
}
}
This allows us to tag methods as being @Slow.
The configuration is currently turned on and defaults to running @Test and @Slow on a normal build (mvn clean install)
However, you can disable this and run in a fast mode.
$ mvn clean install -Dtest.slow=false
or
$ mvn clean install -Dtest.fast
I've gone ahead and enabled this in the jetty-9 branch, and converted the jetty-util module over as an example case.
Timing examples:
[jetty-util]$ mvn clean install
[jetty-util]$ mvn clean install -Dtest.fast
--
Developer advice, services and support
from the Jetty & CometD experts.