diff --git a/tests/CmdExecTester.java b/tests/CmdExecTester.java deleted file mode 100644 index 3afbfc3..0000000 --- a/tests/CmdExecTester.java +++ /dev/null @@ -1,98 +0,0 @@ -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import fr.devinsy.util.cmdexec.CmdExec; -import fr.devinsy.util.cmdexec.StreamGobbler; - -/** - * - */ -class CmdExecTester -{ - static private org.apache.log4j.Logger logger; - - static - { - // Initialize logger. - org.apache.log4j.Logger logger = null; - - org.apache.log4j.BasicConfigurator.configure(); - - logger = org.apache.log4j.Logger.getRootLogger(); - // logger.setLevel (org.apache.log4j.Level.INFO); - logger.setLevel(org.apache.log4j.Level.INFO); - - logger.info("Enter"); - - // - logger.info("Set the log file format..."); - - // log = - // org.apache.log4j.Category.getInstance(Application.class.getName()); - logger.info("... done."); - - logger.debug("Exit"); - logger = org.apache.log4j.Logger.getLogger(CmdExecTester.class); - } - - /** - * - */ - public static String check(final String title, final StringBuffer source, final String model) - { - String result; - - if (source.indexOf(model) == -1) - { - result = String.format("%-40s -> KO <-", title) + "\nGet:\n" + source + "\nWaiting:\n" + model; - - } - else - { - result = String.format("%-40s [ OK ] ", title); - } - - // - return (result); - } - - /** - * - */ - public static void main(final String[] args) - { - System.out.println("Automatic test action for CmdExec!"); - - Matcher m = Pattern.compile("^#\\sowner:\\s([a-z_][a-z0-9_-]*)$").matcher("# owner: cpm"); - m.matches(); - // System.out.println("owner=[" + m.matches() + "]"); - System.out.println("owner=[" + m.groupCount() + "]"); - System.out.println("owner=[" + m.group(1) + "]"); - // test1(); - - } - - /** - * - */ - public static void test1() - { - try - { - System.out.println("Launch ..."); - - // String command = "/bin/sort -r /etc/passwd"; - String[] command = { "/bin/sort", "-r", "/etc/passwd" }; - - CmdExec cmd = new CmdExec(command, StreamGobbler.BUFFER, StreamGobbler.BUFFER); - System.out.println("exitVal=[" + cmd.getExitValue() + "]"); - System.out.println("out=[" + cmd.getOutStream() + "]"); - System.out.println("err=[" + cmd.getErrStream() + "]"); - } - catch (Exception exception) - { - exception.printStackTrace(); - logger.info("ERRRO=" + exception); - } - } -} diff --git a/tests/FileIteratorTester.java b/tests/FileIteratorTester.java deleted file mode 100644 index 9e57ca7..0000000 --- a/tests/FileIteratorTester.java +++ /dev/null @@ -1,92 +0,0 @@ -import java.io.File; - -import org.apache.log4j.BasicConfigurator; -import org.apache.log4j.ConsoleAppender; -import org.apache.log4j.Logger; -import org.apache.log4j.PatternLayout; - -import fr.devinsy.util.FileIterator; - -/** - * - */ -public class FileIteratorTester -{ - static private org.apache.log4j.Logger logger; - - static - { - // Initialize logger. - - BasicConfigurator.configure(); - Logger defaultLogger = org.apache.log4j.Logger.getRootLogger(); - defaultLogger.setLevel(org.apache.log4j.Level.DEBUG); - - defaultLogger.removeAllAppenders(); - defaultLogger.addAppender(new ConsoleAppender(new PatternLayout("%d{ISO8601} - FIT [%-5p] %34.34c.%-25M - %m%n"))); - - defaultLogger.debug("Log initialized."); - - logger = org.apache.log4j.Logger.getLogger(FileIteratorTester.class.getName()); - } - - /** - * - */ - public static void main(final String[] args) - { - test(); - } - - /** - * - */ - protected static void test() - { - System.out.println("user.dir=" + System.getProperty("user.dir")); - - try - { - // File f = new File("TestTree/DirectoryOne/titi2"); - // File f = new File("/home/cpm/.kde//cache-cpmstar"); - File f = new File("tests/TestTree/xine.jpg"); - System.out.println("exists=" + f.exists()); - System.out.println("canonical path = " + f.getCanonicalPath()); - System.out.println("absolute path = " + f.getAbsolutePath()); - System.out.println("name = " + f.getName()); - System.out.println("parent = " + f.getParent()); - System.out.println("path = " + f.getPath()); - System.out.println("path = " + f.lastModified()); - System.out.println("path = " + f.length()); - System.out.println("path = " + f.isFile()); - System.out.println("path = " + f.isDirectory()); - System.out.println("list = " + f.list()); - - System.out.println("----"); - // FileIterator i = new FileIterator(new File("tests/TestTree")); - FileIterator i = new FileIterator(new File("tests/TestTree/xine.jpg"), null, true); - // FileIterator i = new FileIterator(new - // File("/home/cpm/.kde/cache-cpmstar"), ".*cache.*", false); - // FileIterator i = new FileIterator(new File("tests/TestTree"), - // ".*dsc.*", false); - // FileIterator i = new FileIterator(new - // File("/home/cpm/Images/Photos/")); - // FileIterator i = new FileIterator(new - // File("/home/cpm/Images/Photos/"), ".*\\.(JPG|jpg)", false); - // FileIterator i = new FileIterator(new - // File("/home/cpm/Images/Photos/"), ".*anni_moi.*", false); - - while (i.hasNext()) - { - // System.out.println(i.toString()); - System.out.println("File=[" + i.next().getPath() + "]"); - } - i.reset(); - System.out.println("Cardinal=" + i.finalCountdown()); - } - catch (Exception exception) - { - System.out.println("ERROR:" + exception.getMessage()); - } - } -} diff --git a/tests/TestTree/.test/arf b/tests/TestTree/.test/arf deleted file mode 100644 index 613a3f5..0000000 --- a/tests/TestTree/.test/arf +++ /dev/null @@ -1 +0,0 @@ -test sioux diff --git a/tests/TestTree/20081111-nouvelle_voiture/dsc01469.jpg b/tests/TestTree/20081111-nouvelle_voiture/dsc01469.jpg deleted file mode 100755 index 49b1665..0000000 Binary files a/tests/TestTree/20081111-nouvelle_voiture/dsc01469.jpg and /dev/null differ diff --git a/tests/TestTree/20081111-nouvelle_voiture/dsc01470.jpg b/tests/TestTree/20081111-nouvelle_voiture/dsc01470.jpg deleted file mode 100755 index 88a4027..0000000 Binary files a/tests/TestTree/20081111-nouvelle_voiture/dsc01470.jpg and /dev/null differ diff --git a/tests/TestTree/20081111-nouvelle_voiture/dsc01472.jpg b/tests/TestTree/20081111-nouvelle_voiture/dsc01472.jpg deleted file mode 100755 index 8fff0e5..0000000 Binary files a/tests/TestTree/20081111-nouvelle_voiture/dsc01472.jpg and /dev/null differ diff --git a/tests/TestTree/20081111-nouvelle_voiture/dsc01474.jpg b/tests/TestTree/20081111-nouvelle_voiture/dsc01474.jpg deleted file mode 100755 index 0e662f1..0000000 Binary files a/tests/TestTree/20081111-nouvelle_voiture/dsc01474.jpg and /dev/null differ diff --git a/tests/TestTree/DirectoryOne/titi b/tests/TestTree/DirectoryOne/titi deleted file mode 100644 index cbd38df..0000000 --- a/tests/TestTree/DirectoryOne/titi +++ /dev/null @@ -1 +0,0 @@ -azertyuiop diff --git a/tests/TestTree/DirectoryOne/toto b/tests/TestTree/DirectoryOne/toto deleted file mode 100644 index 388a530..0000000 --- a/tests/TestTree/DirectoryOne/toto +++ /dev/null @@ -1 +0,0 @@ -good weather today diff --git a/tests/TestTree/DirectoryOne/tu tu b/tests/TestTree/DirectoryOne/tu tu deleted file mode 100644 index 20b7025..0000000 --- a/tests/TestTree/DirectoryOne/tu tu +++ /dev/null @@ -1 +0,0 @@ -Ceci est un test. diff --git a/tests/TestTree/P/dsc01469.jpg b/tests/TestTree/P/dsc01469.jpg deleted file mode 100755 index 49b1665..0000000 Binary files a/tests/TestTree/P/dsc01469.jpg and /dev/null differ diff --git a/tests/TestTree/P/dsc01470.jpg b/tests/TestTree/P/dsc01470.jpg deleted file mode 100755 index 88a4027..0000000 Binary files a/tests/TestTree/P/dsc01470.jpg and /dev/null differ diff --git a/tests/TestTree/P/dsc01472.jpg b/tests/TestTree/P/dsc01472.jpg deleted file mode 100755 index 8fff0e5..0000000 Binary files a/tests/TestTree/P/dsc01472.jpg and /dev/null differ diff --git a/tests/TestTree/P/dsc01474.jpg b/tests/TestTree/P/dsc01474.jpg deleted file mode 100755 index 0e662f1..0000000 Binary files a/tests/TestTree/P/dsc01474.jpg and /dev/null differ diff --git a/tests/TestTree/xine.jpg b/tests/TestTree/xine.jpg deleted file mode 120000 index a89443b..0000000 Binary files a/tests/TestTree/xine.jpg and /dev/null differ diff --git a/tests/TestTree/xine_snapshot-4.jpg b/tests/TestTree/xine_snapshot-4.jpg deleted file mode 100644 index a89443b..0000000 Binary files a/tests/TestTree/xine_snapshot-4.jpg and /dev/null differ diff --git a/tests/TestTree/xine_snapshot-9.jpg b/tests/TestTree/xine_snapshot-9.jpg deleted file mode 100644 index 5ef999b..0000000 Binary files a/tests/TestTree/xine_snapshot-9.jpg and /dev/null differ