/*
 * Copyright 2017 apifocal LLC.
 *
 * 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.apifocal.paeon.nlp.service;

import org.apache.uima.analysis_engine.AnalysisEngine;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.junit.Assert.assertNotNull;


public class CtakesProcessorTest {
    private static final Logger LOG = LoggerFactory.getLogger(CtakesProcessorTest.class);

    @Test
    public void testProcess() throws Exception {
    }

    @Test
    public void testInitialization() throws Exception {
        NLPProcessor nlp = new CtakesProcessor();
        AnalysisEngine pipeline = nlp.getPipeline();

        assertNotNull("Failed to create a valid cTAKES pipeline", pipeline);
    }
}

@@ -708,37 +708,9 @@
 nit.
-Assert;%0Aimport org.junit.Test
+*
 ;%0Aim
@@ -942,67 +942,1131 @@
 s);%0A
-%0A    @Test%0A    public void testProcess() throws Exception %7B
+    private NLPProcessor nlp;%0A%0A    private static final String noteNutritios = %22Dr. Nutritious%5Cn%22 +%0A            %22 %5Cn%22 +%0A            %22Medical Nutrition Therapy for Hyperlipidemia%5Cn%22 +%0A            %22Referral from: Julie Tester, RD, LD, CNSD%5Cn%22 +%0A            %22Phone contact: (555) 555-1212%5Cn%22 +%0A            %22Height: 144 cm Current Weight: 45 kg Date of current weight: 02-29-2001%5Cn%22 +%0A            %22Admit Weight: 53 kg BMI: 18 kg/m2%5Cn%22 +%0A            %22Diet: General%5Cn%22 +%0A            %22Daily Calorie needs (kcals): 1500 calories, assessed as HB + 20%25 for activity.%5Cn%22 +%0A            %22Daily Protein needs: 40 grams, assessed as 1.0 g/kg.%5Cn%22 +%0A            %22Pt has been on a 3-day calorie count and has had an average intake of 1100 calories.%5Cn%22 +%0A            %22She was instructed to drink 2-3 cans of liquid supplement to help promote weight gain.%5Cn%22 +%0A            %22She agrees with the plan and has my number for further assessment. May want a Resting%5Cn%22 +%0A            %22Metabolic Rate as well. She takes an aspirin a day for knee pain.%22;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        this.nlp = new CtakesProcessor();
 %0A   
@@ -2074,20 +2074,21 @@
 %7D%0A%0A    @
-Test
+After
 %0A    pub
@@ -2102,23 +2102,13 @@
 d te
-stInitializatio
+arDow
 n() 
@@ -2138,49 +2138,318 @@
     
-NLPProcessor nlp = new CtakesProcessor();
+this.nlp = null;%0A    %7D%0A%0A    @Test%0A    public void testProcess() throws Exception %7B%0A        String analizedText = nlp.process(noteNutritios);%0A        assertNotNull(%22We should have received something from the NLP processor%22, analizedText);%0A    %7D%0A%0A    @Test%0A    public void testInitialization() throws Exception %7B
 %0A   
@@ -2498,17 +2498,16 @@
 line();%0A
-%0A
         

fix text ctakes integration