From 089dc87b38df42c8f8c27410e9d7f2358cd5fa22 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 29 Nov 2001 21:55:40 +0000 Subject: [PATCH] Turned test into JUnit test. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@697 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../BundledComponentRepositoryTest.java | 27 ++++++++++++++++-- .../bundle/BundledTileSetRepositoryTest.java | 28 ++++++++++++++++--- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/tests/src/java/com/threerings/cast/bundle/BundledComponentRepositoryTest.java b/tests/src/java/com/threerings/cast/bundle/BundledComponentRepositoryTest.java index a796622dc..4e31afbae 100644 --- a/tests/src/java/com/threerings/cast/bundle/BundledComponentRepositoryTest.java +++ b/tests/src/java/com/threerings/cast/bundle/BundledComponentRepositoryTest.java @@ -1,5 +1,5 @@ // -// $Id: BundledComponentRepositoryTest.java,v 1.1 2001/11/27 08:06:57 mdb Exp $ +// $Id: BundledComponentRepositoryTest.java,v 1.2 2001/11/29 21:55:25 mdb Exp $ package com.threerings.cast.bundle; @@ -8,9 +8,17 @@ import com.samskivert.util.StringUtil; import com.threerings.resource.ResourceManager; import com.threerings.cast.ComponentClass; -public class BundledComponentRepositoryTest +import junit.framework.Test; +import junit.framework.TestCase; + +public class BundledComponentRepositoryTest extends TestCase { - public static void main (String[] args) + public BundledComponentRepositoryTest () + { + super(BundledComponentRepositoryTest.class.getName()); + } + + public void runTest () { try { ResourceManager rmgr = new ResourceManager(null, "rsrc"); @@ -36,6 +44,19 @@ public class BundledComponentRepositoryTest } catch (Exception e) { e.printStackTrace(); + fail(); } } + + public static void main (String[] args) + { + BundledComponentRepositoryTest test = + new BundledComponentRepositoryTest(); + test.runTest(); + } + + public static Test suite () + { + return new BundledComponentRepositoryTest(); + } } diff --git a/tests/src/java/com/threerings/media/tile/bundle/BundledTileSetRepositoryTest.java b/tests/src/java/com/threerings/media/tile/bundle/BundledTileSetRepositoryTest.java index 078b9e53b..2d486ec48 100644 --- a/tests/src/java/com/threerings/media/tile/bundle/BundledTileSetRepositoryTest.java +++ b/tests/src/java/com/threerings/media/tile/bundle/BundledTileSetRepositoryTest.java @@ -1,19 +1,27 @@ // -// $Id: BundledTileSetRepositoryTest.java,v 1.1 2001/11/21 02:42:16 mdb Exp $ +// $Id: BundledTileSetRepositoryTest.java,v 1.2 2001/11/29 21:55:40 mdb Exp $ package com.threerings.media.tile.bundle; import java.util.Iterator; import com.threerings.resource.ResourceManager; -public class BundledTileSetRepositoryTest +import junit.framework.Test; +import junit.framework.TestCase; + +public class BundledTileSetRepositoryTest extends TestCase { - public static void main (String[] args) + public BundledTileSetRepositoryTest () + { + super(BundledTileSetRepositoryTest.class.getName()); + } + + public void runTest () { try { ResourceManager rmgr = new ResourceManager(null, "rsrc"); BundledTileSetRepository repo = - new BundledTileSetRepository(rmgr, "bundle_test"); + new BundledTileSetRepository(rmgr, "tilesets"); Iterator sets = repo.enumerateTileSets(); while (sets.hasNext()) { System.out.println(sets.next()); @@ -23,4 +31,16 @@ public class BundledTileSetRepositoryTest e.printStackTrace(); } } + + public static Test suite () + { + return new BundledTileSetRepositoryTest(); + } + + public static void main (String[] args) + { + BundledTileSetRepositoryTest test = + new BundledTileSetRepositoryTest(); + test.runTest(); + } }