Skip to content
Snippets Groups Projects
Commit 69dcce3a authored by srosse's avatar srosse
Browse files

no-jira: reduce errors log in unit tests

parent 06e795bd
No related branches found
No related tags found
No related merge requests found
......@@ -59,27 +59,26 @@ public class VelocityTemplatesPreWarm implements PreWarm {
final File root = new File(WebappHelper.getContextRoot(), "WEB-INF/classes");
final Path fPath = root.toPath();
try {
Files.walkFileTree(fPath, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
try {
String path = fPath.relativize(file).toString();
if(path.endsWith(".html") && path.contains("/_content/")) {
StringOutput writer = new StringOutput();
VelocityHelper.getInstance().mergeContent(path, context, writer, null);
numOfTemplates.incrementAndGet();
if(Files.exists(fPath)) {
Files.walkFileTree(fPath, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
try {
String path = fPath.relativize(file).toString();
if(path.endsWith(".html") && path.contains("/_content/")) {
StringOutput writer = new StringOutput();
VelocityHelper.getInstance().mergeContent(path, context, writer, null);
numOfTemplates.incrementAndGet();
}
} catch (ResourceNotFoundException e) {
log.error("", e);
} catch (ParseErrorException e) {
log.error("", e);
}
} catch (ResourceNotFoundException e) {
log.error("", e);
} catch (ParseErrorException e) {
log.error("", e);
return FileVisitResult.CONTINUE;
}
return FileVisitResult.CONTINUE;
}
});
});
}
} catch (IOException e) {
log.error("", e);
}
......
......@@ -27,7 +27,6 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;
import java.util.Collection;
import java.util.UUID;
......@@ -114,10 +113,9 @@ public class OnyxToQtiWorksAssessementItemsTest {
DefaultHandler2 myHandler = new Onyx38ToQtiWorksHandler(xtw);
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", myHandler);
saxParser.parse(in, myHandler);
Files.copy(outputFile.toPath(), new File("/HotCoffee/Onyx", xmlFile.getName()).toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch(Exception e1) {
log.error("", e1);
throw e1;
}
QtiXmlReader qtiXmlReader = new QtiXmlReader(new JqtiExtensionManager());
......
......@@ -27,7 +27,6 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;
import java.util.Collection;
import java.util.UUID;
......@@ -103,10 +102,9 @@ public class OnyxToQtiWorksAssessementTestsTest {
DefaultHandler2 myHandler = new Onyx38ToQtiWorksHandler(xtw);
saxParser.setProperty("http://xml.org/sax/properties/lexical-handler", myHandler);
saxParser.parse(in, myHandler);
Files.copy(outputFile.toPath(), new File("/HotCoffee/Onyx", xmlFile.getName()).toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch(Exception e1) {
log.error("", e1);
throw e1;
}
QtiXmlReader qtiXmlReader = new QtiXmlReader(new JqtiExtensionManager());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment