Project

General

Profile

Revision 4ee847ed

ID4ee847eda3ecb5eea03f2cd668bbd434be26a49d
Parent c3b20e66
Child 06405ca0

Added by Andreas Müller almost 11 years ago

some more cache strategy tests

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/reference/ArticleDefaultCacheStrategyTest.java
126 126
		Assert.assertEquals("in My journal ser. 2, 34", defaultStrategy.getNomRefTitleWithoutYearAndAuthor((ReferenceBase)article1));
127 127
	}
128 128
	
129
	@Test 
130
	public void testOldExistingBugs(){
131
		journal1.setTitle("Univ. Calif. Publ. Bot.");
132
		journal1.setAuthorTeam(null);
133
		
134
		Team articleAuthor = Team.NewTitledInstance("Babc. & Stebbins", "Babc. & Stebbins");
135
		article1.setTitle("");
136
		article1.setInJournal(journal1);
137
		article1.setAuthorTeam(articleAuthor);
138
		article1.setVolume("18");
139
		article1.setDatePublished(TimePeriod.NewInstance(1943));
140
		Assert.assertEquals("Babc. & Stebbins in Univ. Calif. Publ. Bot. 18. 1943", defaultStrategy.getTitleCache((ReferenceBase)article1));
141
	}
142
	
129 143
}
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/reference/BookSectionDefaultCacheStrategyTest.java
120 120
		Assert.assertEquals("in Book Author, My book: 55. 1975", bookSection1.getNomenclaturalCitation(detail1));
121 121
	}
122 122
	
123
	@Test
124
	public void testRealExample(){
125
		Team bookTeam = Team.NewTitledInstance("Chaudhary S. A.(ed.)", "Chaudhary S. A.(ed.)");
126
		IBook book = ReferenceFactory.newBook();
127
		book.setTitle("Flora of the Kingdom of Saudi Arabia");
128
		book.setAuthorTeam(bookTeam);
129
		book.setVolume("2(3)");
130
		book.setPlacePublished("Riyadh");
131
		book.setPublisher("National Herbarium");
132
		book.setDatePublished(TimePeriod.NewInstance(2000));
133
		
134
		Team sectionTeam = Team.NewTitledInstance("Chaudhary S. A.", "Chaudhary S. A.");
135
		IBookSection bookSection = ReferenceFactory.newBookSection();
136
		bookSection.setTitle("73. Hedypnois - 87. Crepis");
137
		bookSection.setInBook(book);
138
		bookSection.setAuthorTeam(sectionTeam);
139
		bookSection.setPages("222-251");
140
		System.out.println(bookSection.getTitleCache());
141
		Assert.assertEquals("Chaudhary S. A. - 73. Hedypnois - 87. Crepis in Chaudhary S. A.(ed.), Flora of the Kingdom of Saudi Arabia 2(3). 2000", bookSection.getTitleCache());
142
		
143
	}
144
	
123 145
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)