* New Logger.getParent() test
@ 2006-09-19 10:32 Mark Wielaard
0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2006-09-19 10:32 UTC (permalink / raw)
To: mauve-patches
[-- Attachment #1: Type: text/plain, Size: 241 bytes --]
Hi,
Here is a new test for util.logging that tests whether the parent is
setup correctly for a new Logger.
2006-09-19 Mark Wielaard <mark@klomp.org>
* gnu/testlet/java/util/logging/Logger/getParent.java: New test.
Committed,
Mark
[-- Attachment #2: getParent.java --]
[-- Type: text/x-java, Size: 1754 bytes --]
// Tags: JDK1.4
// Uses: TestLogger TestSecurityManager
// Copyright (C) 2006 Mark J. Wielaard (mark@klomp.org)
// This file is part of Mauve.
// Mauve is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
// Mauve 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 Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Mauve; see the file COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
package gnu.testlet.java.util.logging.Logger;
import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
import java.util.logging.Logger;
public class getParent implements Testlet
{
public void test(TestHarness h)
{
Logger abcde = Logger.getLogger("a.b.c.d.e");
Logger abc = Logger.getLogger("a.b.c");
Logger ab = Logger.getLogger("a.b");
Logger a = Logger.getLogger("a");
Logger ax = Logger.getLogger("a.x");
Logger axy = Logger.getLogger("a.x.y");
Logger axyzw = Logger.getLogger("a.x.y.z.w");
h.check(abcde.getParent(), abc);
h.check(abc.getParent(), ab);
h.check(ab.getParent(), a);
h.check(ax.getParent(), a);
h.check(axy.getParent(), ax);
h.check(axyzw.getParent(), axy);
Logger root = Logger.getLogger("");
Logger anon = Logger.getAnonymousLogger();
h.check(a.getParent(), root);
h.check(anon.getParent(), root);
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-19 10:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-19 10:32 New Logger.getParent() test Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).