001 package org.kuali.maven.plugins.graph.dot; 002 003 import java.io.File; 004 import java.io.OutputStream; 005 006 import org.apache.commons.io.FileUtils; 007 import org.apache.commons.io.IOUtils; 008 import org.junit.Test; 009 import org.kuali.maven.plugins.graph.dot.StringGenerator; 010 import org.kuali.maven.plugins.graph.pojo.Graph; 011 012 public class DotGeneratorTest { 013 DotGenerator dg = new DotGenerator(); 014 StringGenerator sg = new StringGenerator(); 015 016 @Test 017 public void testHelloWorld() { 018 try { 019 Graph g = dg.getHelloWorld(); 020 String s = sg.getString(g); 021 File file = new File("./target/test-classes/hellworld.dot"); 022 OutputStream out = FileUtils.openOutputStream(file); 023 IOUtils.write(s.getBytes(), out); 024 out.close(); 025 } catch (Exception e) { 026 e.printStackTrace(); 027 } 028 } 029 }