Project

General

Profile

1
package eu.dnetlib;
2

    
3
import java.io.InputStream;
4

    
5
import org.apache.commons.io.IOUtils;
6
import org.junit.Before;
7
import org.junit.Test;
8

    
9
import eu.dnetlib.miscutils.functional.xml.ApplyXslt;
10

    
11
public class PatchValidatedRecordTest {
12

    
13
	String patchXslt = null;
14
	String validatorRecord = null;
15

    
16
	@Before
17
	public void setUp() throws Exception {
18
		patchXslt = IOUtils.toString(load("/eu/dnetlib/msro/workflows/repo/validation/patchValidationHeader.xsl"));
19
		validatorRecord = IOUtils.toString(load("validator-record.xml"));
20
	}
21

    
22
	@Test
23
	public void test() {
24
		ApplyXslt applyXslt = new ApplyXslt(patchXslt);
25
		String output = applyXslt.evaluate(validatorRecord);
26
		System.out.println(output);
27
	}
28

    
29
	private InputStream load(final String fileName) {
30
		return getClass().getResourceAsStream(fileName);
31
	}
32

    
33
}
    (1-1/1)