StandardWidgetToolkitProvider extends Provider { static boolean isJavaVersion6AndUp(final Version javaVersion) { final int javaMajorVersion = javaVersion.getMajor(); final int javaMinorVersion = javaVersion.getMinor(); return javaMajorVersion > 1 || (javaMajorVersion == 1 && javaMinorVersion >= 6); } protected  StandardWidgetToolkitProvider(); static String getDefaultSwtJarPath(); @Override List<String> checkRequirements(); @Override void augmentProcessParameters(final List<String> command, final List<String> classPath); static final String SWT_RUNTIME_JAR_OVERRIDE; }
@Test public void jreRequirementMet_WithJava678() throws Exception { final Version jre16 = new Version(1, 6, 0, 0, 0); boolean javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre16); assertTrue(javaRequirementMet); final Version jre17 = new Version(1, 7, 45, 0, 0); javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre17); assertTrue(javaRequirementMet); final Version jre18 = new Version(1, 8, 10, 0, 0); javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre18); assertTrue(javaRequirementMet); }
@Test public void jreRequirementMet_WithFutureJavaVersion_9andUp() throws Exception { final Version jre9 = new Version(1, 9, 0, 0, 0); boolean javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre9); assertTrue(javaRequirementMet); final Version jre1_10 = new Version(1, 10, 0, 0, 0); javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre1_10); assertTrue(javaRequirementMet); final Version jre2_0 = new Version(2, 0, 0, 0, 0); javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre2_0); assertTrue(javaRequirementMet); }
@Test public void jreRequirementNotMet_WithJre45_or_imaginaryMajorVersion0() { final Version jre4 = new Version(1, 4, 0, 0, 0); boolean javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre4); assertFalse(javaRequirementMet); final Version jre5 = new Version(1, 5, 0, 0, 0); javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre5); assertFalse(javaRequirementMet); final Version jre0 = new Version(0, 100, 0, 0, 0); javaRequirementMet = StandardWidgetToolkitProvider.isJavaVersion6AndUp(jre0); assertFalse(javaRequirementMet); }