ValueServer { public double getNext() throws IOException, MathIllegalStateException, MathIllegalArgumentException { switch (mode) { case DIGEST_MODE: return getNextDigest(); case REPLAY_MODE: return getNextReplay(); case UNIFORM_MODE: return getNextUniform(); case EXPONENTIAL_MODE: return getNextExponential(); case GAUSSIAN_MODE: return getNextGaussian(); case CONSTANT_MODE: return mu; default: throw new MathIllegalStateException( LocalizedFormats.UNKNOWN_MODE, mode, "DIGEST_MODE", DIGEST_MODE, "REPLAY_MODE", REPLAY_MODE, "UNIFORM_MODE", UNIFORM_MODE, "EXPONENTIAL_MODE", EXPONENTIAL_MODE, "GAUSSIAN_MODE", GAUSSIAN_MODE, "CONSTANT_MODE", CONSTANT_MODE); } } ValueServer(); @Deprecated  ValueServer(RandomDataImpl randomData);  ValueServer(RandomGenerator generator); double getNext(); void fill(double[] values); double[] fill(int length); void computeDistribution(); void computeDistribution(int binCount); int getMode(); void setMode(int mode); URL getValuesFileURL(); void setValuesFileURL(String url); void setValuesFileURL(URL url); EmpiricalDistribution getEmpiricalDistribution(); void resetReplayFile(); void closeReplayFile(); double getMu(); void setMu(double mu); double getSigma(); void setSigma(double sigma); void reSeed(long seed); static final int DIGEST_MODE; static final int REPLAY_MODE; static final int UNIFORM_MODE; static final int EXPONENTIAL_MODE; static final int GAUSSIAN_MODE; static final int CONSTANT_MODE; }
@Test public void testNextDigestFail() throws Exception { try { vs.getNext(); Assert.fail("Expecting IllegalStateException"); } catch (IllegalStateException ex) {} }