All Downloads are FREE. Search and download functionalities are using the official Maven repository.

retest.datatype.SecureRandomSeedDataType Maven / Gradle / Ivy

Go to download

ReTest is a JUnit extension perform Randomic Test with ease and simplicity. It supports method parameters with Test annotation and much more.

The newest version!
/*
 * ****************************************************************
 *                        André Ivo
 *                   [email protected]
 *           Created on : Jul 29, 2016, 3:04:54 PM
 * ****************************************************************
 */
package retest.datatype;

import java.util.Random;
import retest.utils.SecureRandomSeed;

/**
 *
 * @author andreivo
 */
public class SecureRandomSeedDataType extends DataType {

    @Override
    public SecureRandomSeed deserialize(String value) {
        Long aLong = Long.decode(value);
        SecureRandomSeed rs = new SecureRandomSeed(aLong);
        return rs;
    }

    @Override
    public SecureRandomSeed randomizeParam() {
        Random rseed = new Random(10000);
        SecureRandomSeed r = new SecureRandomSeed(System.currentTimeMillis() - rseed.nextLong());
        return r;
    }

    @Override
    public String serialize(SecureRandomSeed value) {
        return value.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy