Forgot to add version information test previously

This commit is contained in:
Luke Taylor 2011-05-17 23:54:43 +01:00
parent 3e18be1478
commit c758f36629
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
package org.springframework.security.core;
import static org.junit.Assert.assertEquals;
import org.junit.*;
/**
* Checks that the embedded version information is up to date.
*
* @author Luke Taylor
*/
public class SpringSecurityCoreVersionTests {
@Test
public void springVersionIsUpToDate() throws Exception {
// Property is set by the build script
String springVersion = System.getProperty("springVersion");
assertEquals(springVersion, SpringSecurityCoreVersion.MIN_SPRING_VERSION);
}
@Test
public void serialVersionMajorAndMinorVersionMatchBuildVersion() throws Exception {
String version = System.getProperty("springSecurityVersion");
// Strip patch version
String serialVersion = String.valueOf(SpringSecurityCoreVersion.SERIAL_VERSION_UID).substring(0,2);
assertEquals(version.charAt(0), serialVersion.charAt(0));
assertEquals(version.charAt(2), serialVersion.charAt(1));
}
}