package de.unistuttgart.ims.uimautil;

import org.apache.uima.UIMAException;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
import org.apache.uima.fit.factory.AnnotationFactory;
import org.apache.uima.fit.factory.JCasFactory;
import org.apache.uima.fit.pipeline.SimplePipeline;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
import org.junit.Before;
import org.junit.Test;

import de.unistuttgart.ims.uimautil.api.TestType;

public class TestDocumentCSVConsumer {
	JCas jcas;

	@Before
	public void setUp() throws UIMAException {
		jcas = JCasFactory.createJCas();
		jcas.setDocumentText("Lorem ipsum dolor sit amet");
		TestType tt = AnnotationFactory.createAnnotation(jcas, 0, 5, TestType.class);
		tt.setMyFeature("Hello");
		tt.setMyIntFeature(5);
	}

	@Test
	public void testDocumentCSVConsumer() throws AnalysisEngineProcessException, ResourceInitializationException {
		SimplePipeline.runPipeline(jcas,
				AnalysisEngineFactory.createEngineDescription(DocumentCSVConsumer.class,
						DocumentCSVConsumer.PARAM_ANNOTATION_TYPE, TestType.class,
						DocumentCSVConsumer.PARAM_LAST_FEATURE, "MyFeature"));
	}
}

@@ -1036,21 +1036,17 @@
 ne(jcas,
-%0A%09%09%09%09
+ 
 Analysis
@@ -1106,34 +1106,32 @@
 umer.class,%0A%09%09%09%09
-%09%09
 DocumentCSVConsu
@@ -1176,15 +1176,9 @@
 ass,
-%0A%09%09%09%09%09%09
+ 
 Docu
@@ -1212,17 +1212,21 @@
 FEATURE,
- 
+%0A%09%09%09%09
 %22MyFeatu
@@ -1228,16 +1228,69 @@
 Feature%22
+, DocumentCSVConsumer.PARAM_TARGET_LOCATION, %22target%22
 ));%0A%09%7D%0A%7D

fix for test