Examples of random()


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

        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        StringBuilder buffer = tr.getBuffer();
        fields[0] = RandomUtil.randomText(r, 15, 20); //title
        fields[1] = RandomUtil.randomText(r, 50, 495); // description
        fields[2] = UserName.getUserName(r.random(1, ScaleFactors.users));
        fields[3] = "e" + id + ".jpg"; // imageurl
        fields[4] = "e" + id + "t.jpg"; // imagethumburl
        fields[5] = "e" + id + "l.pdf"; //literatureurl
        fields[6] = RandomUtil.randomPhone(r, buffer); //phone
        fields[7] = RandomUtil.randomTimeZone(r); // timezone
View Full Code Here

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

        fields[6] = RandomUtil.randomPhone(r, buffer); //phone
        fields[7] = RandomUtil.randomTimeZone(r); // timezone
        DateFormat dateFormat = tr.getDateFormat(); // eventtimestamp
        String eventDate = dateFormat.format(
                    r.makeDateInInterval(BASE_DATE, 0, 540));
        int eventHr = r.random(7, 21);
        String eventMin = EVT_MINUTES[r.random(0, 3)]// eventtimestamp
        fields[8] = String.format("%s %02d:%s:00",
                                            eventDate, eventHr, eventMin);
        fields[9] = eventDate; // eventdate
        fields[10] = RandomUtil.randomText(r, 50, 90); //summary
View Full Code Here

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

        fields[7] = RandomUtil.randomTimeZone(r); // timezone
        DateFormat dateFormat = tr.getDateFormat(); // eventtimestamp
        String eventDate = dateFormat.format(
                    r.makeDateInInterval(BASE_DATE, 0, 540));
        int eventHr = r.random(7, 21);
        String eventMin = EVT_MINUTES[r.random(0, 3)]// eventtimestamp
        fields[8] = String.format("%s %02d:%s:00",
                                            eventDate, eventHr, eventMin);
        fields[9] = eventDate; // eventdate
        fields[10] = RandomUtil.randomText(r, 50, 90); //summary
        createdTimestamp = r.makeDateInInterval( //createdtimestamp
View Full Code Here

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

                                            eventDate, eventHr, eventMin);
        fields[9] = eventDate; // eventdate
        fields[10] = RandomUtil.randomText(r, 50, 90); //summary
        createdTimestamp = r.makeDateInInterval( //createdtimestamp
                BASE_DATE, -540, 0);
        ifields[0] = r.random(1, ScaleFactors.users); // addressId
        // The rest is initialized to 0 anyway, leave it that way.
    }

    public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
View Full Code Here

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

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

        LinkedHashSet<Integer> friendSet = 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> friendSet = 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 || !friendSet.add(friendId));
        }

        friends = new String[friendSet.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 commentCount = r.random(0, 20);
        userNames = new String[commentCount];
        comments = new String[commentCount];
        ratings = new int[commentCount];
        for (int i = 0; i < userNames.length; i++) {
            int userId = r.random(1, ScaleFactors.users);
View Full Code Here

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

        int commentCount = r.random(0, 20);
        userNames = new String[commentCount];
        comments = new String[commentCount];
        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()

        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()

    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
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.