package org.grobid.core;

import org.junit.Test;

import static junit.framework.Assert.assertFalse;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

/**
 * Created by lfoppiano on 19/08/16.
 */
public class GrobidModelsTest {

    @Test
    public void testGrobidModelsEnum_StandardModel_affiliation() throws Exception {

        GrobidModel model = GrobidModels.AFFIILIATON_ADDRESS;

        assertThat(model.getFolderName(), is("affiliation-address"));
        assertThat(model.getModelName(), is("affiliation-address"));
        assertThat(model.getTemplateName(), is("affiliation-address.template"));
        assertThat(model.getModelPath(), is("/Users/lfoppiano/development/inria/grobid/grobid-core/models/affiliation-address/model.wapiti"));
    }

    @Test
    public void testGrobidModelsEnum_StandardModel_name() throws Exception {

        GrobidModel model = GrobidModels.HEADER;

        assertThat(model.getFolderName(), is("header"));
        assertThat(model.getModelName(), is("header"));
        assertThat(model.getTemplateName(), is("header.template"));
        assertThat(model.getModelPath(), is("/Users/lfoppiano/development/inria/grobid/grobid-core/models/header/model.wapiti"));
    }

    @Test
    public void testGrobidModelsEnum_CustomModel() throws Exception {
        GrobidModel model = GrobidModels.modelFor("dictionaries-senses");

        assertThat(model.getFolderName(), is("dictionaries-senses"));
        assertThat(model.getModelName(), is("dictionaries-senses"));
        assertThat(model.getTemplateName(), is("dictionaries-senses.template"));
        assertThat(model.getModelPath(), is("/Users/lfoppiano/development/inria/grobid/grobid-core/models/dictionaries-senses/model.wapiti"));

        GrobidModel model2 = GrobidModels.modelFor("dictionaries-lemma");
        assertFalse(model2.equals(model));

        GrobidModel model3 = GrobidModels.modelFor("dictionaries-senses");
        assertTrue(model3.equals(model));
    }


}
@@ -93,16 +93,66 @@
 tFalse;%0A
+import static org.hamcrest.CoreMatchers.endsWith;%0A
 import s
@@ -187,16 +187,16 @@
 ers.is;%0A
-
 import s
@@ -775,46 +775,18 @@
 (), 
-is(%22/Users/lfoppiano/development/inria
+endsWith(%22
 /gro
@@ -1216,46 +1216,18 @@
 (), 
-is(%22/Users/lfoppiano/development/inria
+endsWith(%22
 /gro
@@ -1700,46 +1700,18 @@
 (), 
-is(%22/Users/lfoppiano/development/inria
+endsWith(%22
 /gro

Make the tests working with Travis. Removed specific path for my machine.