Project

General

Profile

« Previous | Next » 

Revision 892efc69

Added by Andreas Kohlbecker almost 14 years ago

merging /branches/cdmlib/SPRINT-Chichorieae1/ to trunk

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/match/DefaultMatchStrategyTest.java
98 98
	public void setUp() throws Exception {
99 99
		refFactory = ReferenceFactory.newInstance();
100 100
		team1 = Team.NewInstance();
101
		team1.setTitleCache("Team1");
101
		team1.setTitleCache("Team1",true);
102 102
		team2 = Team.NewInstance();
103
		team2.setTitleCache("Team2");
103
		team2.setTitleCache("Team2",true);
104 104
		printSeries1 = refFactory.newPrintSeries("Series1");
105 105
		printSeries1.setTitle("print series");
106 106
		printSeries2 = refFactory.newPrintSeries("Series2");
......
202 202
		
203 203
		IBook bookClone = (IBook) ((ReferenceBase) book1).clone();
204 204
		Assert.assertTrue("Cloned book should match", matchStrategy.invoke(book1, bookClone));
205
		book1.setTitleCache("cache1");
205
		book1.setTitleCache("cache1",true);
206 206
		Assert.assertFalse("Cached book should not match", matchStrategy.invoke(book1, bookClone));
207 207
		
208
		bookClone.setTitleCache("cache1");
208
		bookClone.setTitleCache("cache1",true);
209 209
		Assert.assertTrue("Cached book with same cache should match", matchStrategy.invoke(book1, bookClone));
210 210
			
211
		bookClone.setTitleCache("cache2");
211
		bookClone.setTitleCache("cache2",true);
212 212
		Assert.assertFalse("Cached book with differings caches should not match", matchStrategy.invoke(book1, bookClone));
213
		bookClone.setTitleCache("cache1"); //restore
213
		bookClone.setTitleCache("cache1",true); //restore
214 214
		
215 215
		bookClone.setEdition(null);
216 216
		Assert.assertTrue("Cached book with a defined and a null edition should match", matchStrategy.invoke(book1, bookClone));
......
417 417
		
418 418
		
419 419
		Person person1 = Person.NewTitledInstance("person1");
420
		person1.setProtectedTitleCache(true);
420 421
		Person person2 = Person.NewTitledInstance("person2");
422
		person2.setProtectedTitleCache(true);
421 423
		Person person3 = Person.NewTitledInstance("person3");
424
		person3.setProtectedTitleCache(true);
422 425

  
423 426
		team1.addTeamMember(person1);
424 427
		team2.addTeamMember(person1);
......
432 435
		person3.setPrefix("pre3");
433 436
		team2.addTeamMember(person3);
434 437
		Assert.assertFalse("Teams with differing team members should not match", matchStrategy.invoke(team1, team2));
435
		person3.setTitleCache(person2.getTitleCache());
438
		person3.setTitleCache(person2.getTitleCache(),true);
436 439
		person2.setPrefix("pre3");
437 440
		Assert.assertTrue("Teams with matching members in right order should match", matchStrategy.invoke(team1, team2));
438 441
		team2.removeTeamMember(person1);

Also available in: Unified diff