1 | void testValidateWrongCache() {↵ | | 1 | void testValidateWrongAlgorithm() {↵
|
2 | String name = "this-is-not-a-valid-cache-name";↵ | | 2 | String name = "this-is-not-a-valid-algorithm-name";↵
|
3 | try {↵ | | 3 | try {↵
|
4 | ModifiedSelector.CacheName cacheName↵ | | 4 | ModifiedSelector.AlgorithmName algoName↵
|
5 | = new ModifiedSelector.CacheName();↵ | | 5 | = new ModifiedSelector.AlgorithmName();↵
|
6 | cacheName.setValue(name);↵ | | 6 | algoName.setValue(name);↵
|
7 | fail("CacheSelector.CacheName accepted invalid value.");↵ | | 7 | fail("CacheSelector.AlgorithmName accepted invalid value.");↵
|
8 | } catch (BuildException be) {↵ | | 8 | } catch (BuildException be) {↵
|
9 | assertEquals(name + " is not a legal value for this attribute",↵ | | 9 | assertEquals(name + " is not a legal value for this attribute",↵
|
10 | be.getMessage());↵ | | 10 | be.getMessage());↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
|
|
13 | /** Test right use of cache names. */↵ | | 13 | /** Test right use of comparator names. */↵
|
14 | public void testValidateWrongAlgorithm() {↵ | | 14 | public void testValidateWrongComparator() {↵
|
15 | String name = "this-is-not-a-valid-algorithm-name";↵ | | 15 | String name = "this-is-not-a-valid-comparator-name";↵
|
16 | try {↵ | | 16 | try {↵
|
17 | ModifiedSelector.AlgorithmName algoName↵ | | 17 | ModifiedSelector.ComparatorName compName↵
|
18 | = new ModifiedSelector.AlgorithmName();↵ | | 18 | = new ModifiedSelector.ComparatorName();↵
|
19 | algoName.setValue(name);↵ | | 19 | compName.setValue(name);↵
|
20 | fail("CacheSelector.AlgorithmName accepted invalid value.");↵ | | 20 | fail("ModifiedSelector.ComparatorName accepted invalid value.");↵
|
21 | } catch (BuildException be) {↵ | | 21 | } catch (BuildException be) {↵
|
22 | assertEquals(name + " is not a legal value for this attribute",↵ | | 22 | assertEquals(name + " is not a legal value for this attribute",↵
|
23 | be.getMessage());↵ | | 23 | be.getMessage());↵
|
24 | }↵ | | 24 | }↵
|
25 | | | 25 |
|