try {
cfg.addCacheableFile( file );
fail();
}
catch ( InvalidMappingException inv ) {
assertEquals( inv.getType(), "file" );
assertNotNull( inv.getPath() );
assertTrue( inv.getPath().endsWith( ".hbm.xml" ) );
assertTrue( !( inv.getCause() instanceof MappingNotFoundException ) );
}
try {
cfg.addResource( resourceName, getClass().getClassLoader() );
fail();
}
catch ( InvalidMappingException inv ) {
assertEquals( inv.getType(), "resource" );
assertEquals( inv.getPath(), resourceName );
assertTrue( !( inv.getCause() instanceof MappingNotFoundException ) );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/mappingexception/MappingExceptionTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/mappingexception/MappingExceptionTest.java
|
Method name: void testInvalidMapping()
|
|
Method name: void testInvalidMapping()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | try {↵ | | 1 | try {↵
|
2 | cfg.addCacheableFile( file );↵ | | 2 | cfg.addResource( resourceName, getClass().getClassLoader() );↵
|
3 | fail();↵ | | 3 | fail();↵
|
4 | }↵ | | 4 | }↵
|
5 | catch ( InvalidMappingException inv ) {↵ | | 5 | catch ( InvalidMappingException inv ) {↵
|
6 | assertEquals( inv.getType(), "file" );↵ | | 6 | assertEquals( inv.getType(), "resource" );↵
|
7 | assertNotNull( inv.getPath() );↵ | | 7 | assertEquals( inv.getPath()↵
|
8 | assertTrue( inv.getPath().endsWith( ".hbm.xml" ) );↵ | | 8 | , resourceName );↵
|
9 | assertTrue( !( inv.getCause() instanceof MappingNotFoundException ) );↵ | | 9 | assertTrue( !( inv.getCause() instanceof MappingNotFoundException ) );↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 the same method |
Number of node comparisons | 1 |