< prev index next >

test/jdk/java/lang/System/PropertyTest.java

Print this page
rev 52819 : 8214794: java.specification.version should be only the major version number

@@ -229,10 +229,19 @@
 
         Properties props = System.getProperties();
         Assert.assertNotNull(props.getProperty(name), name);
     }
 
+    @Test
+    static void javaSpecVersion() {
+        String specVersion = System.getProperty("java.specification.version");
+        int specVer = Integer.valueOf(specVersion);
+
+        Assert.assertEquals(specVer, Runtime.version().feature(), "java.specification.version " +
+                "does not match runtime version");
+    }
+
     @SuppressWarnings("raw_types")
     @Test(enabled=false)
     public static void main(String[] args) {
         TestListenerAdapter tla = new TestListenerAdapter();
 
< prev index next >