Skip to content

Commit a6a58f4

Browse files
AbhinabKanrarpivovarit
authored andcommitted
adding jmh (eugenp#1976)
1 parent 0fab04f commit a6a58f4

5 files changed

Lines changed: 116 additions & 0 deletions

File tree

‎jmh/pom.xml‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>jmh</artifactId>
6+
<packaging>jar</packaging>
7+
<version>1.0-SNAPSHOT</version>
8+
<name>jmh</name>
9+
<url>http://maven.apache.org</url>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
14+
<java.version>1.8</java.version>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.openjdk.jmh</groupId>
20+
<artifactId>jmh-core</artifactId>
21+
<version>1.19</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.openjdk.jmh</groupId>
25+
<artifactId>jmh-generator-annprocess</artifactId>
26+
<version>1.19</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>junit</groupId>
30+
<artifactId>junit</artifactId>
31+
<version>3.8.1</version>
32+
<scope>test</scope>
33+
</dependency>
34+
</dependencies>
35+
36+
<build>
37+
<plugins>
38+
<plugin>
39+
<groupId>org.apache.maven.plugins</groupId>
40+
<artifactId>maven-jar-plugin</artifactId>
41+
<configuration>
42+
<archive>
43+
<manifest>
44+
<mainClass>com.baeldung.Application</mainClass>
45+
</manifest>
46+
</archive>
47+
</configuration>
48+
</plugin>
49+
</plugins>
50+
</build>
51+
52+
</project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.baeldung;
2+
3+
import java.io.IOException;
4+
5+
import org.openjdk.jmh.Main;
6+
import org.openjdk.jmh.runner.RunnerException;
7+
8+
public class Application {
9+
10+
public static void main(String[] args) throws RunnerException, IOException {
11+
Main.main(args);
12+
}
13+
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.baeldung;
2+
3+
import org.openjdk.jmh.annotations.Benchmark;
4+
5+
public class BenchMark {
6+
7+
@Benchmark
8+
public void init() {
9+
10+
}
11+
12+
}

‎jmh/src/main/resources/META-INF/BenchmarkList‎

Whitespace-only changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.baeldung;
2+
3+
import junit.framework.Test;
4+
import junit.framework.TestCase;
5+
import junit.framework.TestSuite;
6+
7+
/**
8+
* Unit test for simple App.
9+
*/
10+
public class AppTest
11+
extends TestCase
12+
{
13+
/**
14+
* Create the test case
15+
*
16+
* @param testName name of the test case
17+
*/
18+
public AppTest( String testName )
19+
{
20+
super( testName );
21+
}
22+
23+
/**
24+
* @return the suite of tests being tested
25+
*/
26+
public static Test suite()
27+
{
28+
return new TestSuite( AppTest.class );
29+
}
30+
31+
/**
32+
* Rigourous Test :-)
33+
*/
34+
public void testApp()
35+
{
36+
assertTrue( true );
37+
}
38+
}

0 commit comments

Comments
 (0)