Code example for SecureRandom

Methods: generateSeed

0
     * test against the "void generateSeed(int)" method; 
     * it checks out that the method throws NegativeArraySizeException if argument <0 
     */ 
    public final void testGenerateSeedint01() { 
        try { 
            sr.generateSeed(-1);
            fail("generateSeed(-1) :: No NegativeArraySizeException");
        } catch (NegativeArraySizeException e) {
        } 
    } 
 
 
    /** 
     * test against the "void generateSeed(int)" method; 
     * it checks out that number of bits returned is equal to one requested; 
     * the check includes case for argument's value == 0; 
     */ 
    public final void testGenerateSeedint02() { 
 
        for ( int i = 0; i < LENGTH; i++ ) {