Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
ctevse committed Oct 20, 2023
1 parent fc52c61 commit 26e9723
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
20 changes: 16 additions & 4 deletions reconciler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<powermock.version>1.6.6</powermock.version>
</properties>
Expand Down Expand Up @@ -52,6 +50,15 @@
<!-- Added to enforce the usage of https -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<!--Copy Dependencies into reconciler_lib Folder for Docker User-->
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -66,7 +73,7 @@
</configuration>
</execution>
</executions>
</plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>8</source><target>8</target></configuration></plugin>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -309,13 +316,18 @@
<scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,47 @@
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";
public static final String STANFORD_CORE_NLP = "STANFORD_CORE_NLP";
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);
Expand Down

0 comments on commit 26e9723

Please sign in to comment.