File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/PermissionsTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/ModifiedSelectorTest.java | |||
Method name: void testOther()
|
Method name: void testValidateWrongAlgorithm()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | String ls = System.getProperty("line.separator");↵ | 1 | String ↵ | |
2 | perms.setSecurityManager();↵ | 2 | name = "this-is-not-a-valid-algorithm-name";↵ | |
3 | try {↵ | |||
4 | ModifiedSelector.AlgorithmName algoName↵ | |||
3 | try {↵ | 5 | ↵ | |
4 | String s = System.setProperty("line.separator",ls);↵ | 6 | ↵ | |
5 | fail("Could perform an action that should have been forbidden↵ | 7 | = new ModifiedSelector.AlgorithmName();↵ | |
8 | algoName.setValue(name);↵ | |||
6 | .");↵ | 9 | fail("CacheSelector.AlgorithmName accepted invalid value.");↵ | |
7 | } catch (SecurityException e){↵ | 10 | } catch (BuildException be) {↵ | |
8 | // Was expected, test passes↵ | 11 | ↵ | |
9 | } finally {↵ | |||
10 | perms.restoreSecurityMan↵ | 12 | assertEquals(name + " is not a legal value for this attribute",↵ | |
11 | ager();↵ | 13 | be.getMessage());↵ | |
12 | } | 14 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 1 |