Package KFM

Examples of KFM.DirNavigator


    {
        final File tBasePath = new File("o:/KFM/java/lib");
        // Create a new TestSuite with name of this class
        //   which contains all basic tests in this class (void test*())
        final Vector tTestVector = new Vector(); // of Test
        DirNavigator tNavigator = new DirNavigator(tBasePath, new FileWorker() {
            public void workFile(File aFile) {
                if(aFile.getName().endsWith(".class")) {
                    // ex: .KFM.GUI.MultiPart.class
                    String tPackage = KFM.Converter.replaceString(File.separator, ".", aFile.getAbsolutePath());
                    tPackage = tPackage.substring(tBasePath.toString().length() + 1, tPackage.length() - ".class".length());
                    try {
                        Class tClass = Class.forName(tPackage);

                        // only consider junit.framework.TestCase classes or subclasses
                        if(junit.framework.TestCase.class.isAssignableFrom(tClass)) {
                            if(CompleteTest.class.equals(tClass)) {
                                // do not consider Complete Test, otherwise endless recursion
                                return;
                            }
                            Test tTest = getTestSuite(tClass, tPackage);
                            if(tTest != null) {
                                tTestVector.add(tTest);
                            }
                        }
                    } catch(ClassNotFoundException e) {
                        // ignore classes which cannot be loaded, we can't test them either
                    }
                }
            }
        });
        tNavigator.traverse();

        TestSuite tTestSuite = new TestSuite("CompleteTest");
        for(Iterator tIterator = tTestVector.iterator(); tIterator.hasNext(); ) {
            Test tTest = (Test) tIterator.next();
            if(tTest instanceof TestSuite) {
View Full Code Here


    *
    * @param aStartDir absolute path to the start directory
    */
    public void traverse(String aStartDir)
    {
         DirNavigator tNavigator = new DirNavigator(aStartDir, this);
         if (!mTraverseRecursively)
            tNavigator.unsetRecursively();
         tNavigator.traverse();
         System.out.println(mErrors + " errors occurred on the server side!");
    }
View Full Code Here

            String tHttpParams = MakePortalFileWorker.processArguments(tProps, args);

            //replace comments ?
            if (tProps.getProperty(cDIRECTIVE) == null){
                ReplaceCommentFileWorker tReplFileWorker = new ReplaceCommentFileWorker();
                DirNavigator tNavigator =
                    new DirNavigator(tProps.getProperty(MakePortalFileWorker.cFilepath),
                                     tReplFileWorker);
                tNavigator.traverse();
            }

             String tTomcat = tProps.getProperty("tomcat");
            // check for tomcat
            if(tTomcat.equals("false")) MakePortalFileWorker.TOMCAT=false;

           //execute jsp
            MakePortalFileWorker tMkPortalFileWorker = new MakePortalFileWorker(tHttpParams, tProps);

            // Check if to leave comments in the file

            DirNavigator tNavigator =
                new DirNavigator(tProps.getProperty(MakePortalFileWorker.cFilepath),
                                 tMkPortalFileWorker);
            Date startDate = new Date();
            tNavigator.traverse();
            tMkPortalFileWorker.done();
            System.out.println(startDate);
            System.out.println(new Date());
            System.out.println("\nNote: " + tMkPortalFileWorker.getErrors() + " errors occured on the server side!");
        }
View Full Code Here

        if (args.length == 0){
            System.out.println("You have to insert a filepath as parameter : ReplaceCommentFileWorker <aFilePath>");
        }
        String tStartDir = args[0];
        FileWorker tFileWorker = new ReplaceCommentFileWorker();
        DirNavigator tNavigator = new DirNavigator (tStartDir, tFileWorker);
        tNavigator.traverse ();

    }
View Full Code Here

        try{
            String tZipFileName = mZipDir + "/DumpTables" + aTimestamp + ".zip";
            File tFile = new File(tZipFileName);
            FileOutputStream tFileOutputStream = new FileOutputStream(tFile.getPath());
            mZipOutputStream = new ZipOutputStream(tFileOutputStream);
            DirNavigator tNavigator = new DirNavigator(mTempDirPrefix + "/" + mTempDir, this);
                tNavigator.unsetRecursively();
            tNavigator.traverse();
            mZipOutputStream.flush();
        }
        finally{
            if (mZipOutputStream != null)
                mZipOutputStream.close();
View Full Code Here

TOP

Related Classes of KFM.DirNavigator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.