diff --git a/build.gradle b/build.gradle index 540694d2ee..5e996570c4 100644 --- a/build.gradle +++ b/build.gradle @@ -32,8 +32,14 @@ configure(allprojects) { group = "org.springframework" - sourceCompatibility=1.5 - targetCompatibility=1.5 + compileJava { + sourceCompatibility=1.5 + targetCompatibility=1.5 + } + compileTestJava { + sourceCompatibility=1.7 + targetCompatibility=1.7 + } [compileJava, compileTestJava]*.options*.compilerArgs = [ "-Xlint:serial", @@ -333,6 +339,14 @@ project("spring-tx") { project("spring-oxm") { description = "Spring Object/XML Marshalling" apply from: "oxm.gradle" + + compileTestJava { + // necessary to avoid java.lang.VerifyError on jibx compilation + // see http://jira.codehaus.org/browse/JIBX-465 + sourceCompatibility=1.6 + targetCompatibility=1.6 + } + dependencies { compile(project(":spring-beans")) compile(project(":spring-core")) @@ -458,6 +472,14 @@ project("spring-web") { project("spring-orm") { description = "Spring Object/Relational Mapping" + + compileTestJava { + // necessary to avoid java.lang.VerifyError on toplink compilation + // TODO: remove this block when we remove toplink + sourceCompatibility=1.6 + targetCompatibility=1.6 + } + dependencies { compile("aopalliance:aopalliance:1.0") optional("org.hibernate:hibernate-core:3.3.2.GA") diff --git a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java index 4c5387aaa3..367b4aa5c1 100644 --- a/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java +++ b/spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,8 @@ import org.springframework.oxm.AbstractUnmarshallerTests; import org.springframework.oxm.MarshallingException; import org.springframework.oxm.Unmarshaller; +import static org.hamcrest.CoreMatchers.*; + import static org.junit.Assert.*; /** @@ -66,7 +68,7 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests { protected void testFlight(Object o) { Flight flight = (Flight) o; assertNotNull("Flight is null", flight); - assertEquals("Number is invalid", 42L, flight.getNumber()); + assertThat("Number is invalid", flight.getNumber(), equalTo(42L)); } @Override @@ -104,10 +106,10 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests { assertEquals("Invalid amount of items", 2, order.getOrderItemCount()); OrderItem item = order.getOrderItem(0); assertEquals("Invalid items", "1", item.getId()); - assertEquals("Invalid items", 15, item.getQuantity()); + assertThat("Invalid items", item.getQuantity(), equalTo(15)); item = order.getOrderItem(1); assertEquals("Invalid items", "3", item.getId()); - assertEquals("Invalid items", 20, item.getQuantity()); + assertThat("Invalid items", item.getQuantity(), equalTo(20)); } @Test