adding jmh (#1976)
This commit is contained in:
parent
0fab04f1b6
commit
a6a58f40f6
52
jmh/pom.xml
Normal file
52
jmh/pom.xml
Normal file
@ -0,0 +1,52 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>jmh</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>jmh</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.openjdk.jmh</groupId>
|
||||
<artifactId>jmh-core</artifactId>
|
||||
<version>1.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjdk.jmh</groupId>
|
||||
<artifactId>jmh-generator-annprocess</artifactId>
|
||||
<version>1.19</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>com.baeldung.Application</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
14
jmh/src/main/java/com/baeldung/Application.java
Normal file
14
jmh/src/main/java/com/baeldung/Application.java
Normal file
@ -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);
|
||||
}
|
||||
|
||||
}
|
12
jmh/src/main/java/com/baeldung/BenchMark.java
Normal file
12
jmh/src/main/java/com/baeldung/BenchMark.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.baeldung;
|
||||
|
||||
import org.openjdk.jmh.annotations.Benchmark;
|
||||
|
||||
public class BenchMark {
|
||||
|
||||
@Benchmark
|
||||
public void init() {
|
||||
|
||||
}
|
||||
|
||||
}
|
0
jmh/src/main/resources/META-INF/BenchmarkList
Normal file
0
jmh/src/main/resources/META-INF/BenchmarkList
Normal file
38
jmh/src/test/java/com/baeldung/AppTest.java
Normal file
38
jmh/src/test/java/com/baeldung/AppTest.java
Normal file
@ -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 );
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user