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.addURL( ConfigHelper.findAsResource( resourceName ) ); fail(); } catch ( InvalidMappingException inv ) { assertEquals( inv.getType(), "URL" ); assertTrue( inv.getPath().endsWith( "InvalidMapping.hbm.xml" ) ); 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.addURL( ConfigHelper.findAsResource( resourceName ) );
3
			fail();
3
			fail();
4
		}
4
		}
5
		catch ( InvalidMappingException inv ) {
5
		catch ( InvalidMappingException inv ) {
6
			assertEquals( inv.getType(), "file" );
6
			assertEquals( inv.getType(), "
7
			assertNotNull( inv.getPath() );
7
URL" );
8
			assertTrue( inv.getPath().endsWith( ".hbm.xml" ) );
8
			assertTrue( inv.getPath().endsWith( "InvalidMapping.hbm.xml" ) );
9
			assertTrue( !( inv.getCause() instanceof MappingNotFoundException ) );
9
			assertTrue( !( inv.getCause() instanceof MappingNotFoundException ) );
10
		}
10
		}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in the same method
Number of node comparisons1