当前位置: 首页>>代码示例>>Java>>正文


Java JdkVersion.JAVA_15属性代码示例

本文整理汇总了Java中org.springframework.core.JdkVersion.JAVA_15属性的典型用法代码示例。如果您正苦于以下问题:Java JdkVersion.JAVA_15属性的具体用法?Java JdkVersion.JAVA_15怎么用?Java JdkVersion.JAVA_15使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.springframework.core.JdkVersion的用法示例。


在下文中一共展示了JdkVersion.JAVA_15属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: assertHtmlOutput

private void assertHtmlOutput(String output) throws Exception {
	if (JdkVersion.getMajorJavaVersion() < JdkVersion.JAVA_15) {
		// TODO: find out why the SAXReader.read call fails on JDK 1.4 and 1.3
		return;
	}

	SAXReader reader = new SAXReader();
	Document document = reader.read(new StringReader(output));
	List nodes = document.getRootElement().selectNodes("/html/body/table/tr");

	Element tr1 = (Element) nodes.get(0);
	assertRowElement(tr1, "1", "Whatsit", "12.99");
	Element tr2 = (Element) nodes.get(1);
	assertRowElement(tr2, "2", "Thingy", "13.99");
	Element tr3 = (Element) nodes.get(2);
	assertRowElement(tr3, "3", "Gizmo", "14.99");
	Element tr4 = (Element) nodes.get(3);
	assertRowElement(tr4, "4", "Cranktoggle", "11.99");
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:19,代码来源:XsltViewTests.java

示例2: testLocatePlatformMBeanServer

public void testLocatePlatformMBeanServer() {
	if(JdkVersion.getMajorJavaVersion() < JdkVersion.JAVA_15) {
		return;
	}

	MBeanServer server = null;
	try {
		server = JmxUtils.locateMBeanServer();
	}
	finally {
		if (server != null) {
			MBeanServerFactory.releaseMBeanServer(server);
		}
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:15,代码来源:JmxUtilsTests.java

示例3: testParseLocalizedBigDecimalNumber1

public void testParseLocalizedBigDecimalNumber1() {
	if (JdkVersion.getMajorJavaVersion() < JdkVersion.JAVA_15) {
		return;
	}
	String bigDecimalAsString = "0.10";
	NumberFormat numberFormat = NumberFormat.getInstance(Locale.ENGLISH);
	Number bigDecimal = NumberUtils.parseNumber(bigDecimalAsString, BigDecimal.class, numberFormat);
	assertEquals(new BigDecimal(bigDecimalAsString), bigDecimal);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:9,代码来源:NumberUtilsTests.java

示例4: testParseLocalizedBigDecimalNumber2

public void testParseLocalizedBigDecimalNumber2() {
	if (JdkVersion.getMajorJavaVersion() < JdkVersion.JAVA_15) {
		return;
	}
	String bigDecimalAsString = "0.001";
	NumberFormat numberFormat = NumberFormat.getInstance(Locale.ENGLISH);
	Number bigDecimal = NumberUtils.parseNumber(bigDecimalAsString, BigDecimal.class, numberFormat);
	assertEquals(new BigDecimal(bigDecimalAsString), bigDecimal);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:9,代码来源:NumberUtilsTests.java

示例5: testParseLocalizedBigDecimalNumber3

public void testParseLocalizedBigDecimalNumber3() {
	if (JdkVersion.getMajorJavaVersion() < JdkVersion.JAVA_15) {
		return;
	}
	String bigDecimalAsString = "3.14159265358979323846";
	NumberFormat numberFormat = NumberFormat.getInstance(Locale.ENGLISH);
	Number bigDecimal = NumberUtils.parseNumber(bigDecimalAsString, BigDecimal.class, numberFormat);
	assertEquals(new BigDecimal(bigDecimalAsString), bigDecimal);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:9,代码来源:NumberUtilsTests.java

示例6: setAsText

@Override
public void setAsText(String text) throws IllegalArgumentException {
	if (JdkVersion.getMajorJavaVersion() >= JdkVersion.JAVA_15) {
		Assert.isTrue(this.target instanceof ValueBean, "Target must be available on JDK 1.5+");
	}
	super.setAsText(text);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:7,代码来源:BeanInfoTests.java

示例7: getTestFrameworkBundlesNames

protected String[] getTestFrameworkBundlesNames() {
	String[] def = super.getTestFrameworkBundlesNames();
	List col = new ArrayList();
	CollectionUtils.mergeArrayIntoCollection(def, col);

	System.setProperty("DEBUG", "false");
	// set this property (to whatever value) to get logging in Jetty
	//System.setProperty("VERBOSE", "false");

	// Servlet/JSP artifacts
	col.add("javax.servlet, com.springsource.javax.servlet, 2.4.0");
	col.add("org.springframework.osgi, jsp-api.osgi, 2.0-SNAPSHOT");

	// JSP compiler
	col.add("org.springframework.osgi, jasper.osgi, 5.5.23-SNAPSHOT");
	col.add("org.springframework.osgi, commons-el.osgi, 1.0-SNAPSHOT");

	// standard tag library
	col.add("org.springframework.osgi, jstl.osgi, 1.1.2-SNAPSHOT");

	// add MX4J for 1.4
	// if < jdk 1.5, add an JMX implementation
	if (!(JdkVersion.getMajorJavaVersion()>=JdkVersion.JAVA_15))
		col.add("net.sourceforge.mx4j, com.springsource.mx4j, 3.0.2");

	col.add("org.springframework.osgi, catalina.osgi, 5.5.23-SNAPSHOT");
	col.add("org.springframework.osgi, catalina.start.osgi, 1.0.0");

	// jetty starter
	//		col.add("org.springframework.osgi, jetty.start.osgi, 1.0.0");
	//		col.add("org.springframework.osgi, jetty.web.extender.fragment.osgi, 1.0.0");
	//		col.add("org.mortbay.jetty, jetty-util, 6.1.9");
	//		col.add("org.mortbay.jetty, jetty, 6.1.9");

	// Spring DM web extender
	col.add("org.springframework.osgi, spring-osgi-web," + getSpringDMVersion());
	col.add("org.springframework.osgi, spring-osgi-web-extender," + getSpringDMVersion());
	col.add("net.sourceforge.cglib, com.springsource.net.sf.cglib, 2.1.3");

	return (String[]) col.toArray(new String[col.size()]);
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:41,代码来源:BaseWebIntegrationTest.java

示例8: addDefaultDependencyFactories

private void addDefaultDependencyFactories() {
	boolean debug = log.isDebugEnabled();

	// default JDK 1.4 processor
	dependencyFactories.add(0, new MandatoryImporterDependencyFactory());

	// load through reflection the dependency and injection processors if running on JDK 1.5 and annotation processing is enabled
	if (processAnnotation) {
		if (JdkVersion.getMajorJavaVersion()>=JdkVersion.JAVA_15) {
			// dependency processor
			Class annotationProcessor = null;
			try {
				annotationProcessor = Class.forName(ANNOTATION_DEPENDENCY_FACTORY, false,
					ExtenderConfiguration.class.getClassLoader());
			}
			catch (ClassNotFoundException cnfe) {
				log.warn("Spring DM annotation package not found, annotation processing disabled.", cnfe);
				return;
			}
			Object processor = BeanUtils.instantiateClass(annotationProcessor);
			Assert.isInstanceOf(OsgiServiceDependencyFactory.class, processor);
			dependencyFactories.add(1, (OsgiServiceDependencyFactory) processor);

			if (debug)
				log.debug("Succesfully loaded annotation dependency processor [" + ANNOTATION_DEPENDENCY_FACTORY
						+ "]");

			// add injection processor (first in line)
			postProcessors.add(0, new OsgiAnnotationPostProcessor());
			log.info("Spring-DM annotation processing enabled");
		}
		else {
			if (debug)
				log.debug("JDK 5 not available [" + ANNOTATION_DEPENDENCY_FACTORY + "] not loaded");
			log.warn("Spring-DM annotation processing enabled but JDK 5 is n/a; disabling annotation processing...");
		}
	}
	else {
		if (debug) {
			log.debug("Spring-DM annotation processing disabled; [" + ANNOTATION_DEPENDENCY_FACTORY
					+ "] not loaded");
		}
	}

}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:45,代码来源:ExtenderConfiguration.java

示例9: getTestFrameworkBundlesNames

/**
 * Returns the bundles that have to be installed as part of the test setup.
 * This method is preferred as the bundles are by their names rather then as
 * {@link Resource}s. It allows for a <em>declarative</em> approach for
 * specifying bundles as opposed to {@link #getTestBundles()} which provides
 * a programmatic one.
 * 
 * <p/>This implementation reads a predefined properties file to determine
 * the bundles needed. If the configuration needs to be changed, consider
 * changing the configuration location.
 * 
 * @return an array of testing framework bundle identifiers
 * @see #getTestingFrameworkBundlesConfiguration()
 * @see #locateBundle(String)
 * 
 */
protected String[] getTestFrameworkBundlesNames() {
	// load properties file
	Properties props = PropertiesUtil.loadAndExpand(getTestingFrameworkBundlesConfiguration());

	if (props == null)
		throw new IllegalArgumentException("cannot load default configuration from "
				+ getTestingFrameworkBundlesConfiguration());

	boolean trace = logger.isTraceEnabled();

	if (trace)
		logger.trace("Loaded properties " + props);

	// pass properties to test instance running inside OSGi space
	System.getProperties().put(SPRING_OSGI_VERSION_PROP_KEY, props.get(SPRING_OSGI_VERSION_PROP_KEY));
	System.getProperties().put(SPRING_VERSION_PROP_KEY, props.get(SPRING_VERSION_PROP_KEY));

	Properties excluded = PropertiesUtil.filterKeysStartingWith(props, IGNORE);

	if (trace) {
		logger.trace("Excluded ignored properties " + excluded);
	}

	// filter bundles which are Tiger/JDK 1.5 specific
	String sign = null;
	if (JdkVersion.getMajorJavaVersion()>=JdkVersion.JAVA_15) {
		sign = "-15";
	}
	else {
		sign = "+15";
	}

	excluded = PropertiesUtil.filterValuesStartingWith(props, sign);
	if (trace)
		logger.trace("JDK " + JdkVersion.getJavaVersion() + " excluded bundles " + excluded);

	String[] bundles = (String[]) props.keySet().toArray(new String[props.size()]);
	// sort the array (as the Properties file doesn't respect the order)
	bundles = StringUtils.sortStringArray(bundles);

	if (logger.isDebugEnabled())
		logger.debug("Default framework bundles :" + ObjectUtils.nullSafeToString(bundles));

	return bundles;
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:61,代码来源:AbstractDependencyManagerTests.java

示例10: getTestBundlesNames

/**
 * The location of the packaged OSGi bundles to be installed
 * for this test. Values are Spring resource paths. The bundles
 * we want to use are part of the same multi-project maven
 * build as this project is. Hence we use the localMavenArtifact
 * helper method to find the bundles produced by the package
 * phase of the maven build (these tests will run after the
 * packaging phase, in the integration-test phase).
 * <p/>
 * JUnit, commons-logging, spring-core and the spring OSGi
 * test bundle are automatically included so do not need
 * to be specified here.
 */
protected String[] getTestBundlesNames() {
	List bundles = new ArrayList();
	bundles.add("org.springframework, org.springframework.context,"+ getSpringVersion());
	bundles.add("org.springframework.osgi.samples, weather-extension,"+ getSpringDMVersion());
	bundles.add("org.springframework.osgi.samples, wiring-bundle," +getSpringDMVersion());
	
	// if < jdk 1.5, add an JMX implementation
	if (!(JdkVersion.getMajorJavaVersion()>=JdkVersion.JAVA_15))
		bundles.add("net.sourceforge.mx4j, com.springsource.mx4j, 3.0.2");
	return (String[]) bundles.toArray(new String[bundles.size()]);
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:24,代码来源:WeatherServiceBundleTest.java

示例11: concurrentLibAvailable

/**
 * Check the present of appropriate concurrent collection in the classpath.
 * This means backport-concurrent on Java 1.4, or Java5+.
 * 
 * @return true if a ConcurrentHashMap is available on the classpath.
 */
public static boolean concurrentLibAvailable() {
	return (backportConcurrentAvailable || JdkVersion.getMajorJavaVersion() >= JdkVersion.JAVA_15);
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:9,代码来源:ClassUtils.java


注:本文中的org.springframework.core.JdkVersion.JAVA_15属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。