Skip to content

Commit

Permalink
Replaced some with loggers -- see #199
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Jan 27, 2023
1 parent 154109a commit 519eb88
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void triplify(Properties properties, FacadeXGraphBuilder builder) throws
try {
builder.addType(dataSourceId, containerIdChild, new URI(namespace + entry.getType().toString()));
} catch (URISyntaxException e) {
e.printStackTrace();
logger.error("",e);
}
builder.addContainer(dataSourceId, root, count.incrementAndGet(), containerIdChild);
entry.getFields().forEach((keyField, valueField) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import org.apache.jena.sparql.graph.GraphFactory;
import org.apache.jena.vocabulary.RDF;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Properties;
Expand All @@ -37,7 +39,7 @@
import static org.junit.Assert.assertTrue;

public class BaseTest {

final static Logger logger = LoggerFactory.getLogger(BaseTest.class);
@Test
public void testContent() throws TriplifierHTTPException {

Expand All @@ -61,7 +63,7 @@ public void testContent() throws TriplifierHTTPException {
assertTrue(g1.getDefaultGraph().isIsomorphicWith(expected));

} catch (IOException e1) {
e1.printStackTrace();
logger.error("",e1);
}

}
Expand All @@ -86,7 +88,7 @@ public void testBlankNodeFalse() throws TriplifierHTTPException {
});

} catch (IOException e1) {
e1.printStackTrace();
logger.error("",e1);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@
import org.apache.jena.sparql.graph.GraphFactory;
import org.apache.jena.vocabulary.RDF;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Properties;

import static org.junit.Assert.assertTrue;

public class BibtexTriplifierTest {

final static Logger logger = LoggerFactory.getLogger(BibtexTriplifierTest.class);
@Test
public void test1() {
BibtexTriplifier jt = new BibtexTriplifier();
Expand Down Expand Up @@ -79,7 +81,7 @@ public void test1() {
assertTrue(expectedGraph.isIsomorphicWith(g1.getDefaultGraph()));

} catch (IOException e1) {
e1.printStackTrace();
logger.error("",e1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private byte[] downloadUrl(URL toDownload) {
}

} catch (IOException e) {
e.printStackTrace();
logger.error("",e);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.apache.jena.sparql.graph.GraphFactory;
import org.apache.jena.vocabulary.RDF;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
Expand All @@ -40,6 +42,7 @@
import static org.junit.Assert.assertTrue;

public class BinaryTriplifierTest {
final static Logger logger = LoggerFactory.getLogger(BinaryTriplifierTest.class);

@Test
public void testBase64() throws MalformedURLException {
Expand All @@ -60,7 +63,7 @@ public void testBase64() throws MalformedURLException {
assertTrue(dg.getDefaultGraph().isIsomorphicWith(expectedGraph));
assertTrue(dg.getGraph(NodeFactory.createURI(Triplifier.getRootArgument(p))).isIsomorphicWith(expectedGraph));
} catch (IOException e) {
e.printStackTrace();
logger.error("",e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import org.apache.jena.vocabulary.RDF;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.net.URL;
Expand All @@ -43,7 +45,7 @@
import static org.junit.Assert.assertTrue;

public class TestTriplifier {

final static Logger logger = LoggerFactory.getLogger(TestTriplifier.class);
@Ignore
@Test
public void test1() {
Expand Down Expand Up @@ -102,7 +104,7 @@ public void test1() {
.isIsomorphicWith(expectedGraph));

} catch (IOException e) {
e.printStackTrace();
logger.error("",e);
}
}

Expand Down Expand Up @@ -133,7 +135,7 @@ public void testNoBlankNodes() {
// assertTrue(dg.getGraph(NodeFactory.createURI(doc.toString())).isIsomorphicWith(expectedGraph));

} catch (IOException e) {
e.printStackTrace();
logger.error("",e);
}
}

Expand Down Expand Up @@ -226,7 +228,7 @@ public void test2() {
}

} catch (IOException e) {
e.printStackTrace();
logger.error("",e);
}
}

Expand Down Expand Up @@ -308,7 +310,7 @@ public void test3() {
.isIsomorphicWith(expectedGraph));

} catch (IOException e) {
e.printStackTrace();
logger.error("",e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
Expand All @@ -30,7 +32,7 @@
import java.util.Map;

public class YASGUIServlet extends HttpServlet {

final static Logger logger = LoggerFactory.getLogger(YASGUIServlet.class);
private static final long serialVersionUID = 1L;

private String fxPrefix, endpointPath;
Expand All @@ -57,7 +59,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse res) throws Servle
temp.process(var, pw);
// temp.process(var, sw);
} catch (TemplateException | IOException e1) {
e1.printStackTrace();
logger.error("",e1);
}
pw.close();
// System.out.println(sw.toString());
Expand Down

0 comments on commit 519eb88

Please sign in to comment.