From a6a58f40f6e22749128434ab124b010233fb6821 Mon Sep 17 00:00:00 2001 From: Abhinab Kanrar Date: Wed, 21 Jun 2017 23:56:07 +0530 Subject: [PATCH] adding jmh (#1976) --- jmh/pom.xml | 52 +++++++++++++++++++ .../main/java/com/baeldung/Application.java | 14 +++++ jmh/src/main/java/com/baeldung/BenchMark.java | 12 +++++ jmh/src/main/resources/META-INF/BenchmarkList | 0 jmh/src/test/java/com/baeldung/AppTest.java | 38 ++++++++++++++ 5 files changed, 116 insertions(+) create mode 100644 jmh/pom.xml create mode 100644 jmh/src/main/java/com/baeldung/Application.java create mode 100644 jmh/src/main/java/com/baeldung/BenchMark.java create mode 100644 jmh/src/main/resources/META-INF/BenchmarkList create mode 100644 jmh/src/test/java/com/baeldung/AppTest.java diff --git a/jmh/pom.xml b/jmh/pom.xml new file mode 100644 index 0000000000..8ecfaa9651 --- /dev/null +++ b/jmh/pom.xml @@ -0,0 +1,52 @@ + + 4.0.0 + com.baeldung + jmh + jar + 1.0-SNAPSHOT + jmh + http://maven.apache.org + + + UTF-8 + UTF-8 + 1.8 + + + + + org.openjdk.jmh + jmh-core + 1.19 + + + org.openjdk.jmh + jmh-generator-annprocess + 1.19 + + + junit + junit + 3.8.1 + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + com.baeldung.Application + + + + + + + + \ No newline at end of file diff --git a/jmh/src/main/java/com/baeldung/Application.java b/jmh/src/main/java/com/baeldung/Application.java new file mode 100644 index 0000000000..28e70740e0 --- /dev/null +++ b/jmh/src/main/java/com/baeldung/Application.java @@ -0,0 +1,14 @@ +package com.baeldung; + +import java.io.IOException; + +import org.openjdk.jmh.Main; +import org.openjdk.jmh.runner.RunnerException; + +public class Application { + + public static void main(String[] args) throws RunnerException, IOException { + Main.main(args); + } + +} diff --git a/jmh/src/main/java/com/baeldung/BenchMark.java b/jmh/src/main/java/com/baeldung/BenchMark.java new file mode 100644 index 0000000000..f2b984d211 --- /dev/null +++ b/jmh/src/main/java/com/baeldung/BenchMark.java @@ -0,0 +1,12 @@ +package com.baeldung; + +import org.openjdk.jmh.annotations.Benchmark; + +public class BenchMark { + + @Benchmark + public void init() { + + } + +} diff --git a/jmh/src/main/resources/META-INF/BenchmarkList b/jmh/src/main/resources/META-INF/BenchmarkList new file mode 100644 index 0000000000..e69de29bb2 diff --git a/jmh/src/test/java/com/baeldung/AppTest.java b/jmh/src/test/java/com/baeldung/AppTest.java new file mode 100644 index 0000000000..c9f61455bd --- /dev/null +++ b/jmh/src/test/java/com/baeldung/AppTest.java @@ -0,0 +1,38 @@ +package com.baeldung; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +}