/*
 *  Copyright 2013 Deutsche Nationalbibliothek
 *
 *  Licensed under the Apache License, Version 2.0 the "License";
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package org.culturegraph.mf.morph.functions;

import static org.junit.Assert.assertEquals;

import org.culturegraph.mf.morph.functions.NormalizeUTF8;
import org.junit.Test;


/**
 * @author Christoph Böhme <c.boehme@dnb.de>
 *
 */
public final class NormalizeUTF8Test {

	private static final String INPUT_STR = "Bauer, Sigmund: Über den Einfluß der Ackergeräthe auf den Reinertrag.";
	private static final String OUTPUT_STR = "Bauer, Sigmund: Über den Einfluß der Ackergeräthe auf den Reinertrag.";
	
	@Test
	public void testProcess() {
		final NormalizeUTF8 normalize = new NormalizeUTF8();
		assertEquals("Normalization incorrect", OUTPUT_STR, normalize.process(INPUT_STR));
	}
}

@@ -656,19 +656,17 @@
 nctions;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -702,19 +702,17 @@
 tEquals;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -761,17 +761,16 @@
 izeUTF8;
-%0D
 %0Aimport 
@@ -788,18 +788,14 @@
 est;
-%0D%0A%0D%0A%0D
+%0A%0A
 %0A/**
-%0D
 %0A * 
@@ -839,18 +839,15 @@
 .de%3E
-%0D
 %0A *
-%0D
 %0A */
-%0D
 %0Apub
@@ -885,11 +885,88 @@
 st %7B
-%0D%0A%0D
+%0A%0A%09// The umlauts in this string are composed of two characters (u and %22, e.g.):
 %0A%09pr
@@ -995,32 +995,36 @@
 ing INPUT_STR = 
+%0A%09%09%09
 %22Bauer, Sigmund:
@@ -1081,17 +1081,76 @@
 rtrag.%22;
-%0D
+%0A%09%0A%09// The umlauts in this string are individual characters:
 %0A%09privat
@@ -1184,16 +1184,20 @@
 T_STR = 
+%0A%09%09%09
 %22Bauer, 
@@ -1264,20 +1264,17 @@
 g.%22;
-%0D
 %0A%09
-%0D
 %0A%09@Test
-%0D
 %0A%09pu
@@ -1298,17 +1298,16 @@
 cess() %7B
-%0D
 %0A%09%09final
@@ -1353,17 +1353,16 @@
 eUTF8();
-%0D
 %0A%09%09asser
@@ -1442,13 +1442,10 @@
 R));
-%0D
 %0A%09%7D
-%0D
 %0A%7D
-%0D
 %0A

Add comments to make the test better comprehensible.