eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 721 forks source link

Create common test utilities for isJava8, isWindows, etc. #1306

Open pdbain-ibm opened 6 years ago

pdbain-ibm commented 6 years ago

Several tests need to know the platform (usually z/OS or Windows) and the Java version (often Java 8 vs. later). There are multiple implementations of isJava8() already.

Suggest creating a common class in TestUtilities, e.g. org.openj9.test.util.PlatformInfo with (initially) static boolean [isWindows(), isZos(), isJava8()]. The code for these can be lifted from existing sources.

@smlambert @llxia your thoughts?

smlambert commented 6 years ago

I had hoped to leave this as a beginner item for some new contributor to pick up, but I guess its time to move it forward, given #1745.

I'll open a PR shortly.

pdbain-ibm commented 6 years ago

@DanHeidinga would this be a good exercise to get a student up to speed?

smlambert commented 6 years ago

Our students already have a list of items from @tajila, as I mentioned above, I will take this one.

chandrams commented 6 years ago

@smlambert - Any update on this one? I 'm looking specifically for isJava8() to include in one of the functional tests.

DanHeidinga commented 6 years ago

Doesn't https://github.com/eclipse/openj9/blob/f66506e7a528340d176260c3af47c63cf66979ec/test/functional/TestUtilities/src/org/openj9/test/util/VersionCheck.java already provide this info? It has a major() method which returns the major java version - 8, 9, 10 etc

smlambert commented 6 years ago

Yes you already have VersionCheck, so @chandrams can use that for her purpose. This issue is for platform checks (and likely a few other machine capabilities that are commonly requested by tests).

pdbain-ibm commented 6 years ago

We need isMacOS() (or equivalent - suggestions for a better name are welcome) for https://github.com/eclipse/openj9/issues/3266.