Skip to content
Snippets Groups Projects
Commit e1ddf615 authored by Sören Henning's avatar Sören Henning
Browse files

update tests

parent 5db4b622
No related branches found
No related tags found
1 merge request!17Get impletemented stages and Java 8
package kieker.analysis.graph;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import kieker.analysis.graph.export.graphml.GraphMLExporter;
import kieker.analysis.graph.impl.GraphImpl;
import kieker.analysis.util.dot.DotWriter;
public class GraphTester {
......@@ -106,26 +101,27 @@ public class GraphTester {
// dotExporter.export(graph, System.out);
// Could be useful for testing
System.out.println("DotWriter Test");
DotWriter dotWriter = new DotWriter(new PrintWriter(System.out));
try {
dotWriter.start("G");
dotWriter.addGraphAttribute("rotate", "90");
Map<String, String> defaultNodeAttributes = new HashMap<>();
defaultNodeAttributes.put("style", "filled");
dotWriter.addDefaultNodeAttributes(defaultNodeAttributes);
Map<String, String> nodeAttributes = new HashMap<>();
nodeAttributes.put("label", "LABEL Title");
dotWriter.addNode("102", nodeAttributes);
dotWriter.addNode("#id", nodeAttributes);
dotWriter.addEdge("102", "#id", new HashMap<>());
dotWriter.finish();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//
// System.out.println("DotWriter Test");
//
// DotWriter dotWriter = new DotWriter(new PrintWriter(System.out));
// try {
// dotWriter.start("G");
// dotWriter.addGraphAttribute("rotate", "90");
// Map<String, String> defaultNodeAttributes = new HashMap<>();
// defaultNodeAttributes.put("style", "filled");
// dotWriter.addDefaultNodeAttributes(defaultNodeAttributes);
// Map<String, String> nodeAttributes = new HashMap<>();
// nodeAttributes.put("label", "LABEL Title");
// dotWriter.addNode("102", nodeAttributes);
// dotWriter.addNode("#id", nodeAttributes);
// dotWriter.addEdge("102", "#id", new HashMap<>());
// dotWriter.finish();
//
// } catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
}
......
......@@ -27,13 +27,13 @@ public class GraphMLExporter {
graphmlType.getGraphOrData().add(graphType);
try {
JAXBContext context = JAXBContext.newInstance(GraphmlType.class);
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, FORMATTED_OUTPUT);
ObjectFactory objectFactory = new ObjectFactory();
JAXBElement<GraphmlType> rootElement = objectFactory.createGraphml(graphmlType);
JAXBContext context = JAXBContext.newInstance(rootElement.getValue().getClass());
Marshaller marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, FORMATTED_OUTPUT);
marshaller.marshal(rootElement, outputStream);
} catch (JAXBException e) {
// TODO Auto-generated catch block
......
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