public void testSaveOrUpdateCopyAny() throws Exception { Session s = openSession(); Bar bar = new Bar(); One one = new One(); bar.setObject(one); s.save(bar); GlarchProxy g = bar.getComponent().getGlarch(); bar.getComponent().setGlarch(null); s.delete(g); s.flush(); assertTrue( s.contains(one) ); s.connection().commit(); s.close(); s = openSession(); Bar bar2 = (Bar) s.saveOrUpdateCopy(bar); s.flush(); s.delete(bar2); s.flush(); s.connection().commit(); s.close();
public void testEmptyCollection() throws Exception { Session s = openSession(); Serializable id = s.save( new Baz() ); s.flush(); s.connection().commit(); s.close(); s = openSession(); Baz baz = (Baz) s.load(Baz.class, id); Set foos = baz.getFooSet(); assertTrue( foos.size()==0 ); Foo foo = new Foo(); foos.add(foo); s.save(foo); s.flush(); s.delete(foo); s.delete(baz); s.flush(); s.connection().commit(); s.close();
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/FooBarTest.java File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/legacy/FooBarTest.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void testSaveOrUpdateCopyAny() throws Exception {
1
public void testEmptyCollection() throws Exception {
2
		Session s = openSession();
2
		Session s = openSession();
3
		Bar bar = new Bar();
3
		Serializable id = s.save( new Baz() );
4
		One one = new One();
4
		
5
		bar.setObject(one);
6
		s.save(bar);
7
		GlarchProxy g = bar.getComponent().getGlarch();
8
		bar.getComponent().setGlarch(null);
9
		s.delete(g);
10
		s.flush
5
s.flush();
6
		s.connection().commit();
7
		s.close();
8
		s = openSession();
9
		Baz baz = (Baz) s.load(Baz.class, id);
11
();
10
		Set foos = baz.getFooSet();
12
		assertTrue( s.contains(one) );
11
		assertTrue( 
13
		s.connection().commit();
14
		s.close();
15
		s = openSession();
16
		Bar bar2 = (Bar) s.saveOrUpdateCopy(bar
12
foos.size()==0 );
13
		Foo foo = new Foo();
14
		foos.add(foo);
17
);
15
		s.save(foo);
18
		s.flush();
16
		s.flush();
19
		s.delete(bar2
17
		s.delete(foo);
20
);
18
		s.delete(baz);
21
		s.flush();
19
		s.flush();
22
		s.connection().commit();
20
		s.connection().commit();
23
		s.close();
21
		s.close();
24
	
22
	
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.0
Clones location
Number of node comparisons0