@@ -0,0 +1,2191 @@
+/*%0A * Copyright %C2%A9 2015 Stefan Niederhauser (nidin@gmx.ch)%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage guru.nidi.graphviz.engine;%0A%0Aimport guru.nidi.graphviz.attribute.Image;%0Aimport org.junit.jupiter.api.BeforeAll;%0Aimport org.junit.jupiter.api.Test;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport static guru.nidi.graphviz.model.Factory.graph;%0Aimport static guru.nidi.graphviz.model.Factory.node;%0A%0Aclass ImageTest %7B%0A    @BeforeAll%0A    static void init() %7B%0A        Graphviz.useEngine(new GraphvizV8Engine());%0A    %7D%0A%0A    @Test%0A    void relative() throws IOException %7B%0A        Graphviz g = Graphviz.fromGraph(graph()%0A                .with(node(%22 %22).with(Image.of(%22example/graphviz.png%22))));%0A        g.render(Format.PNG).toFile(new File(%22target/img-relative.png%22));%0A    %7D%0A%0A    @Test%0A    void relativeWithBase() throws IOException %7B%0A        Graphviz g = Graphviz.fromGraph(graph()%0A                .with(node(%22 %22).with(Image.of(%22graphviz.png%22))));%0A        g.basedir(new File(%22example%22)).render(Format.PNG).toFile(new File(%22target/img-base-relative.png%22));%0A    %7D%0A%0A    @Test%0A    void absolute() throws IOException %7B%0A        Graphviz g = Graphviz.fromGraph(graph()%0A                .with(node(%22 %22).with(Image.of(new File(%22example/graphviz.png%22).getAbsolutePath()))));%0A        g.render(Format.PNG).toFile(new File(%22target/img-absolute.png%22));%0A    %7D%0A%0A    @Test%0A    void http() throws IOException %7B%0A        Graphviz g = Graphviz.fromGraph(graph()%0A                .with(node(%22 %22).with(Image.of(%22https://raw.githubusercontent.com/nidi3/graphviz-java/master/graphviz-java/example/ex7.png%22))));%0A        g.render(Format.PNG).toFile(new File(%22target/img-http.png%22));%0A    %7D%0A%7D%0A

add ImageTest