Package org.exoplatform.services.log

Examples of org.exoplatform.services.log.Log


   {
      if (name == null)
      {
         throw new NullPointerException();
      }
      Log exoLogger = loggers.get(name);
      if (exoLogger == null)
      {
         exoLogger = getLogger(name);
         Log phantom = loggers.putIfAbsent(name, exoLogger);
         if (phantom != null)
         {
            exoLogger = phantom;
         }
      }
View Full Code Here


   }

   public void testMultiThread() throws Exception
   {
      Log log = ExoLogger.getLogger("exo.jcr.framework.command.MultiThreadFtpTest");
      log.info("Test...");

      ArrayList<FtpThreadTest> testers = new ArrayList<FtpThreadTest>();

      for (int i = 0; i < CLIENTS_COUNT; i++)
      {
         String testFolder = "/production/test_folder_" + i;
         FtpThreadTest curTest = new FtpThreadTest(testFolder);
         testers.add(curTest);
         curTest.start();
      }

      try
      {
         boolean enable = true;
         while (enable)
         {

            enable = false;
            for (int i = 0; i < testers.size(); i++)
            {
               FtpThreadTest curTest = testers.get(i);
               if (curTest.isAlive())
               {
                  enable = true;
               }
            }

            Thread.sleep(100);
         }
      }
      catch (Exception exc)
      {
         log.info("Unhandled ecxeption. " + exc.getMessage(), exc);
      }

      log.info("Complete.");
   }
View Full Code Here

      return ExoLogger.getLogger("exo.jcr.framework.command." + unitName);
   }

   public void testNOOP() throws Exception
   {
      Log log = getLogger(FtpConst.Commands.CMD_NOOP);
      log.info("Test...");

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_200, client.executeCommand(new CmdNoop()));

      client.close();

      log.info("Complete.");
   }
View Full Code Here

      log.info("Complete.");
   }

   public void testUSER() throws Exception
   {
      Log log = getLogger(FtpConst.Commands.CMD_USER);
      log.info("Test...");

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));

      client.close();

      log.info("Complete.");
   }
View Full Code Here

      log.info("Complete.");
   }

   public void testPASS() throws Exception
   {
      Log log = getLogger(FtpConst.Commands.CMD_PASS);
      log.info("Test...");

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
      assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));

      client.close();

      log.info("Complete.");
   }
View Full Code Here

      log.info("Complete.");
   }

   public void testSYST() throws Exception
   {
      Log log = getLogger(FtpConst.Commands.CMD_SYST);
      log.info("Test...");

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
      assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));
      assertEquals(FtpConst.Replyes.REPLY_215, client.executeCommand(new CmdSyst()));

      log.info("Complete.");
   }
View Full Code Here

      log.info("Complete.");
   }

   public void testPWD() throws Exception
   {
      Log log = getLogger(FtpConst.Commands.CMD_PWD);
      log.info("Test...");

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
      assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));

      CmdPwd cmdPwd = new CmdPwd();
      assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(cmdPwd));

      log.info("CURRENTPATH - [" + cmdPwd.getCurrentPath() + "]");

      // assertEquals("/", cmdPwd.getCurrentPath());

      log.info("Complete.");
   }
View Full Code Here

      log.info("Complete.");
   }

   public void testCWD() throws Exception
   {
      Log log = getLogger(FtpConst.Commands.CMD_CWD);
      log.info("Test...");

      // success

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
      assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));
      assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCwd("production")));

      CmdPwd cmdPwd = new CmdPwd();
      assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(cmdPwd));
      assertEquals("/production", cmdPwd.getCurrentPath());

      assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCwd("../backup/")));

      cmdPwd = new CmdPwd();

      assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(cmdPwd));
      assertEquals("/backup", cmdPwd.getCurrentPath());

      assertEquals(FtpConst.Replyes.REPLY_550, client.executeCommand(new CmdCwd("production")));

      client.close();

      // denied
      client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_530, client.executeCommand(new CmdCwd("production")));

      client.close();

      log.info("Complete.");
   }
View Full Code Here

      log.info("Complete.");
   }

   public void testCDUP() throws Exception
   {
      Log log = getLogger(FtpConst.Commands.CMD_CDUP);
      log.info("Test...");

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
      assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));
      assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCwd("production")));

      CmdPwd cmdPwd = new CmdPwd();
      assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(cmdPwd));
      assertEquals("/production", cmdPwd.getCurrentPath());

      assertEquals(FtpConst.Replyes.REPLY_250, client.executeCommand(new CmdCdUp()));

      cmdPwd = new CmdPwd();
      assertEquals(FtpConst.Replyes.REPLY_257, client.executeCommand(cmdPwd));
      assertEquals("/", cmdPwd.getCurrentPath());

      client.close();

      log.info("Complete.");
   }
View Full Code Here

      log.info("Complete.");
   }

   public void testTYPE() throws Exception
   {
      Log log = getLogger(FtpConst.Commands.CMD_TYPE);
      log.info("Test...");

      FtpClientSession client = FtpTestConfig.getTestFtpClient();
      client.connect();

      assertEquals(FtpConst.Replyes.REPLY_331, client.executeCommand(new CmdUser("admin")));
      assertEquals(FtpConst.Replyes.REPLY_230, client.executeCommand(new CmdPass("admin")));

      assertEquals(FtpConst.Replyes.REPLY_200, client.executeCommand(new CmdType("A")));
      assertEquals(FtpConst.Replyes.REPLY_200, client.executeCommand(new CmdType("I")));
      assertEquals(FtpConst.Replyes.REPLY_500, client.executeCommand(new CmdType("SOMETYPE")));

      client.close();

      log.info("Complete.");
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.log.Log

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.