com.vgrs.xcode.cmdline.common
Class RandomDataCmdLine

java.lang.Object
  extended by com.vgrs.xcode.cmdline.common.RandomDataCmdLine

public class RandomDataCmdLine
extends java.lang.Object

Randomly spit out test data in various encoding type.

See Also:
Random

Field Summary
static int DEFAULT_LINES
           
static char[] DELIMITERS
           
static char FULLSTOP
           
static int MAX_DOMAIN_LEN
           
static int MAX_LABEL_LEN
           
static int MAX_LABELS
           
static int MIN_LABEL_LEN
           
static int MIN_LABELS
           
static double PERCENT_BMP
           
static java.util.Random RAND
           
static char[] SC
           
static char[] TC
           
 
Constructor Summary
RandomDataCmdLine()
           
 
Method Summary
static java.lang.String getRandomAceDomain(java.lang.String aPrefix)
          Randomly generates test ACE domains
static java.lang.String getRandomAceLabel(java.lang.String aPrefix)
          Randomly generates test ACE label
static char getRandomAscii()
          Randomly generates test ASCII character.
static char getRandomDelimiter()
           
static int getRandomInteger()
          Returns a random integer by calling getRandomInteger(Integer.MAX_VALUE)
static int getRandomInteger(int aMax)
           
static int getRandomInteger(int aMin, int aMax)
           
static java.lang.String getRandomNativeDomain(java.lang.String aEncoding)
          Randomly generates test domains in Native encoding type
static java.lang.String getRandomNativeLabel(java.lang.String aEncoding)
           
static char getRandomNone()
          Randomly generates lable with value equals to OxE000 + the next pseudorandom generated by Random object
static int[] getRandomRangedDomain(int aStart, int aEnd)
          Randomly generates ranged test domains
static int[] getRandomRangedLabel(int aStart, int aEnd)
          Randomly generates ranged test lables
static char getRandomSC()
          Randomly generates test Simplified Chinese character
static char getRandomTC()
          Randomly generates test Tradictional Chinese character
static java.lang.String getRandomTCSCDomain()
          Randomly generates TC/SC test domains
static java.lang.String getRandomTCSCLabel()
          Randomly generates TC/SC test lables
static int[] getRandomUnicodeDomain()
          Randomly generates test Unicode domains
static int[] getRandomUnicodeLabel()
          Randomly generates test Unicode labels
static java.lang.String getRandomUtf16Domain()
          Randomly generates test Utf16 domains
static java.lang.String getRandomUtf16Label()
          Randomly generates test Utf16 labels
static void main(java.lang.String[] aArgs)
           
static void printRandomAceLines(java.lang.String aPrefix, boolean aLabels, int aLines)
          Randomly generates ACE test data
static void printRandomNativeLines(boolean aLabels, int aLines, java.lang.String aEncoding)
          Randomly generates test data in Native encoding type
static void printRandomRangedLines(boolean aLabels, int aLines, int aStart, int aEnd)
          Randomly generates ranged test data
static void printRandomTCSCLines(boolean aLabels, int aLines)
          Randomly generates TC/SC test data
static void printRandomUnicodeLines(boolean aLabels, int aLines)
          Randomly generates Unicode test data
static void printRandomUtf16Lines(boolean labels, int lines)
          Randomly generates Utf16 test data
static void usage()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RAND

public static final java.util.Random RAND

MIN_LABELS

public static final int MIN_LABELS
See Also:
Constant Field Values

MAX_LABELS

public static final int MAX_LABELS
See Also:
Constant Field Values

MIN_LABEL_LEN

public static final int MIN_LABEL_LEN
See Also:
Constant Field Values

MAX_LABEL_LEN

public static final int MAX_LABEL_LEN
See Also:
Constant Field Values

MAX_DOMAIN_LEN

public static final int MAX_DOMAIN_LEN
See Also:
Constant Field Values

DELIMITERS

public static final char[] DELIMITERS

FULLSTOP

public static final char FULLSTOP
See Also:
Constant Field Values

DEFAULT_LINES

public static final int DEFAULT_LINES
See Also:
Constant Field Values

PERCENT_BMP

public static final double PERCENT_BMP
See Also:
Constant Field Values

TC

public static char[] TC

SC

public static char[] SC
Constructor Detail

RandomDataCmdLine

public RandomDataCmdLine()
Method Detail

getRandomInteger

public static int getRandomInteger(int aMin,
                                   int aMax)

getRandomInteger

public static int getRandomInteger(int aMax)

getRandomInteger

public static int getRandomInteger()
Returns a random integer by calling getRandomInteger(Integer.MAX_VALUE)

Returns:
a random integer

getRandomDelimiter

public static char getRandomDelimiter()

usage

public static void usage()

main

public static void main(java.lang.String[] aArgs)

printRandomRangedLines

public static void printRandomRangedLines(boolean aLabels,
                                          int aLines,
                                          int aStart,
                                          int aEnd)
Randomly generates ranged test data

Parameters:
aLabels - if true, generate multiple labels
aLines - indicates number of test records to generate

getRandomRangedDomain

public static int[] getRandomRangedDomain(int aStart,
                                          int aEnd)
Randomly generates ranged test domains


getRandomRangedLabel

public static int[] getRandomRangedLabel(int aStart,
                                         int aEnd)
Randomly generates ranged test lables


printRandomTCSCLines

public static void printRandomTCSCLines(boolean aLabels,
                                        int aLines)
Randomly generates TC/SC test data

Parameters:
aLabels - if true, generate TCSC domain, otherwise, generate TCSC labels.
aLines - indicates number of test domain/labels to be generated

getRandomTCSCDomain

public static java.lang.String getRandomTCSCDomain()
Randomly generates TC/SC test domains


getRandomTCSCLabel

public static java.lang.String getRandomTCSCLabel()
Randomly generates TC/SC test lables


getRandomNone

public static char getRandomNone()
Randomly generates lable with value equals to OxE000 + the next pseudorandom generated by Random object

Returns:
char the test label

getRandomTC

public static char getRandomTC()
Randomly generates test Tradictional Chinese character

Returns:
char the test TC character

getRandomSC

public static char getRandomSC()
Randomly generates test Simplified Chinese character

Returns:
char the test SC character

getRandomAscii

public static char getRandomAscii()
Randomly generates test ASCII character.

Returns:
char the test ASCII character

printRandomNativeLines

public static void printRandomNativeLines(boolean aLabels,
                                          int aLines,
                                          java.lang.String aEncoding)
Randomly generates test data in Native encoding type

Parameters:
aLabels - if true, generate test domain, otherwise, generate test labels.
aLines - indicates number of test domain/labels to be generated

getRandomNativeDomain

public static java.lang.String getRandomNativeDomain(java.lang.String aEncoding)
                                              throws XcodeException
Randomly generates test domains in Native encoding type

Returns:
String the test domains
Throws:
XcodeException

getRandomNativeLabel

public static java.lang.String getRandomNativeLabel(java.lang.String aEncoding)
                                             throws XcodeException
Throws:
XcodeException

printRandomUtf16Lines

public static void printRandomUtf16Lines(boolean labels,
                                         int lines)
Randomly generates Utf16 test data

Parameters:
labels - if true, generate Utf16 domain, otherwise, generate Utf16 labels.
lines - indicates number of test domain/labels to be generated

getRandomUtf16Domain

public static java.lang.String getRandomUtf16Domain()
Randomly generates test Utf16 domains

Returns:
String the test domains

getRandomUtf16Label

public static java.lang.String getRandomUtf16Label()
Randomly generates test Utf16 labels

Returns:
String the test labels

printRandomUnicodeLines

public static void printRandomUnicodeLines(boolean aLabels,
                                           int aLines)
Randomly generates Unicode test data

Parameters:
aLabels - if true, generate Unicode domain, otherwise, generate Unicode labels.
aLines - indicates number of test domain/labels to be generated

getRandomUnicodeDomain

public static int[] getRandomUnicodeDomain()
Randomly generates test Unicode domains

Returns:
int array the test domains

getRandomUnicodeLabel

public static int[] getRandomUnicodeLabel()
Randomly generates test Unicode labels

Returns:
int array the test labels

printRandomAceLines

public static void printRandomAceLines(java.lang.String aPrefix,
                                       boolean aLabels,
                                       int aLines)
Randomly generates ACE test data

Parameters:
aPrefix - the prefix of the ACE test domain, i.e., bq-- for RACE, xn-- for PunyCode.
aLabels - if true, generate test domain, otherwise, generate test labels.
aLines - indicates number of test domain/labels to be generated

getRandomAceDomain

public static java.lang.String getRandomAceDomain(java.lang.String aPrefix)
Randomly generates test ACE domains

Parameters:
aPrefix - the prefix of the ACE test domain, i.e., bq-- for RACE, xn-- for PunyCode.
Returns:
String the test domain

getRandomAceLabel

public static java.lang.String getRandomAceLabel(java.lang.String aPrefix)
Randomly generates test ACE label

Parameters:
aPrefix - the prefix of the ACE test domain, i.e., bq-- for RACE, xn-- for PunyCode.
Returns:
String the test label


Copyright © 2000-2010 VeriSign Inc. All Rights Reserved