taxisrus.tests.accept_test1
Class Generator

java.lang.Object
  |
  +--taxisrus.tests.accept_test1.Generator

public class Generator
extends Object

This class generates random strings of testdata. The data consist of name, address, phonenumber, creditcard number, etc. For a random time, use randTime(). For a time that 75% of the time is within 15 minutes of the current time, use genTime().

Author:
segFault

Constructor Summary
Generator()
          Setup a list of default street types
 
Method Summary
 String genHour(double randnum)
          Generate an hour.
 String genMinute(double randnum)
          Generate a minute.
 String genTime()
          Generate a time that is 75% of the time is within 15 minutes of the current time
 int getCurHour()
          Return the hour of the current time
 int getCurMinute()
          Return the minute of the current time
 String randAddress()
          Generate a random address
 String randCreditNumber()
          Generate a random creditcard number
 String randDigit(int length)
          Generate a random number of a certain length
 String randHour()
          Generate a random hour
 String randLetter()
          Generate a random letter
 String randMinute()
          Generate a random minute
 String randPhoneNumber()
          Generate a random phone number
 String randTime()
          Generate a random time
 String randValid()
          Generate a random validness of a creditcard number
 String randWord(int length)
          Generate a random word of a certain length
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Generator

public Generator()
Setup a list of default street types
Method Detail

randCreditNumber

public String randCreditNumber()
Generate a random creditcard number

randValid

public String randValid()
Generate a random validness of a creditcard number

randAddress

public String randAddress()
Generate a random address

randDigit

public String randDigit(int length)
Generate a random number of a certain length
Parameters:
length -  

randPhoneNumber

public String randPhoneNumber()
Generate a random phone number

randWord

public String randWord(int length)
Generate a random word of a certain length
Parameters:
length -  

randLetter

public String randLetter()
Generate a random letter

randTime

public String randTime()
Generate a random time

randHour

public String randHour()
Generate a random hour

randMinute

public String randMinute()
Generate a random minute

getCurMinute

public int getCurMinute()
Return the minute of the current time

getCurHour

public int getCurHour()
Return the hour of the current time

genMinute

public String genMinute(double randnum)
Generate a minute. 75% chance of returning a minute within 15 minutes of the current time's minute 25% chance of returning a random minute To simulate the higher likelihood of a cab being haled or being dispatched within the next quarter hour.
Parameters:
random - number

genHour

public String genHour(double randnum)
Generate an hour. 75% chance of returning the current hour 25% chance of returning a random hour To simulate the higher likelihood of a cab being haled or being dispatched within the same hour.
Parameters:
random - number

genTime

public String genTime()
Generate a time that is 75% of the time is within 15 minutes of the current time


API documentation for build 958