patterntesting.runtime.util
Class Assertions

Package class diagram package Assertions
java.lang.Object
  extended by patterntesting.runtime.util.Assertions

public class Assertions
extends Object

If you want to know if assertions are enabled (java option "-ea"), you can use this helper class. At runtime you can use the 'jconsole' and look at the java.lang.Runtime MXBean (java.lang.management.RuntimeMXBean). Here you can look at the attribute "InputArguments" if "-ea" is set.

Since:
31.01.2009
Version:
$Revision: 1.5 $
Author:
oliver

Field Summary
static boolean enabled
          The Constant enabled.
 
Method Summary
static boolean areEnabled()
          If you want to know if the JavaVM was started with "Assertion enabled" (option -ea for SunVM) you can use this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

public static final boolean enabled
The Constant enabled.

Method Detail

areEnabled

public static boolean areEnabled()
If you want to know if the JavaVM was started with "Assertion enabled" (option -ea for SunVM) you can use this method.
Or you can ask the RuntimeMXBean for the input arguements and look for the argument "-ea".

Returns:
true, if are enabled
See Also:
RuntimeMXBean.getInputArguments()


Copyright © 2002–2014 PatternTesting Team. All rights reserved.