Package com.sun.faban.driver.util

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


    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

        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

        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

        fields[2] = RandomUtil.randomPhone(r, buffer); //phone
        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[3] = String.format("%s %02d:%s:00",
                                            eventDate, eventHr, eventMin);
        fields[4] = eventDate; // eventdate
        fields[5] = RandomUtil.randomText(r, 500, 1024); // summary
View Full Code Here

        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[3] = String.format("%s %02d:%s:00",
                                            eventDate, eventHr, eventMin);
        fields[4] = eventDate; // eventdate
        fields[5] = RandomUtil.randomText(r, 500, 1024); // summary
       
View Full Code Here

        fields[5] = RandomUtil.randomText(r, 500, 1024); // summary
       
        createdTimestamp = r.makeDateInInterval( //createdtimestamp
                BASE_DATE, -540, 0);
       
        ifields[0] = r.random(1, ScaleFactors.users);
        ifields[1] = 0;
        ifields[2] = 0;
        ifields[3] = 1;
        ifields[4] = r.random(1, ScaleFactors.users);
        ifields[5] = id;
View Full Code Here

       
        ifields[0] = r.random(1, ScaleFactors.users);
        ifields[1] = 0;
        ifields[2] = 0;
        ifields[3] = 1;
        ifields[4] = r.random(1, ScaleFactors.users);
        ifields[5] = id;
        ifields[6] = id;

        // The rest is initialized to 0 anyway, leave it that way.
    }
View Full Code Here

    public void prepare() {
    id = getSequence() + 1;
        ThreadResource tr = ThreadResource.getInstance();
        Random r = tr.getRandom();
        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

        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 int[friendSet.size()];
        int idx = 0;
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.