Example usage for org.apache.commons.lang SystemUtils JAVA_VM_NAME

List of usage examples for org.apache.commons.lang SystemUtils JAVA_VM_NAME

Introduction

In this page you can find the example usage for org.apache.commons.lang SystemUtils JAVA_VM_NAME.

Prototype

String JAVA_VM_NAME

To view the source code for org.apache.commons.lang SystemUtils JAVA_VM_NAME.

Click Source Link

Document

The java.vm.name System Property.

Usage

From source file:com.cloudera.cdk.morphline.solr.EnvironmentTest.java

@Test
public void testEnvironment() throws UnknownHostException {
    System.out.println("EXPECTED_SOLR_VERSION: " + EXPECTED_SOLR_VERSION);

    System.out.println("Running test suite with java version: " + SystemUtils.JAVA_VERSION + " "
            + SystemUtils.JAVA_VM_NAME + " on " + SystemUtils.OS_NAME + " " + SystemUtils.OS_VERSION + "/"
            + SystemUtils.OS_ARCH + " on host: " + InetAddress.getLocalHost().getHostName());

    Package p = SolrCore.class.getPackage();
    System.out.println("Running test suite with solr-spec-version: " + p.getSpecificationVersion()
            + ", solr-impl-version: " + p.getImplementationVersion());
    if (EXPECTED_SOLR_VERSION != null) {
        assertTrue("unexpected version: " + p.getSpecificationVersion(),
                p.getSpecificationVersion().startsWith(EXPECTED_SOLR_VERSION));
        assertTrue("unexpected version: " + p.getImplementationVersion(),
                p.getImplementationVersion().startsWith(EXPECTED_SOLR_VERSION));
    }// w  w w.j a v  a  2s. c o  m

    p = LucenePackage.class.getPackage();
    System.out.println("Running test suite with lucene-spec-version: " + p.getSpecificationVersion()
            + ", lucene-impl-version: " + p.getImplementationVersion());
    if (EXPECTED_SOLR_VERSION != null) {
        assertTrue("unexpected version: " + p.getSpecificationVersion(),
                p.getSpecificationVersion().startsWith(EXPECTED_SOLR_VERSION));
        assertTrue("unexpected version: " + p.getImplementationVersion(),
                p.getImplementationVersion().startsWith(EXPECTED_SOLR_VERSION));

        Version expectedMinorLuceneVersion = getMinorLuceneVersion(EXPECTED_SOLR_VERSION);
        System.out.println("expectedMinorLuceneVersion: " + expectedMinorLuceneVersion);
        assertTrue(Version.LUCENE_CURRENT.onOrAfter(expectedMinorLuceneVersion));
    }
}