Author: echatellier Date: 2011-04-28 12:13:02 +0200 (Thu, 28 Apr 2011) New Revision: 2122 Url: http://nuiton.org/repositories/revision/nuiton-utils/2122 Log: Remove log class Removed: trunk/nuiton-utils/src/test/java/org/nuiton/util/LogTest.java Deleted: trunk/nuiton-utils/src/test/java/org/nuiton/util/LogTest.java =================================================================== --- trunk/nuiton-utils/src/test/java/org/nuiton/util/LogTest.java 2011-04-28 10:10:36 UTC (rev 2121) +++ trunk/nuiton-utils/src/test/java/org/nuiton/util/LogTest.java 2011-04-28 10:13:02 UTC (rev 2122) @@ -1,136 +0,0 @@ -/* - * #%L - * Nuiton Utils - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2004 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ - -/* * - * LogTest.java - * - * Created: 12 août 2004 - * - * @author Benjamin Poussin <poussin@codelutin.com> - * @version $Revision$ - * - * Mise a jour: $Date$ - * par : */ - -package org.nuiton.util; - -import junit.framework.TestCase; - -/** - * @deprecated since 1.4.1, will not be replaced. - */ -@Deprecated -public class LogTest extends TestCase { // LogTest - - protected int callTest = 0; - protected int callAll = 0; - protected int taskMax = 0; - protected int taskValue = 0; - - public class LogListenerTest implements Log.LogListener { - boolean all = false; - - public LogListenerTest(boolean all) { - this.all = all; - } - - public void logMessage(Log.LogEvent e) { - if (all) callAll++; - else callTest++; - } - - public void logTask(Log.LogEvent e) { - taskMax = e.getTaskMax(); - taskValue = e.getTaskValue(); - } - } - - public void testLog() throws Exception { - LogListenerTest ltest = new LogListenerTest(false); - LogListenerTest lall = new LogListenerTest(true); - - Log.addLogListener(lall); - Log.addLogListener(ltest, "TEST"); - - assertEquals(callTest, 0); - assertEquals(callAll, 0); - - Log.logUserInfo("TEST", "coucou"); - - assertEquals(callTest, 1); - assertEquals(callAll, 1); - - Log.logUserInfo("OTHERTEST", "coucou"); - - assertEquals(callTest, 1); - assertEquals(callAll, 2); - - Log.removeLogListener(lall); - Log.logUserInfo("TEST", "coucou"); - - assertEquals(callTest, 2); - assertEquals(callAll, 2); - - Log.logUserInfo("OTHERTEST", "coucou"); - - assertEquals(callTest, 2); - assertEquals(callAll, 2); - - Log.removeLogListener(ltest, "TEST"); - Log.logUserInfo("TEST", "coucou"); - - assertEquals(callTest, 2); - assertEquals(callAll, 2); - - Log.addLogListener(lall); - Log.logUserInfo("TEST", "coucou"); - - assertEquals(callTest, 2); - assertEquals(callAll, 3); - - // test des task - - assertEquals(0, taskMax); - assertEquals(0, taskValue); - - Log.logTask("TEST", "on avance", -1, 0); - assertEquals(-1, taskMax); - assertEquals(0, taskValue); - - Log.logTask("TEST", "on avance", 0, 0); - assertEquals(0, taskMax); - assertEquals(0, taskValue); - - Log.logTask("TEST", "on avance", 10, 5); - assertEquals(10, taskMax); - assertEquals(5, taskValue); - - Log.logTask("TEST", "on avance", 10, 10); - assertEquals(10, taskMax); - assertEquals(10, taskValue); - } - -} // LogTest -
participants (1)
-
echatellier@users.nuiton.org