-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added key to fetch os.name from HostVM and created test to check in J…
…PF enviornment
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package gov.nasa.jpf.test.java.misc; | ||
|
||
import gov.nasa.jpf.util.test.TestJPF; | ||
import jdk.internal.misc.VM; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Simple test to verify properties are loaded correctly to VM | ||
*/ | ||
public class VMTest extends TestJPF { | ||
|
||
/** | ||
* Test to verify all the properties of System is loaded to VM | ||
*/ | ||
@Test | ||
public void getSavedPropertiesTest(){ | ||
if(verifyNoPropertyViolation()){ | ||
assertEquals(System.getProperties().size(),VM.getSavedProperties().size()); | ||
} | ||
} | ||
|
||
/** | ||
* Test to verify property "os.name" is loaded in VM | ||
*/ | ||
@Test | ||
public void getSavedPropertyTest(){ | ||
if(verifyNoPropertyViolation()){ | ||
assertNotNull(VM.getSavedProperty("os.name")); | ||
} | ||
} | ||
} |