org.basex.test
Class GetOptTest

java.lang.Object
  extended by org.basex.test.GetOptTest

public final class GetOptTest
extends java.lang.Object

GetOpt Test class.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Hannes Schwarz

Constructor Summary
GetOptTest()
          Constructor.
 
Method Summary
 int[] optionHelp(java.lang.String command, int length, java.lang.String args)
          Performs a getopt command and returns the arguments returned by getopt.
 void testAll1()
          Test of GetOpt.
 void testAll2()
          Test of GetOpt.
 void testAll3()
          Test of GetOpt.
 void testOption1()
          Test of GetOpt.
 void testOption2()
          Test of GetOpt.
 void testOption3()
          Test of GetOpt.
 void testOption4()
          Test of GetOpt.
 void testOption5()
          Test of GetOpt.
 void testOption6()
          Test of GetOpt.
 void testOptionArgument1()
          Test of GetOpt.
 void testOptionArgument2()
          Test of GetOpt.
 void testOptionArgument3()
          Test of GetOpt.
 void testOptionArgument4()
          Test of GetOpt.
 void testOptionArgument5()
          Test of GetOpt.
 void testOptionArgument6()
          Test of GetOpt.
 void testOptionArgument7()
          Test of GetOpt.
 void testOptionArgument8()
          Test of GetOpt.
 void testSourceAndTarget()
          Test of GetOpt.
 void testWithoutOption()
          Test of GetOpt.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetOptTest

public GetOptTest()
Constructor.

Method Detail

testWithoutOption

public void testWithoutOption()
Test of GetOpt. Testcases: "fs ls" "fs ls /music/IckeUndEr" "fs ls media/../media"


testOption1

public void testOption1()
Test of GetOpt. Testcase: "fs ls -a";


testOption2

public void testOption2()
Test of GetOpt. Testcase: % fs testopt -a -b aflag = 1, bflag = 1, cvalue = (null)


testOption3

public void testOption3()
Test of GetOpt. Testcase: % fs testopt -ab aflag = 1, bflag = 1, cvalue = (null)


testOption4

public void testOption4()
Test of GetOpt. Testcase: % fs testopt -a -X


testOption5

public void testOption5()
Test of GetOpt. Testcase: % fs testopt -ab aflag = 1, bflag = 1, cvalue = (null)


testOption6

public void testOption6()
Test of GetOpt. Testcase: % fs testopt -ab aflag = 1, bflag = 1, cvalue = (null)


testOptionArgument1

public void testOptionArgument1()
Test of GetOpt. Testcase: % fs testopt -d ickeUndEr


testOptionArgument2

public void testOptionArgument2()
Test of GetOpt. Testcase: % fs testopt -dickeUndEr -R


testOptionArgument3

public void testOptionArgument3()
Test of GetOpt. Testcase: % fs testopt -d ickeUndEr


testOptionArgument4

public void testOptionArgument4()
Test of GetOpt. Testcase: % fs testopt -d ickeUndEr


testOptionArgument5

public void testOptionArgument5()
Test of GetOpt. Testcase: % fs testopt -d ickeUndEr -iTest


testOptionArgument6

public void testOptionArgument6()
Test of GetOpt. Testcase: % fs testopt -d ickeUndEr -R -iTest


testOptionArgument7

public void testOptionArgument7()
Test of GetOpt. Testcase: % fs testopt -d ickeUndEr -R -iTest


testOptionArgument8

public void testOptionArgument8()
Test of GetOpt. Testcase: % testopt -d ickeUndEr -R -iTest -h


testAll1

public void testAll1()
Test of GetOpt. Testcase: % fs testopt -d ickeUndEr -R -iTest /Itunes/music/


testAll2

public void testAll2()
Test of GetOpt. Testcase: % fs testopt /Itunes/music/ -d ickeUndEr -R -iTest X is a nonvalid option


testAll3

public void testAll3()
Test of GetOpt. Testcase: % fs testopt /Itunes/music/ -d ickeUndEr -R -iTest X is a nonvalid option


testSourceAndTarget

public void testSourceAndTarget()
Test of GetOpt. Testcase: % fs testopt /Itunes/music/ -d ickeUndEr -R -iTest X is a nonvalid option


optionHelp

public int[] optionHelp(java.lang.String command,
                        int length,
                        java.lang.String args)
Performs a getopt command and returns the arguments returned by getopt.

Parameters:
length - expected results.
args - arguments.
command - passed by the "command line".
Returns:
getopt result array.