de.knipp.rritoolkit.test
Class Test

java.lang.Object
  extended by de.knipp.rritoolkit.test.Test

public class Test
extends java.lang.Object

small test program

Version:
$Revision: 15112 $
Author:
Klaus Malorny

Nested Class Summary
private static interface Test.Command
          small interface to a class that executes commands on a given port
private static class Test.ParallelCommand
          class that executes the given commands in parallel
private static class Test.RepeatCommand
          class that repeats a command a given number of times
private static class Test.SequentialCommand
          class that executes the given commands sequentially
private static class Test.SingleCommand
          class that executes a single command
 
Field Summary
private static java.util.regex.Pattern argPattern
          pattern to split lines
private  java.io.BufferedReader batchReader
          the buffered reader while parsing
private  java.lang.String[] parsedArgs
          the last parsed arguments during parsing
 
Constructor Summary
Test()
           
 
Method Summary
private static ContactData createContactData(java.lang.String... args)
          create a contact data instance from the given arguments
private static DomainData createDomainData(boolean withAuthInfo, java.lang.String... args)
          create a domain data instance from the given arguments
private static DomainData createDomainDataExt(boolean withAuthInfo, java.lang.String... args)
          create a domain data instance from the given arguments
private  void doMain(java.lang.String[] args)
          the main program
private static void execute(Port port, java.lang.String[] args, int offset)
          execute a command
static void main(java.lang.String[] args)
          main program
private  Test.Command parseBatchFile(java.io.BufferedReader reader)
          parse the given batch file
private  Test.Command parseBatchSection(java.lang.String... stopWords)
          parse a section of the batch file
private  java.lang.String[] splitArgs(java.lang.String line)
          split a line into arguments.
private static void testAuthInfo1Create(Port port, java.lang.String... args)
          test method for the creation of an AuthInfo 1
private static void testAuthInfo1Delete(Port port, java.lang.String... args)
          test method for the deletion of the AuthInfo 1
private static void testAuthInfo2Create(Port port, java.lang.String... args)
          test method for the creation of an AuthInfo 2
private static void testContactCheck(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testContactCreate(Port port, java.lang.String[] args)
          test method for the contact create request
private static void testContactInfo(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testContactUpdate(Port port, java.lang.String[] args)
          test method for the contact create request
private static void testDnsKeyUpdate(Port port, java.lang.String... args)
          test method for the change of DNSKEY data
private static void testDomainChangeProv(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testDomainCheck(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testDomainCreate(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testDomainCreateExt(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testDomainDelete(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testDomainInfo(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testDomainMigrateDescr(Port port, java.lang.String[] args)
          test method for the domain check request
private static void testQueueClear(Port port, java.lang.String[] args)
          test method that removes all messages (of the given type if specified)
private static void testQueueDelete(Port port, java.lang.String[] args)
          test method to remove a message from the queue
private static void testQueueRead(Port port, java.lang.String[] args)
          test method for the queue read request
private static void wait(java.lang.String[] args)
          wait for a certain time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

batchReader

private java.io.BufferedReader batchReader
the buffered reader while parsing


parsedArgs

private java.lang.String[] parsedArgs
the last parsed arguments during parsing


argPattern

private static java.util.regex.Pattern argPattern
pattern to split lines

Constructor Detail

Test

public Test()
Method Detail

createContactData

private static ContactData createContactData(java.lang.String... args)
create a contact data instance from the given arguments

Parameters:
args - the arguments
Returns:
the instance or null if the creation failed

testContactCreate

private static void testContactCreate(Port port,
                                      java.lang.String[] args)
                               throws java.lang.Exception
test method for the contact create request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testContactUpdate

private static void testContactUpdate(Port port,
                                      java.lang.String[] args)
                               throws java.lang.Exception
test method for the contact create request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testContactCheck

private static void testContactCheck(Port port,
                                     java.lang.String[] args)
                              throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testContactInfo

private static void testContactInfo(Port port,
                                    java.lang.String[] args)
                             throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testDomainCheck

private static void testDomainCheck(Port port,
                                    java.lang.String[] args)
                             throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testDomainInfo

private static void testDomainInfo(Port port,
                                   java.lang.String[] args)
                            throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

createDomainData

private static DomainData createDomainData(boolean withAuthInfo,
                                           java.lang.String... args)
create a domain data instance from the given arguments

Parameters:
withAuthInfo - whether AuthInfo may be provided
args - the arguments
Returns:
the instance or null if failed for some reason

testDomainCreate

private static void testDomainCreate(Port port,
                                     java.lang.String[] args)
                              throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

createDomainDataExt

private static DomainData createDomainDataExt(boolean withAuthInfo,
                                              java.lang.String... args)
create a domain data instance from the given arguments

Parameters:
withAuthInfo - whether AuthInfo may be provided
args - the arguments
Returns:
the instance or null if failed for some reason

testDomainCreateExt

private static void testDomainCreateExt(Port port,
                                        java.lang.String[] args)
                                 throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testDomainChangeProv

private static void testDomainChangeProv(Port port,
                                         java.lang.String[] args)
                                  throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testDomainDelete

private static void testDomainDelete(Port port,
                                     java.lang.String[] args)
                              throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testDomainMigrateDescr

private static void testDomainMigrateDescr(Port port,
                                           java.lang.String[] args)
                                    throws java.lang.Exception
test method for the domain check request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testQueueRead

private static void testQueueRead(Port port,
                                  java.lang.String[] args)
                           throws java.lang.Exception
test method for the queue read request

Parameters:
port - the port to use
args - additional arguments
Throws:
java.lang.Exception - on any exception

testQueueDelete

private static void testQueueDelete(Port port,
                                    java.lang.String[] args)
                             throws java.lang.Exception
test method to remove a message from the queue

Parameters:
port - the port
args - additional arguments
Throws:
java.lang.Exception - on any exception

testQueueClear

private static void testQueueClear(Port port,
                                   java.lang.String[] args)
                            throws java.lang.Exception
test method that removes all messages (of the given type if specified)

Parameters:
port - the port
args - additional arguments
Throws:
java.lang.Exception - on any exception

testAuthInfo1Create

private static void testAuthInfo1Create(Port port,
                                        java.lang.String... args)
                                 throws java.lang.Exception
test method for the creation of an AuthInfo 1

Parameters:
port - the port
args - the arguments
Throws:
java.lang.Exception - on any exception

testAuthInfo1Delete

private static void testAuthInfo1Delete(Port port,
                                        java.lang.String... args)
                                 throws java.lang.Exception
test method for the deletion of the AuthInfo 1

Parameters:
port - the port
args - the arguments
Throws:
java.lang.Exception - on any exception

testAuthInfo2Create

private static void testAuthInfo2Create(Port port,
                                        java.lang.String... args)
                                 throws java.lang.Exception
test method for the creation of an AuthInfo 2

Parameters:
port - the port
args - the arguments
Throws:
java.lang.Exception - on any exception

testDnsKeyUpdate

private static void testDnsKeyUpdate(Port port,
                                     java.lang.String... args)
                              throws java.lang.Exception
test method for the change of DNSKEY data

Parameters:
port - the port
args - the arguments
Throws:
java.lang.Exception - on any exception

wait

private static void wait(java.lang.String[] args)
                  throws java.lang.Exception
wait for a certain time

Parameters:
args - the arguments
Throws:
java.lang.Exception - on exceptions

execute

private static void execute(Port port,
                            java.lang.String[] args,
                            int offset)
                     throws java.lang.Exception
execute a command

Parameters:
port - the port
args - the arguments
offset - the index to the first argument to use
Throws:
java.lang.Exception - on exceptions

splitArgs

private java.lang.String[] splitArgs(java.lang.String line)
split a line into arguments. Quotes are observed

Parameters:
line - the line
Returns:
the parsed arguments

parseBatchSection

private Test.Command parseBatchSection(java.lang.String... stopWords)
                                throws java.io.IOException
parse a section of the batch file

Parameters:
stopWords - the words to stop parsing
Returns:
the parsed command or null if end of input has been encountered without reading a single command
Throws:
java.io.IOException - on exceptions while reading

parseBatchFile

private Test.Command parseBatchFile(java.io.BufferedReader reader)
                             throws java.io.IOException
parse the given batch file

Parameters:
reader - the reader
Returns:
the command
Throws:
java.io.IOException - on i/o exceptions

doMain

private void doMain(java.lang.String[] args)
the main program

Parameters:
args - the command line arguments

main

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

Parameters:
args - the command line arguments


Copyright © 2005-2011 Knipp Medien und Kommunikation GmbH