test/java/nio/file/Files/walk_file_tree.sh

Print this page




  22 #
  23 
  24 # @test
  25 # @bug 4313887
  26 # @summary Unit test for walkFileTree method
  27 # @build CreateFileTree PrintFileTree SkipSiblings TerminateWalk
  28 # @run shell walk_file_tree.sh
  29 
  30 # if TESTJAVA isn't set then we assume an interactive run.
  31 
  32 if [ -z "$TESTJAVA" ]; then
  33     TESTSRC=.
  34     TESTCLASSES=.
  35     JAVA=java
  36 else
  37     JAVA="${TESTJAVA}/bin/java"
  38 fi
  39 
  40 OS=`uname -s`
  41 case "$OS" in
  42     Windows_* )
  43         echo "This test does not run on Windows" 
  44         exit 0
  45         ;;
  46     * )
  47         CLASSPATH=${TESTCLASSES}:${TESTSRC}
  48         ;;
  49 esac
  50 export CLASSPATH
  51 
  52 # create the file tree
  53 ROOT=`$JAVA CreateFileTree`
  54 if [ $? != 0 ]; then exit 1; fi
  55 
  56 failures=0
  57 
  58 # print the file tree and compare output with find(1)
  59 $JAVA PrintFileTree "$ROOT" > out1
  60 find "$ROOT" > out2
  61 diff out1 out2
  62 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi




  22 #
  23 
  24 # @test
  25 # @bug 4313887
  26 # @summary Unit test for walkFileTree method
  27 # @build CreateFileTree PrintFileTree SkipSiblings TerminateWalk
  28 # @run shell walk_file_tree.sh
  29 
  30 # if TESTJAVA isn't set then we assume an interactive run.
  31 
  32 if [ -z "$TESTJAVA" ]; then
  33     TESTSRC=.
  34     TESTCLASSES=.
  35     JAVA=java
  36 else
  37     JAVA="${TESTJAVA}/bin/java"
  38 fi
  39 
  40 OS=`uname -s`
  41 case "$OS" in
  42     Windows_* | CYGWIN* )
  43         echo "This test does not run on Windows" 
  44         exit 0
  45         ;;
  46     * )
  47         CLASSPATH=${TESTCLASSES}:${TESTSRC}
  48         ;;
  49 esac
  50 export CLASSPATH
  51 
  52 # create the file tree
  53 ROOT=`$JAVA CreateFileTree`
  54 if [ $? != 0 ]; then exit 1; fi
  55 
  56 failures=0
  57 
  58 # print the file tree and compare output with find(1)
  59 $JAVA PrintFileTree "$ROOT" > out1
  60 find "$ROOT" > out2
  61 diff out1 out2
  62 if [ $? != 0 ]; then failures=`expr $failures + 1`; fi