From: Svjatoslav Agejenko Date: Wed, 27 Nov 2013 19:13:02 +0000 (+0200) Subject: moved test classes to separate directory X-Git-Tag: javainspect-1.3~5 X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=92162fc60b34f64b1f2570e943ab2cef6db8e54d;p=javainspect.git moved test classes to separate directory --- diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/example/RenderExampleProject.java b/src/main/java/eu/svjatoslav/inspector/java/structure/example/RenderExampleProject.java deleted file mode 100644 index 028c775..0000000 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/example/RenderExampleProject.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * JavaInspect - Utility to visualize java software - * Copyright (C) 2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - */ - -package eu.svjatoslav.inspector.java.structure.example; - -import eu.svjatoslav.inspector.java.structure.ClassGraph; -import eu.svjatoslav.inspector.java.structure.example.structure.SampleClass; - -public class RenderExampleProject { - - public static void main(final String[] args) { - final ClassGraph graph = new ClassGraph(); - - graph.addClass(SampleClass.class); - - graph.generateGraph("example"); - - } - -} diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java b/src/main/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java deleted file mode 100644 index 560c172..0000000 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * JavaInspect - Utility to visualize java software - * Copyright (C) 2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - */ - -package eu.svjatoslav.inspector.java.structure.example; - -import java.io.FileNotFoundException; - -import eu.svjatoslav.inspector.java.structure.ClassGraph; -import eu.svjatoslav.inspector.java.structure.Utils; - -public class RenderJavaInspect { - - public static void main(final String[] args) throws FileNotFoundException { - - handpickClassesExample(); - - fullProjectExample(); - - } - - private static void fullProjectExample() { - final ClassGraph graph = new ClassGraph(); - - // Recursively scan current directory for Java source code and attempt - // to detect class names from there to be added to the graph. - graph.addProject("."); - - // Blacklist example classes from being shown on the graph - graph.getFilter().blacklistClassPattern( - "eu.svjatoslav.inspector.java.structure.example.*"); - - // do not show single classes with no relationships on the graph - graph.hideOrphanedClasses(); - - // Produce bitmap image titled "JavaInspect full project.png" to the - // user Desktop directory. - graph.generateGraph("JavaInspect full project"); - } - - private static void handpickClassesExample() { - /* - * This example demonstrates generating of class graph from hand picked - * classes. - */ - - // Create graph - final ClassGraph graph = new ClassGraph(); - - // While classes and objects can be immediately passed to ClassGraph - // constructor as arguments, it is also possible to add then one by one - // as in the following example. - - // Add some object to the graph. - graph.addObject(graph); - - // Add some class to the graph. - graph.addClass(Utils.class); - - // Produce bitmap image titled "JavaInspect.png" to the user Desktop - // directory and keep intermediary GraphViz DOT file for reference. - graph.generateGraph("JavaInspect", true); - } -} diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectReturnedByMethod.java b/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectReturnedByMethod.java deleted file mode 100644 index 3e507bb..0000000 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectReturnedByMethod.java +++ /dev/null @@ -1,5 +0,0 @@ -package eu.svjatoslav.inspector.java.structure.example.structure; - -public class ObjectReturnedByMethod { - -} diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectVisibleAsClassField.java b/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectVisibleAsClassField.java deleted file mode 100644 index c69a881..0000000 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectVisibleAsClassField.java +++ /dev/null @@ -1,5 +0,0 @@ -package eu.svjatoslav.inspector.java.structure.example.structure; - -public class ObjectVisibleAsClassField { - -} diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass.java b/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass.java deleted file mode 100644 index 3e496c4..0000000 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass.java +++ /dev/null @@ -1,11 +0,0 @@ -package eu.svjatoslav.inspector.java.structure.example.structure; - -public class SampleClass extends SampleSuperClass { - - ObjectVisibleAsClassField sampleClassField; - - public ObjectReturnedByMethod sampleMethod() { - return new ObjectReturnedByMethod(); - } - -} diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleEnum.java b/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleEnum.java deleted file mode 100644 index dfb6ea2..0000000 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleEnum.java +++ /dev/null @@ -1,7 +0,0 @@ -package eu.svjatoslav.inspector.java.structure.example.structure; - -public enum SampleEnum { - - ONE, TWO, THREE, FOUR - -} diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleInterface.java b/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleInterface.java deleted file mode 100644 index 136bfde..0000000 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleInterface.java +++ /dev/null @@ -1,5 +0,0 @@ -package eu.svjatoslav.inspector.java.structure.example.structure; - -public interface SampleInterface { - public SampleEnum getSomeValue(); -} diff --git a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleSuperClass.java b/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleSuperClass.java deleted file mode 100644 index 96edce2..0000000 --- a/src/main/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleSuperClass.java +++ /dev/null @@ -1,10 +0,0 @@ -package eu.svjatoslav.inspector.java.structure.example.structure; - -public class SampleSuperClass implements SampleInterface { - - @Override - public SampleEnum getSomeValue() { - return SampleEnum.ONE; - } - -} diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderExampleProject.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderExampleProject.java new file mode 100644 index 0000000..028c775 --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderExampleProject.java @@ -0,0 +1,26 @@ +/* + * JavaInspect - Utility to visualize java software + * Copyright (C) 2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + */ + +package eu.svjatoslav.inspector.java.structure.example; + +import eu.svjatoslav.inspector.java.structure.ClassGraph; +import eu.svjatoslav.inspector.java.structure.example.structure.SampleClass; + +public class RenderExampleProject { + + public static void main(final String[] args) { + final ClassGraph graph = new ClassGraph(); + + graph.addClass(SampleClass.class); + + graph.generateGraph("example"); + + } + +} diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java new file mode 100644 index 0000000..560c172 --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/RenderJavaInspect.java @@ -0,0 +1,69 @@ +/* + * JavaInspect - Utility to visualize java software + * Copyright (C) 2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + */ + +package eu.svjatoslav.inspector.java.structure.example; + +import java.io.FileNotFoundException; + +import eu.svjatoslav.inspector.java.structure.ClassGraph; +import eu.svjatoslav.inspector.java.structure.Utils; + +public class RenderJavaInspect { + + public static void main(final String[] args) throws FileNotFoundException { + + handpickClassesExample(); + + fullProjectExample(); + + } + + private static void fullProjectExample() { + final ClassGraph graph = new ClassGraph(); + + // Recursively scan current directory for Java source code and attempt + // to detect class names from there to be added to the graph. + graph.addProject("."); + + // Blacklist example classes from being shown on the graph + graph.getFilter().blacklistClassPattern( + "eu.svjatoslav.inspector.java.structure.example.*"); + + // do not show single classes with no relationships on the graph + graph.hideOrphanedClasses(); + + // Produce bitmap image titled "JavaInspect full project.png" to the + // user Desktop directory. + graph.generateGraph("JavaInspect full project"); + } + + private static void handpickClassesExample() { + /* + * This example demonstrates generating of class graph from hand picked + * classes. + */ + + // Create graph + final ClassGraph graph = new ClassGraph(); + + // While classes and objects can be immediately passed to ClassGraph + // constructor as arguments, it is also possible to add then one by one + // as in the following example. + + // Add some object to the graph. + graph.addObject(graph); + + // Add some class to the graph. + graph.addClass(Utils.class); + + // Produce bitmap image titled "JavaInspect.png" to the user Desktop + // directory and keep intermediary GraphViz DOT file for reference. + graph.generateGraph("JavaInspect", true); + } +} diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectReturnedByMethod.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectReturnedByMethod.java new file mode 100644 index 0000000..3e507bb --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectReturnedByMethod.java @@ -0,0 +1,5 @@ +package eu.svjatoslav.inspector.java.structure.example.structure; + +public class ObjectReturnedByMethod { + +} diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectVisibleAsClassField.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectVisibleAsClassField.java new file mode 100644 index 0000000..c69a881 --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/ObjectVisibleAsClassField.java @@ -0,0 +1,5 @@ +package eu.svjatoslav.inspector.java.structure.example.structure; + +public class ObjectVisibleAsClassField { + +} diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass.java new file mode 100644 index 0000000..3e496c4 --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleClass.java @@ -0,0 +1,11 @@ +package eu.svjatoslav.inspector.java.structure.example.structure; + +public class SampleClass extends SampleSuperClass { + + ObjectVisibleAsClassField sampleClassField; + + public ObjectReturnedByMethod sampleMethod() { + return new ObjectReturnedByMethod(); + } + +} diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleEnum.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleEnum.java new file mode 100644 index 0000000..dfb6ea2 --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleEnum.java @@ -0,0 +1,7 @@ +package eu.svjatoslav.inspector.java.structure.example.structure; + +public enum SampleEnum { + + ONE, TWO, THREE, FOUR + +} diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleInterface.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleInterface.java new file mode 100644 index 0000000..136bfde --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleInterface.java @@ -0,0 +1,5 @@ +package eu.svjatoslav.inspector.java.structure.example.structure; + +public interface SampleInterface { + public SampleEnum getSomeValue(); +} diff --git a/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleSuperClass.java b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleSuperClass.java new file mode 100644 index 0000000..96edce2 --- /dev/null +++ b/src/test/java/eu/svjatoslav/inspector/java/structure/example/structure/SampleSuperClass.java @@ -0,0 +1,10 @@ +package eu.svjatoslav.inspector.java.structure.example.structure; + +public class SampleSuperClass implements SampleInterface { + + @Override + public SampleEnum getSomeValue() { + return SampleEnum.ONE; + } + +}