Examples of random()


Examples of com.sun.faban.driver.util.Random.random()

        ratings = new int[commentCount];
        for (int i = 0; i < userNames.length; i++) {
            int userId = r.random(1, ScaleFactors.users);
            userNames[i] = UserName.getUserName(userId);
            comments[i] = r.makeCString(10, 1000);
            ratings[i] = r.random(2, 5);          
        }
    created_at = r.makeDateInInterval( BASE_DATE, -540, 0);

    }
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

        id = getSequence();
        id++;
        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        requestorUsername = UserName.getUserName(id);       
        int count = r.random(2, 10);

        LinkedHashSet<Integer> inviteeSet = new LinkedHashSet<Integer>(count);
        for (int i = 0; i < count; i++) {
            int friendId;
            do { // Prevent friend to be the same user.
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

        LinkedHashSet<Integer> inviteeSet = new LinkedHashSet<Integer>(count);
        for (int i = 0; i < count; i++) {
            int friendId;
            do { // Prevent friend to be the same user.
                friendId = r.random(1, ScaleFactors.users);
            } while (friendId == id || !inviteeSet.add(friendId));
        }

        friends = new String[inviteeSet.size()];
        int idx = 0;
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

    public void prepare() {
        eventId = getSequence();
        ++eventId;
        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        int numTags = r.random(1, 7); // Avg is 4 tags per event
        LinkedHashSet<Integer> tagSet = new LinkedHashSet<Integer>(numTags);
        for (int i = 0; i < numTags; i++)
            while (!tagSet.add(RandomUtil.randomTagId(r, 0.1d)));

        tagIds = new int[tagSet.size()];
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        StringBuilder buffer = tr.getBuffer();
        buffer.append(r.makeNString(1, 5)).append(' '); // number
        RandomUtil.randomName(r, buffer, 1, 11); // street
        String streetExt = STREETEXTS[r.random(0, STREETEXTS.length - 1)];
        if (streetExt.length() > 0)
            buffer.append(' ').append(streetExt);

        fields[0] = buffer.toString();
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

        if (streetExt.length() > 0)
            buffer.append(' ').append(streetExt);

        fields[0] = buffer.toString();

        int toggle = r.random(0, 1); // street2
        if (toggle > 0)
            fields[1] = r.makeCString(5, 20);

        fields[2] = r.makeCString(4, 14); // city
        fields[3] = r.makeCString(2, 2).toUpperCase(); // state
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

        fields[2] = r.makeCString(4, 14); // city
        fields[3] = r.makeCString(2, 2).toUpperCase(); // state
        fields[4] = r.makeNString(5, 5)// zip

        toggle = r.random(0, 1);
        if (toggle == 0) {
            fields[5] = "USA";
        } else {
            buffer.setLength(0);
            fields[5] = RandomUtil.randomName(r, buffer, 6, 16).toString();
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

    public void prepare() {
        eventId = getSequence();
        ++eventId;
        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        int attendees = r.random(10, 100);
        LinkedHashSet<Integer> userIdSet =
                                    new LinkedHashSet<Integer>(attendees);
        for (int i = 0; i <attendees; i++)
            while(!userIdSet.add(r.random(1, ScaleFactors.users)));
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

        Random r = tr.getRandom();
        int attendees = r.random(10, 100);
        LinkedHashSet<Integer> userIdSet =
                                    new LinkedHashSet<Integer>(attendees);
        for (int i = 0; i <attendees; i++)
            while(!userIdSet.add(r.random(1, ScaleFactors.users)));

        userNames = new String[userIdSet.size()];
        int idx = 0;
        for (int userId : userIdSet)
            userNames[idx++] = UserName.getUserName(userId);
View Full Code Here

Examples of com.sun.faban.driver.util.Random.random()

        fields[5] = RandomUtil.randomPhone(r, b);
        fields[6] = "p" + id + ".jpg";
        fields[7] = "p" + id + "t.jpg";
        fields[8] = RandomUtil.randomText(r, 250, 2500);
        fields[9] = "PST";
        addressId = r.random(1, ScaleFactors.users);
    }

    public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.