In one of my JUnit test, I'm initializing an object:
MyObject myObject = new MyObject(220, 120, 0.05, true);
public MyObject(int minLength, int maxLength,
double onBitsRatio, boolean forceAtLeastOneBitOn)
assert(onBitsRatio >= 0.0 && onBitsRatio <= 1.0);
JUnit is not ignoring these assertions, because as you say, you are using Java's
assert keyword. This is handled by the JVM, not JUnit.
The answer is almost certainly that your JVM assertions are turned off. In fact they are off unless you turn them on with
-ea. These are ignored otherwise.