Skip to content

Commit

Permalink
removed unecessary test
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchdennett committed Feb 7, 2021
1 parent ffa8f4e commit f02e5a4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
14 changes: 14 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@
<version>1.5.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.0</version>
</plugin>
</plugins>
</build>


</project>
2 changes: 1 addition & 1 deletion src/main/java/com/severell/plugins/jte/ViewJteDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public void render(String template, Map<String,Object> object, Writer writer) th
@Override
public void render(String template, Map<String,Object> object, String baseDir, Writer writer) throws ViewException {
TemplateOutput output = new WriterOutput(writer);
templateEngine.render(template, object, output);
templateEngine.render(baseDir + template, object, output);
}
}
15 changes: 2 additions & 13 deletions src/test/java/com/severell/plugins/jte/ViewJteDriverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void tearDown() {

@Test
public void testJteDriver() throws ViewException {
ViewJteDriver driver = new ViewJteDriver(Path.of("src", "test", "resources", "templates"));
ViewJteDriver driver = new ViewJteDriver(Path.of("src", "test", "resources"));
StringWriter writer = new StringWriter();
HashMap<String, Object> map = new HashMap<>();

Expand All @@ -40,7 +40,7 @@ public void testJteDriver() throws ViewException {

@Test
public void testJteDriverPrintWriter() throws ViewException {
ViewJteDriver driver = new ViewJteDriver(Path.of("src", "test", "resources", "templates"));
ViewJteDriver driver = new ViewJteDriver(Path.of("src", "test", "resources"));
StringWriter st = new StringWriter();
PrintWriter writer = new PrintWriter(st);
HashMap<String, Object> map = new HashMap<>();
Expand All @@ -50,17 +50,6 @@ public void testJteDriverPrintWriter() throws ViewException {
assertEquals("<html><body>Hello</body></html>", st.toString());
}

@Test
public void testJteDriverBufferedWriter() throws ViewException {
ViewJteDriver driver = new ViewJteDriver(Path.of("src", "test", "resources", "templates"));
Writer writer = new BufferedWriter(new StringWriter());
HashMap<String, Object> map = new HashMap<>();

assertThrows(ViewException.class, () -> {
driver.render("test.jte",map , writer);
});
}

@Test
public void testJteDriverThrowsIOError() throws IOException {
ViewJteDriver driver = new ViewJteDriver();
Expand Down

0 comments on commit f02e5a4

Please sign in to comment.