|
1 | 1 | /* |
2 | | - * Copyright 2002-2015 the original author or authors. |
| 2 | + * Copyright 2002-2016 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
29 | 29 | public class CronSequenceGeneratorTests { |
30 | 30 |
|
31 | 31 | @Test |
32 | | - public void testAt50Seconds() { |
| 32 | + public void at50Seconds() { |
33 | 33 | assertEquals(new Date(2012, 6, 2, 1, 0), |
34 | 34 | new CronSequenceGenerator("*/15 * 1-4 * * *").next(new Date(2012, 6, 1, 9, 53, 50))); |
35 | 35 | } |
36 | 36 |
|
37 | 37 | @Test |
38 | | - public void testAt0Seconds() { |
| 38 | + public void at0Seconds() { |
39 | 39 | assertEquals(new Date(2012, 6, 2, 1, 0), |
40 | 40 | new CronSequenceGenerator("*/15 * 1-4 * * *").next(new Date(2012, 6, 1, 9, 53))); |
41 | 41 | } |
42 | 42 |
|
43 | 43 | @Test |
44 | | - public void testAt0Minutes() { |
| 44 | + public void at0Minutes() { |
45 | 45 | assertEquals(new Date(2012, 6, 2, 1, 0), |
46 | 46 | new CronSequenceGenerator("0 */2 1-4 * * *").next(new Date(2012, 6, 1, 9, 0))); |
47 | 47 | } |
48 | 48 |
|
49 | 49 | @Test(expected = IllegalArgumentException.class) |
50 | | - public void testWith0Increment() { |
| 50 | + public void with0Increment() { |
51 | 51 | new CronSequenceGenerator("*/0 * * * * *").next(new Date(2012, 6, 1, 9, 0)); |
52 | 52 | } |
53 | 53 |
|
54 | 54 | @Test(expected = IllegalArgumentException.class) |
55 | | - public void testWithNegativeIncrement() { |
| 55 | + public void withNegativeIncrement() { |
56 | 56 | new CronSequenceGenerator("*/-1 * * * * *").next(new Date(2012, 6, 1, 9, 0)); |
57 | 57 | } |
58 | 58 |
|
| 59 | + @Test(expected = IllegalArgumentException.class) |
| 60 | + public void withInvertedMinuteRange() { |
| 61 | + new CronSequenceGenerator("* 6-5 * * * *").next(new Date(2012, 6, 1, 9, 0)); |
| 62 | + } |
| 63 | + |
| 64 | + @Test(expected = IllegalArgumentException.class) |
| 65 | + public void withInvertedHourRange() { |
| 66 | + new CronSequenceGenerator("* * 6-5 * * *").next(new Date(2012, 6, 1, 9, 0)); |
| 67 | + } |
| 68 | + |
| 69 | + @Test |
| 70 | + public void withSameMinuteRange() { |
| 71 | + new CronSequenceGenerator("* 6-6 * * * *").next(new Date(2012, 6, 1, 9, 0)); |
| 72 | + } |
| 73 | + |
| 74 | + @Test |
| 75 | + public void withSameHourRange() { |
| 76 | + new CronSequenceGenerator("* * 6-6 * * *").next(new Date(2012, 6, 1, 9, 0)); |
| 77 | + } |
| 78 | + |
59 | 79 | } |
0 commit comments