You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

genSeeTestCases.sh 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # generate test cases for {@link} tags
  3. ## permitted variants:
  4. # - everything but member name can be empty
  5. # - spaces between everything except around sharp #
  6. # - 0..n parm types
  7. # - simple or qualified type names
  8. # - Type[ ][ ] but not Type [ ] [ ]
  9. # todo:
  10. # - URL's acceptable for link??
  11. count=0
  12. pre=" "
  13. echo " static final SeeTestCase[] CASES = new SeeTestCase[] { null // first is null"
  14. for type in "" Type junit.Type org.aspectj.Type; do
  15. for name in memberName; do
  16. for parms in "" "()" "(int)" "(int,String)" "( int , String[ ][ ] )" "( foo.Bar , com.sun.X )" "(foo.Bar)" ; do
  17. for label in "" label "a label"; do
  18. # method, field X no spaces, spaces
  19. echo "$pre, new SeeTestCase(\"$type#$name$parms $label\", \"$type\", \"$name\", \"$parms\", \"$label\") // $count"
  20. echo "$pre, new SeeTestCase(\" $type#$name $parms $label \", \"$type\", \"$name\", \"$parms\", \"$label\")"
  21. count=`expr $count + 2`
  22. done; done; done; done;
  23. echo "${pre}};";
  24. i=0
  25. while [ $i -lt $count ] ; do
  26. i=`expr $i + 1` # first is null
  27. echo " public void testLink$i() { CASES[$i].run(); }"
  28. done