Last active
December 19, 2017 16:37
-
-
Save wreulicke/9f61456c198e8a36593640d8c13ea1a5 to your computer and use it in GitHub Desktop.
jcstress test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.sample; | |
import org.modelmapper.ModelMapper; | |
import org.modelmapper.convention.MatchingStrategies; | |
import org.modelmapper.convention.NameTokenizers; | |
import org.openjdk.jcstress.annotations.Actor; | |
import org.openjdk.jcstress.annotations.Expect; | |
import org.openjdk.jcstress.annotations.JCStressTest; | |
import org.openjdk.jcstress.annotations.Outcome; | |
import org.openjdk.jcstress.annotations.State; | |
import org.openjdk.jcstress.infra.results.LDI_Result; | |
import lombok.Data; | |
import lombok.Value; | |
@JCStressTest | |
@Outcome(id = { | |
"1, 1.5, 1" | |
}, expect = Expect.ACCEPTABLE) | |
@State | |
public class ConcurrencyTest5 { | |
private static final ModelMapper modelMapper; // -@cs[ConstantName] privateだしlombokを使えるメリットの方が大きい | |
static { | |
modelMapper = new ModelMapper(); | |
modelMapper.getConfiguration() | |
.setMatchingStrategy(MatchingStrategies.STANDARD); | |
modelMapper.getConfiguration() | |
.setSourceNameTokenizer(NameTokenizers.UNDERSCORE); | |
modelMapper.getConfiguration() | |
.setFieldMatchingEnabled(true) | |
.setFieldAccessLevel(org.modelmapper.config.Configuration.AccessLevel.PRIVATE); | |
} | |
@Actor | |
public void actor1(LDI_Result r) { | |
From from = new From("1", 1, 1.5); | |
To to = new To(); | |
modelMapper.map(from, to); | |
r.r1 = to.getTestString(); | |
} | |
@Actor | |
public void actor2(LDI_Result r) { | |
From from = new From("1", 1, 1.5); | |
To to = new To(); | |
modelMapper.map(from, to); | |
r.r2 = to.getD(); | |
} | |
@Actor | |
public void actor3(LDI_Result r) { | |
From from = new From("1", 1, 1.5); | |
To to = new To(); | |
modelMapper.map(from, to); | |
r.r3 = to.getI(); | |
} | |
@Value | |
public class From { | |
String testString; | |
int i; | |
double d; | |
} | |
@Data | |
public class To { | |
String testString; | |
int i; | |
double d; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Java Concurrency Stress test report</title> | |
<style type="text/css"> | |
* { font-family: Arial; } | |
table { font-size: 9pt; } | |
a { color: #000000; } | |
.progress { padding: 0px; } | |
.header { text-align: left; } | |
.section1 { font-size: 12pt; background-color: #BDB76B; color: #000000; font-weight: bold;} | |
.section2 { font-size: 12pt; background-color: #F0E68C; color: #000000; font-weight: bold;} | |
.cell1 { background-color: #FAFAD2; } | |
.cell2 { background-color: #EEE8AA; } | |
.passedProgress { background-color: #00AA00; color: #FFFFFF; text-align: center; font-weight: bold; } | |
.failedProgress { background-color: #FF0000; color: #FFFFFF; text-align: center; font-weight: bold; } | |
.passed { color: #00AA00; text-align: center; font-weight: bold; } | |
.failed { color: #FF0000; text-align: center; font-weight: bold; } | |
.interesting { color: #0000FF; text-align: center; font-weight: bold; } | |
.spec { color: #AAAA00; text-align: center; font-weight: bold; } | |
.endResult { font-size: 48pt; text-align: center; font-weight: bold; } | |
</style> | |
</head> | |
<body> | |
<table width="100%" cellspacing="20"> | |
<tr> | |
<td> | |
<p class="endResult passed"> | |
100% | |
</p> | |
<table width="100%" cellpadding="3" cellspacing="0"> | |
<tr><td width="100%" class="passedProgress"> </td></tr> | |
<tr><td nowrap><b>Overall pass rate:</b> 1/1 </td></tr> | |
</table> | |
<br> | |
</td> | |
<td width=100> | |
<table> | |
<tr> | |
<td nowrap>java.specification.name</td> | |
<td nowrap>Java Platform API Specification</td> | |
</tr> | |
<tr> | |
<td nowrap>java.specification.vendor</td> | |
<td nowrap>Oracle Corporation</td> | |
</tr> | |
<tr> | |
<td nowrap>java.specification.version</td> | |
<td nowrap>1.8</td> | |
</tr> | |
<tr> | |
<td nowrap>java.vendor</td> | |
<td nowrap>Oracle Corporation</td> | |
</tr> | |
<tr> | |
<td nowrap>java.version</td> | |
<td nowrap>1.8.0_144</td> | |
</tr> | |
<tr> | |
<td nowrap>java.vm.name</td> | |
<td nowrap>Java HotSpot(TM) 64-Bit Server VM</td> | |
</tr> | |
<tr> | |
<td nowrap>java.vm.vendor</td> | |
<td nowrap>Oracle Corporation</td> | |
</tr> | |
<tr> | |
<td nowrap>java.vm.version</td> | |
<td nowrap>25.144-b01</td> | |
</tr> | |
<tr> | |
<td nowrap>os.arch</td> | |
<td nowrap>amd64</td> | |
</tr> | |
<tr> | |
<td nowrap>os.name</td> | |
<td nowrap>Windows 10</td> | |
</tr> | |
<tr> | |
<td nowrap>os.version</td> | |
<td nowrap>10.0</td> | |
</tr> | |
</table> | |
</td> | |
</tr> | |
</table> | |
<hr> | |
<h3>FAILED tests</h3> | |
<p>Strong asserts were violated. Correct implementations should have no assert failures here.</p> | |
<table cellspacing=0 cellpadding=3 width="100%"> | |
</table> | |
None! | |
<br> | |
<br> | |
<hr> | |
<h3>ERROR tests</h3> | |
<p>Tests break for some reason, other than failing the assert. Correct implementations should have none.</p> | |
<table cellspacing=0 cellpadding=3 width="100%"> | |
</table> | |
None! | |
<br> | |
<br> | |
<hr> | |
<h3>INTERESTING tests</h3> | |
<p>Some interesting behaviors observed. This is for the plain curiosity.</p> | |
<table cellspacing=0 cellpadding=3 width="100%"> | |
</table> | |
None! | |
<br> | |
<br> | |
<hr> | |
<h3>All tests</h3> | |
<p></p> | |
<table cellspacing=0 cellpadding=3 width="100%"> | |
<tr class="cell2"> | |
<td> <a href="org.sample.ConcurrencyTest5.html">org.sample.ConcurrencyTest5</a></td> | |
<td>10<sup>6</sup></td><td class="passed">PASSED</td> | |
<td class="interesting"></td> | |
<td class="passed"></td> | |
</tr> | |
</table> | |
<br> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Java Concurrency Stress test report</title> | |
<style type="text/css"> | |
* { font-family: Arial; } | |
table { font-size: 9pt; } | |
a { color: #000000; } | |
.progress { padding: 0px; } | |
.header { text-align: left; } | |
.section1 { font-size: 12pt; background-color: #BDB76B; color: #000000; font-weight: bold;} | |
.section2 { font-size: 12pt; background-color: #F0E68C; color: #000000; font-weight: bold;} | |
.cell1 { background-color: #FAFAD2; } | |
.cell2 { background-color: #EEE8AA; } | |
.passedProgress { background-color: #00AA00; color: #FFFFFF; text-align: center; font-weight: bold; } | |
.failedProgress { background-color: #FF0000; color: #FFFFFF; text-align: center; font-weight: bold; } | |
.passed { color: #00AA00; text-align: center; font-weight: bold; } | |
.failed { color: #FF0000; text-align: center; font-weight: bold; } | |
.interesting { color: #0000FF; text-align: center; font-weight: bold; } | |
.spec { color: #AAAA00; text-align: center; font-weight: bold; } | |
.endResult { font-size: 48pt; text-align: center; font-weight: bold; } | |
</style> | |
</head> | |
<body> | |
<h1>org.sample.ConcurrencyTest5</h1> | |
<h3>Description and references</h3> | |
<p>null</p> | |
<h3>Environment</h3> | |
<table> | |
<tr> | |
<td nowrap>java.specification.name</td> | |
<td nowrap>Java Platform API Specification</td> | |
</tr> | |
<tr> | |
<td nowrap>java.specification.vendor</td> | |
<td nowrap>Oracle Corporation</td> | |
</tr> | |
<tr> | |
<td nowrap>java.specification.version</td> | |
<td nowrap>1.8</td> | |
</tr> | |
<tr> | |
<td nowrap>java.vendor</td> | |
<td nowrap>Oracle Corporation</td> | |
</tr> | |
<tr> | |
<td nowrap>java.version</td> | |
<td nowrap>1.8.0_144</td> | |
</tr> | |
<tr> | |
<td nowrap>java.vm.name</td> | |
<td nowrap>Java HotSpot(TM) 64-Bit Server VM</td> | |
</tr> | |
<tr> | |
<td nowrap>java.vm.vendor</td> | |
<td nowrap>Oracle Corporation</td> | |
</tr> | |
<tr> | |
<td nowrap>java.vm.version</td> | |
<td nowrap>25.144-b01</td> | |
</tr> | |
<tr> | |
<td nowrap>os.arch</td> | |
<td nowrap>amd64</td> | |
</tr> | |
<tr> | |
<td nowrap>os.name</td> | |
<td nowrap>Windows 10</td> | |
</tr> | |
<tr> | |
<td nowrap>os.version</td> | |
<td nowrap>10.0</td> | |
</tr> | |
</table> | |
<h3>Test configurations</h3> | |
<table> | |
<tr> | |
<td nowrap><b>TC 1</b></td> | |
<td nowrap>JVM options: [] | |
Iterations: 5 | |
Time: 1000</td> | |
</tr> | |
<tr> | |
<td nowrap><b>TC 2</b></td> | |
<td nowrap>JVM options: [-XX:-TieredCompilation] | |
Iterations: 5 | |
Time: 1000</td> | |
</tr> | |
<tr> | |
<td nowrap><b>TC 3</b></td> | |
<td nowrap>JVM options: [-XX:TieredStopAtLevel=1] | |
Iterations: 5 | |
Time: 1000</td> | |
</tr> | |
<tr> | |
<td nowrap><b>TC 4</b></td> | |
<td nowrap>JVM options: [-Xint] | |
Iterations: 5 | |
Time: 1000</td> | |
</tr> | |
</table> | |
<h3>Observed states</h3> | |
<table width=100% cellpadding=5> | |
<tr> | |
<th>Observed state</th> | |
<th nowrap>TC 1</th> | |
<th nowrap>TC 2</th> | |
<th nowrap>TC 3</th> | |
<th nowrap>TC 4</th> | |
<th>Expectation</th> | |
<th>Interpretation</th> | |
</tr> | |
<tr> | |
<td align='center'>1, 1.5, 1</td> | |
<td align='right' width='7.5%' bgColor=#00ff00>4383798</td> | |
<td align='right' width='7.5%' bgColor=#00ff00>2436488</td> | |
<td align='right' width='7.5%' bgColor=#00ff00>1129648</td> | |
<td align='right' width='7.5%' bgColor=#00ff00>95608</td> | |
<td>ACCEPTABLE</td> | |
<td></td> | |
</tr> | |
<tr> | |
<td></td> | |
<td align='center' bgColor='green '>OK</td> | |
<td align='center' bgColor='green '>OK</td> | |
<td align='center' bgColor='green '>OK</td> | |
<td align='center' bgColor='green '>OK</td> | |
<td></td> | |
<td></td> | |
</tr> | |
</table> | |
<h3>Auxiliary data</h3> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright (c) 2017, Red Hat Inc. All rights reserved. Redistribution | |
and use in source and binary forms, with or without modification, are permitted | |
provided that the following conditions are met: * Redistributions of source | |
code must retain the above copyright notice, this list of conditions and | |
the following disclaimer. * Redistributions in binary form must reproduce | |
the above copyright notice, this list of conditions and the following disclaimer | |
in the documentation and/or other materials provided with the distribution. | |
* Neither the name of Oracle nor the names of its contributors may be used | |
to endorse or promote products derived from this software without specific | |
prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS | |
AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, | |
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT | |
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY | |
OF SUCH DAMAGE. --> | |
<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/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.sample</groupId> | |
<artifactId>test</artifactId> | |
<version>1.0</version> | |
<packaging>jar</packaging> | |
<name>JCStress test sample</name> | |
<!-- This is the demo/sample template build script for building concurrency | |
tests with JCStress. Edit as needed. --> | |
<prerequisites> | |
<maven>3.0</maven> | |
</prerequisites> | |
<dependencies> | |
<dependency> | |
<groupId>org.openjdk.jcstress</groupId> | |
<artifactId>jcstress-core</artifactId> | |
<version>${jcstress.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.commons</groupId> | |
<artifactId>commons-lang3</artifactId> | |
<version>3.5</version> | |
</dependency> | |
<dependency> | |
<groupId>org.modelmapper</groupId> | |
<artifactId>modelmapper</artifactId> | |
<version>0.7.5</version> | |
</dependency> | |
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> | |
<dependency> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> | |
<version>1.16.18</version> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<!-- jcstress version to use with this project. --> | |
<jcstress.version>0.4</jcstress.version> | |
<!-- Java source/target to use for compilation. --> | |
<javac.target>1.8</javac.target> | |
<!-- Name of the test Uber-JAR to generate. --> | |
<uberjar.name>jcstress</uberjar.name> | |
</properties> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.1</version> | |
<configuration> | |
<compilerVersion>${javac.target}</compilerVersion> | |
<source>${javac.target}</source> | |
<target>${javac.target}</target> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-shade-plugin</artifactId> | |
<version>2.2</version> | |
<executions> | |
<execution> | |
<id>main</id> | |
<phase>package</phase> | |
<goals> | |
<goal>shade</goal> | |
</goals> | |
<configuration> | |
<finalName>${uberjar.name}</finalName> | |
<transformers> | |
<transformer | |
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> | |
<mainClass>org.openjdk.jcstress.Main</mainClass> | |
</transformer> | |
<transformer | |
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> | |
<resource>META-INF/TestList</resource> | |
</transformer> | |
</transformers> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment