Skip to content

Commit 9d66fb3

Browse files
committed
Merged changes due to lost repo connection. Should reestablish 1.0-RC3.
1 parent 3d7a4fe commit 9d66fb3

18 files changed

+297
-285
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
money-tck.iml
2-
.project
3-
.classpath
1+
../../git/jsr354-tck/money-tck.iml
42
target/
53
test-output/
64
*.iml

README.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ To setup the TCK with your implementation you must follow the following steps:
1616

1717
To execute the TCK, simply execute
1818

19-
mvn clean test site
19+
mvn clean test site
2020

2121
5) Go to target/site - there you will find your TCK test results.
22+
23+
24+
As jump-start you can clone https://github.com/JavaMoney/jsr354-ritest .
25+
26+
The JSR 354 Team.
2227

2328

2429

pom.xml

+37-10
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
<parent>
1818
<groupId>org.javamoney</groupId>
1919
<artifactId>javamoney-parent</artifactId>
20-
<version>1.0-RC2</version>
20+
<version>1.0-RC3</version>
2121
</parent>
2222

2323
<artifactId>javamoney-tck</artifactId>
2424
<packaging>jar</packaging>
2525

26-
<version>1.0-SNAPSHOT</version>
26+
<version>1.0-RC3</version>
2727

2828
<name>JSR 354 (TCK)</name>
2929
<url>http://java.net/projects/javamoney</url>
@@ -46,7 +46,7 @@
4646
</licenses>
4747

4848
<properties>
49-
<jsr.version>1.0-SNAPSHOT</jsr.version>
49+
<jsr.version>1.0-RC3</jsr.version>
5050
<jdkVersion>1.8</jdkVersion>
5151
<maven.compile.targetLevel>${jdkVersion}</maven.compile.targetLevel>
5252
<maven.compile.sourceLevel>${jdkVersion}</maven.compile.sourceLevel>
@@ -389,6 +389,21 @@
389389
<plugin>
390390
<groupId>org.asciidoctor</groupId>
391391
<artifactId>asciidoctor-maven-plugin</artifactId>
392+
<version>1.5.2</version>
393+
<dependencies>
394+
<dependency>
395+
<groupId>org.asciidoctor</groupId>
396+
<artifactId>asciidoctorj-pdf</artifactId>
397+
<version>1.5.0-alpha.6</version>
398+
</dependency>
399+
</dependencies>
400+
<configuration>
401+
<sourceDirectory>src/main/asciidoc</sourceDirectory>
402+
<baseDir>${project.basedir}</baseDir>
403+
<imagesDir>src/main/asciidoc/images/</imagesDir>
404+
<embedAssets>true</embedAssets>
405+
<!-- eruby>erubis</eruby -->
406+
</configuration>
392407
<executions>
393408
<execution>
394409
<id>output-html</id>
@@ -398,16 +413,28 @@
398413
</goals>
399414
<configuration>
400415
<outputDirectory>target/docs</outputDirectory>
401-
<sourceHighlighter>highlightjs</sourceHighlighter>
416+
<sourceHighlighter>coderay</sourceHighlighter>
402417
<backend>html</backend>
403-
<embedAssets>true</embedAssets>
404-
<imagesDir>arc/main/asciidoc/images</imagesDir>
405418
</configuration>
406419
</execution>
407-
<!-- execution> <id>output-pdf</id> <phase>generate-resources</phase>
408-
<goals> <goal>process-asciidoc</goal> </goals> <configuration> <outputDirectory>target/docs</outputDirectory>
409-
<sourceHighlighter>highlightjs</sourceHighlighter> <backend>pdf</backend>
410-
</configuration> </execution -->
420+
<execution>
421+
<id>output-pdf</id>
422+
<phase>prepare-package</phase>
423+
<goals>
424+
<goal>process-asciidoc</goal>
425+
</goals>
426+
<configuration>
427+
<backend>pdf</backend>
428+
<!-- WARNING callout bullets don't yet work with CodeRay -->
429+
<sourceHighlighter>coderay</sourceHighlighter>
430+
<attributes>
431+
<pagenums/>
432+
<toc/>
433+
<idprefix/>
434+
<idseparator>-</idseparator>
435+
</attributes>
436+
</configuration>
437+
</execution>
411438
</executions>
412439
</plugin>
413440
</plugins>

src/main/java/org/javamoney/tck/JSR354TestConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
* @author Anatole Tresch
2424
*/
25-
public interface JSR354TestConfiguration{
25+
public interface JSR354TestConfiguration {
2626

2727
/**
2828
* Return a collection with all {@link MonetaryAmount} classes that are implemented. The list

src/main/java/org/javamoney/tck/TCKRunner.java

+39-49
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
* Main class for executing the JSR 354 TCK.
3535
* Created by Anatole on 12.06.2014.
3636
*/
37-
public class TCKRunner extends XmlSuite{
38-
public TCKRunner(){
37+
public class TCKRunner extends XmlSuite {
38+
public TCKRunner() {
3939
setName("JSR354-TCK 1.0");
4040
XmlTest test = new XmlTest(this);
4141
test.setName("TCK/Test Setup");
@@ -55,7 +55,7 @@ public TCKRunner(){
5555
test.setXmlClasses(classes);
5656
}
5757

58-
public static void main(String... args){
58+
public static void main(String... args) {
5959
System.out.println("-- JSR 354 TCK started --");
6060
List<XmlSuite> suites = new ArrayList<>();
6161
suites.add(new TCKRunner());
@@ -72,7 +72,7 @@ public static void main(String... args){
7272
System.out.println("-- JSR 354 TCK finished --");
7373
}
7474

75-
public static final class TCKReporter extends TestListenerAdapter{
75+
public static final class TCKReporter extends TestListenerAdapter {
7676
private int count = 0;
7777
private int skipped = 0;
7878
private int failed = 0;
@@ -81,101 +81,92 @@ public static final class TCKReporter extends TestListenerAdapter{
8181
private StringWriter internalBuffer = new StringWriter(3000);
8282
private FileWriter w;
8383

84-
public TCKReporter(File file){
85-
try{
86-
if(!file.exists()){
84+
public TCKReporter(File file) {
85+
try {
86+
if (!file.exists()) {
8787
file.createNewFile();
8888
}
8989
w = new FileWriter(file);
9090
w.write("*****************************************************************************************\n");
9191
w.write("**** JSR 354 - Money & Currency, Technical Compatibility Kit, version 1.0\n");
9292
w.write("*****************************************************************************************\n\n");
93-
w.write("Executed on " + new java.util.Date() +"\n\n" );
93+
w.write("Executed on " + new java.util.Date() + "\n\n");
9494

9595
// System.out:
9696
internalBuffer.write("*****************************************************************************************\n");
9797
internalBuffer.write("**** JSR 354 - Money & Currency, Technical Compatibility Kit, version 1.0\n");
9898
internalBuffer.write("*****************************************************************************************\n\n");
9999
internalBuffer.write("Executed on " + new java.util.Date() + "\n\n");
100-
}
101-
catch(IOException e){
100+
} catch (IOException e) {
102101
e.printStackTrace();
103102
System.exit(-1);
104103
}
105104
}
106105

107106
@Override
108-
public void onTestFailure(ITestResult tr){
107+
public void onTestFailure(ITestResult tr) {
109108
failed++;
110-
String location = tr.getTestClass().getRealClass().getSimpleName()+'#'+tr.getMethod().getMethodName();
111-
try{
109+
String location = tr.getTestClass().getRealClass().getSimpleName() + '#' + tr.getMethod().getMethodName();
110+
try {
112111
Method realTestMethod = tr.getMethod().getMethod();
113112
Test testAnnot = realTestMethod.getAnnotation(Test.class);
114-
if(testAnnot!=null && testAnnot.description()!=null && !testAnnot.description().isEmpty()){
115-
if(tr.getThrowable()!=null){
113+
if (testAnnot != null && testAnnot.description() != null && !testAnnot.description().isEmpty()) {
114+
if (tr.getThrowable() != null) {
116115
StringWriter sw = new StringWriter();
117116
PrintWriter w = new PrintWriter(sw);
118117
tr.getThrowable().printStackTrace(w);
119118
w.flush();
120-
log("[FAILED] " + testAnnot.description() + "("+location+"):\n"+sw.toString());
121-
}
122-
else{
123-
log("[FAILED] " + testAnnot.description()+ "("+location+")");
119+
log("[FAILED] " + testAnnot.description() + "(" + location + "):\n" + sw.toString());
120+
} else {
121+
log("[FAILED] " + testAnnot.description() + "(" + location + ")");
124122
}
125-
}
126-
else{
123+
} else {
127124

128-
if(tr.getThrowable()!=null){
125+
if (tr.getThrowable() != null) {
129126
StringWriter sw = new StringWriter();
130127
PrintWriter w = new PrintWriter(sw);
131128
tr.getThrowable().printStackTrace(w);
132129
w.flush();
133-
log("[FAILED] " + location + ":\n"+sw.toString());
134-
}
135-
else{
130+
log("[FAILED] " + location + ":\n" + sw.toString());
131+
} else {
136132
log("[FAILED] " + location);
137133
}
138134
}
139-
}
140-
catch(IOException e){
135+
} catch (IOException e) {
141136
throw new IllegalStateException("IO Error", e);
142137
}
143138
}
144139

145140
@Override
146-
public void onTestSkipped(ITestResult tr){
141+
public void onTestSkipped(ITestResult tr) {
147142
skipped++;
148-
String location = tr.getTestClass().getRealClass().getSimpleName()+'#'+tr.getMethod().getMethodName();
149-
try{
143+
String location = tr.getTestClass().getRealClass().getSimpleName() + '#' + tr.getMethod().getMethodName();
144+
try {
150145
Method realTestMethod = tr.getMethod().getMethod();
151146
Test specAssert = realTestMethod.getAnnotation(Test.class);
152-
if(specAssert!=null && specAssert.description()!=null && !specAssert.description().isEmpty()){
153-
log("[SKIPPED] " + specAssert.description()+ "("+location+")");
154-
}
155-
else{
147+
if (specAssert != null && specAssert.description() != null && !specAssert.description().isEmpty()) {
148+
log("[SKIPPED] " + specAssert.description() + "(" + location + ")");
149+
} else {
156150
log("[SKIPPED] " + location);
157151
}
158-
}
159-
catch(IOException e){
152+
} catch (IOException e) {
160153
throw new IllegalStateException("IO Error", e);
161154
}
162155
}
163156

164157
@Override
165-
public void onTestSuccess(ITestResult tr){
158+
public void onTestSuccess(ITestResult tr) {
166159
success++;
167-
String location = tr.getTestClass().getRealClass().getSimpleName()+'#'+tr.getMethod().getMethodName();
168-
try{
160+
String location = tr.getTestClass().getRealClass().getSimpleName() + '#' + tr.getMethod().getMethodName();
161+
try {
169162
Method realTestMethod = tr.getMethod().getMethod();
170163
Test specAssert = realTestMethod.getAnnotation(Test.class);
171-
if(specAssert!=null && specAssert.description()!=null && !specAssert.description().isEmpty()){
172-
log("[SUCCESS] " + specAssert.description()+ "("+location+")");
173-
}
174-
else{
164+
if (specAssert != null && specAssert.description() != null && !specAssert.description().isEmpty()) {
165+
log("[SUCCESS] " + specAssert.description() + "(" + location + ")");
166+
} else {
175167
log("[SUCCESS] " + location);
176168
}
177-
}
178-
catch(IOException e){
169+
} catch (IOException e) {
179170
throw new IllegalStateException("IO Error", e);
180171
}
181172
}
@@ -188,8 +179,8 @@ private void log(String text) throws IOException {
188179
internalBuffer.write('\n');
189180
}
190181

191-
public void writeSummary(){
192-
try{
182+
public void writeSummary() {
183+
try {
193184
log("\nJSR 354 TCP version 1.0 Summary");
194185
log("-------------------------------");
195186
log("\nTOTAL TESTS EXECUTED : " + count);
@@ -201,8 +192,7 @@ public void writeSummary(){
201192
internalBuffer.flush();
202193
System.out.println();
203194
System.out.println(internalBuffer);
204-
}
205-
catch(IOException e){
195+
} catch (IOException e) {
206196
throw new IllegalStateException("IO Error", e);
207197
}
208198
}

src/main/java/org/javamoney/tck/TCKTestSetup.java

+16-16
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@
1313

1414
public final class TCKTestSetup {
1515

16-
private static JSR354TestConfiguration TEST_CONFIG = loadTestConfiguration();
16+
private static JSR354TestConfiguration TEST_CONFIG = loadTestConfiguration();
1717

18-
private TCKTestSetup() {
19-
}
18+
private TCKTestSetup() {
19+
}
2020

21-
private static JSR354TestConfiguration loadTestConfiguration() {
22-
try {
23-
return ServiceLoader.load(JSR354TestConfiguration.class).iterator()
24-
.next();
25-
} catch (Exception e) {
26-
throw new IllegalStateException("No valid implementation of "
27-
+ JSR354TestConfiguration.class.getName()
28-
+ " is registered with the ServiceLoader.");
29-
}
30-
}
21+
private static JSR354TestConfiguration loadTestConfiguration() {
22+
try {
23+
return ServiceLoader.load(JSR354TestConfiguration.class).iterator()
24+
.next();
25+
} catch (Exception e) {
26+
throw new IllegalStateException("No valid implementation of "
27+
+ JSR354TestConfiguration.class.getName()
28+
+ " is registered with the ServiceLoader.");
29+
}
30+
}
3131

32-
public static JSR354TestConfiguration getTestConfiguration() {
33-
return TEST_CONFIG;
34-
}
32+
public static JSR354TestConfiguration getTestConfiguration() {
33+
return TEST_CONFIG;
34+
}
3535

3636
}

src/main/java/org/javamoney/tck/TCKValidationException.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
public final class TCKValidationException extends RuntimeException {
1313

14-
private static final long serialVersionUID = 1L;
14+
private static final long serialVersionUID = 1L;
1515

16-
public TCKValidationException(String message) {
17-
super(message);
18-
}
16+
public TCKValidationException(String message) {
17+
super(message);
18+
}
1919

20-
public TCKValidationException(String message, Throwable e) {
21-
super(message, e);
22-
}
20+
public TCKValidationException(String message, Throwable e) {
21+
super(message, e);
22+
}
2323

2424
}

0 commit comments

Comments
 (0)