From 26e9723020f7f848f6ac260f31669d313f9c8cdc Mon Sep 17 00:00:00 2001 From: Chris Enoch Date: Fri, 20 Oct 2023 17:43:05 +0000 Subject: [PATCH] Fixed failing tests - Updated java to v11 - Removed some mocks that were happening - These mocks are not properly handled and are tainting other tests - Fixed pathing of files - The old paths were windows specific and causing issues --- reconciler/pom.xml | 20 +++++++++++++++---- .../se/nvip/reconciler/ReconcilerFactory.java | 20 ++++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/reconciler/pom.xml b/reconciler/pom.xml index 2036f0a71..b604f9a5b 100644 --- a/reconciler/pom.xml +++ b/reconciler/pom.xml @@ -10,8 +10,6 @@ jar - 1.8 - 1.8 UTF-8 1.6.6 @@ -52,6 +50,15 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 11 + 11 + + maven-dependency-plugin @@ -66,7 +73,7 @@ - org.apache.maven.pluginsmaven-compiler-plugin88 + @@ -309,13 +316,18 @@ test - org.mockito mockito-core test + + org.mockito + mockito-junit-jupiter + test + + org.springframework spring-test diff --git a/reconciler/src/main/java/edu/rit/se/nvip/reconciler/ReconcilerFactory.java b/reconciler/src/main/java/edu/rit/se/nvip/reconciler/ReconcilerFactory.java index c463ff853..a250abbbb 100644 --- a/reconciler/src/main/java/edu/rit/se/nvip/reconciler/ReconcilerFactory.java +++ b/reconciler/src/main/java/edu/rit/se/nvip/reconciler/ReconcilerFactory.java @@ -24,12 +24,15 @@ package edu.rit.se.nvip.reconciler; import edu.rit.se.nvip.reconciler.models.ApacheOpenNLPModel; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; /** * @author axoeec * */ public class ReconcilerFactory { + private static final Logger log = LogManager.getLogger(ReconcilerFactory.class.getSimpleName()); public static final String SIMPLE = "SIMPLE"; public static final String STANFORD_SIMPLE_NLP = "STANFORD_SIMPLE_NLP"; @@ -37,24 +40,31 @@ public class ReconcilerFactory { public static final String APACHE_OPEN_NLP = "APACHE_OPEN_NLP"; public static Reconciler createReconciler(String type, boolean doAttachModel) { + + Reconciler reconciler; switch (type) { case SIMPLE: - return new SimpleReconciler(); + reconciler = new SimpleReconciler(); + break; case STANFORD_SIMPLE_NLP: - return new StanfordSimpleNLPReconciler(); + reconciler = new StanfordSimpleNLPReconciler(); + break; case STANFORD_CORE_NLP: - return new StanfordCoreNLPReconciler(); + reconciler = new StanfordCoreNLPReconciler(); + break; case APACHE_OPEN_NLP: ApacheOpenNLPReconciler out = new ApacheOpenNLPReconciler(); if(doAttachModel) { out.attachModel(new ApacheOpenNLPModel()); } - return out; + reconciler = out; + break; default: - return new SimpleReconciler(); + reconciler = new SimpleReconciler(); } + return reconciler; } public static Reconciler createReconciler(String type) { return createReconciler(type, false);