|
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. |
|
25 | 25 | /** |
26 | 26 | * @author Juergen Hoeller |
27 | 27 | */ |
| 28 | +@SuppressWarnings("deprecation") |
28 | 29 | public class CronSequenceGeneratorTests { |
29 | 30 |
|
30 | 31 | @Test |
31 | | - public void testAt50Seconds() { |
| 32 | + public void at50Seconds() { |
32 | 33 | assertEquals(new Date(2012, 6, 2, 1, 0), |
33 | 34 | new CronSequenceGenerator("*/15 * 1-4 * * *").next(new Date(2012, 6, 1, 9, 53, 50))); |
34 | 35 | } |
35 | 36 |
|
36 | 37 | @Test |
37 | | - public void testAt0Seconds() { |
| 38 | + public void at0Seconds() { |
38 | 39 | assertEquals(new Date(2012, 6, 2, 1, 0), |
39 | 40 | new CronSequenceGenerator("*/15 * 1-4 * * *").next(new Date(2012, 6, 1, 9, 53))); |
40 | 41 | } |
41 | 42 |
|
42 | 43 | @Test |
43 | | - public void testAt0Minutes() { |
| 44 | + public void at0Minutes() { |
44 | 45 | assertEquals(new Date(2012, 6, 2, 1, 0), |
45 | 46 | new CronSequenceGenerator("0 */2 1-4 * * *").next(new Date(2012, 6, 1, 9, 0))); |
46 | 47 | } |
47 | 48 |
|
48 | 49 | @Test(expected = IllegalArgumentException.class) |
49 | | - public void testWith0Increment() { |
| 50 | + public void with0Increment() { |
50 | 51 | new CronSequenceGenerator("*/0 * * * * *").next(new Date(2012, 6, 1, 9, 0)); |
51 | 52 | } |
52 | 53 |
|
53 | 54 | @Test(expected = IllegalArgumentException.class) |
54 | | - public void testWithNegativeIncrement() { |
| 55 | + public void withNegativeIncrement() { |
55 | 56 | new CronSequenceGenerator("*/-1 * * * * *").next(new Date(2012, 6, 1, 9, 0)); |
56 | 57 | } |
57 | 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 | + |
58 | 79 | } |
0 commit comments