Examples of random()


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

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

        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

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

        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

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

        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

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

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