Skip to content

Commit 706a3b0

Browse files
committed
HHH-10521 - Fix Java 6 not compliant tests
1 parent 5c8275a commit 706a3b0

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

hibernate-core/src/test/java/org/hibernate/test/subselect/SetSubselectTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import static org.hamcrest.core.Is.is;
1818
import static org.junit.Assert.assertThat;
19+
import static org.junit.Assert.fail;
1920

2021
/**
2122
* @author Andrea Boriero
@@ -57,6 +58,7 @@ public void testSubselect() {
5758
if ( s.getTransaction().getStatus() == TransactionStatus.ACTIVE ) {
5859
s.getTransaction().rollback();
5960
}
61+
fail( e.getMessage() );
6062
}
6163
finally {
6264
s.close();

hibernate-java8/src/test/java/org/hibernate/test/type/LocalDateTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import static org.hamcrest.core.Is.is;
2525
import static org.junit.Assert.assertThat;
26+
import static org.junit.Assert.fail;
2627

2728
/**
2829
* @author Andrea Boriero
@@ -49,7 +50,7 @@ public void setUp() {
4950
if ( s.getTransaction() != null && s.getTransaction().getStatus() == TransactionStatus.ACTIVE ) {
5051
s.getTransaction().rollback();
5152
}
52-
throw e;
53+
fail( e.getMessage() );
5354
}
5455
finally {
5556
s.close();

hibernate-java8/src/test/java/org/hibernate/test/type/OffsetDateTimeTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import static org.hamcrest.core.Is.is;
2828
import static org.junit.Assert.assertThat;
29+
import static org.junit.Assert.fail;
2930

3031
/**
3132
* @author Andrea Boriero
@@ -144,7 +145,7 @@ private void saveOffsetDateTimeEventWithStartDate(OffsetDateTime startdate) {
144145
if ( s.getTransaction() != null && s.getTransaction().getStatus() == TransactionStatus.ACTIVE ) {
145146
s.getTransaction().rollback();
146147
}
147-
throw e;
148+
fail( e.getMessage() );
148149
}
149150
finally {
150151
s.close();

hibernate-java8/src/test/java/org/hibernate/test/type/ZonedDateTimeTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import static org.hamcrest.core.Is.is;
2727
import static org.junit.Assert.assertThat;
28+
import static org.junit.Assert.fail;
2829

2930
/**
3031
* @author Andrea Boriero
@@ -141,7 +142,7 @@ private void saveZoneDateTimeEventWithStartDate(ZonedDateTime startdate) {
141142
if ( s.getTransaction() != null && s.getTransaction().getStatus() == TransactionStatus.ACTIVE ) {
142143
s.getTransaction().rollback();
143144
}
144-
throw e;
145+
fail( e.getMessage() );
145146
}
146147
finally {
147148
s.close();

0 commit comments

Comments
 (0)