1 package org.kuali.ole.ingest;
2
3 import junit.framework.Assert;
4 import org.junit.Test;
5
6 import java.util.ArrayList;
7 import java.util.List;
8
9
10
11
12
13
14
15
16 public class ISBNUtil_UT {
17
18 @Test
19 public void testNormalization() throws Exception {
20 ISBNUtil isbnUtil = new ISBNUtil();
21 List<String> isbnList = new ArrayList<String>();
22 isbnList.add("0304935085");
23 isbnList.add("0304935085847");
24 isbnList.add("0714839337 (v. 3)");
25 isbnList.add("0879514663 (set)");
26 isbnList.add("087951468X (v. 2) :");
27 isbnList.add("087951468X");
28 isbnList.add("8086098044 :");
29 isbnList.add("9781433113178 (hbk. : alk. paper)");
30 isbnList.add("1433113171 (hbk. : alk. paper)");
31 isbnList.add("978143311317X");
32 for (String isbn : isbnList) {
33 String normalizedIsbn = isbnUtil.normalizeISBN(isbn);
34 System.out.println(normalizedIsbn);
35 Assert.assertEquals(13, normalizedIsbn.length());
36 }
37
38 }
39 }