From d7931f6810543b63e953af6ea54f16395e9fa49c Mon Sep 17 00:00:00 2001 From: Maxmtg Date: Mon, 1 Oct 2012 05:31:02 +0000 Subject: [PATCH] from tests removed braids legacy --- .gitattributes | 4 -- src/test/java/forge/model/BuildInfoTest.java | 53 +------------------ .../util/testng/BraidsAssertFunctions.java | 39 -------------- .../braids/util/testng/ClumsyRunnable.java | 35 ------------ .../braids/util/testng/LICENSE.txt | 17 ------ .../braids/util/testng/package-info.java | 3 -- 6 files changed, 1 insertion(+), 150 deletions(-) delete mode 100644 src/test/java/net/slightlymagic/braids/util/testng/BraidsAssertFunctions.java delete mode 100644 src/test/java/net/slightlymagic/braids/util/testng/ClumsyRunnable.java delete mode 100644 src/test/java/net/slightlymagic/braids/util/testng/LICENSE.txt delete mode 100644 src/test/java/net/slightlymagic/braids/util/testng/package-info.java diff --git a/.gitattributes b/.gitattributes index 90cf82f9171..96fe5cc6ef8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12967,7 +12967,3 @@ src/test/java/forge/gui/game/CardDetailPanelTest.java svneol=native#text/plain src/test/java/forge/item/DeckHintsTest.java -text src/test/java/forge/model/BuildInfoTest.java -text src/test/java/forge/model/FModelTest.java -text -src/test/java/net/slightlymagic/braids/util/testng/BraidsAssertFunctions.java svneol=native#text/plain -src/test/java/net/slightlymagic/braids/util/testng/ClumsyRunnable.java svneol=native#text/plain -src/test/java/net/slightlymagic/braids/util/testng/LICENSE.txt svneol=native#text/plain -src/test/java/net/slightlymagic/braids/util/testng/package-info.java -text diff --git a/src/test/java/forge/model/BuildInfoTest.java b/src/test/java/forge/model/BuildInfoTest.java index 020ab46d770..ee3f187d16e 100644 --- a/src/test/java/forge/model/BuildInfoTest.java +++ b/src/test/java/forge/model/BuildInfoTest.java @@ -6,9 +6,6 @@ import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import net.slightlymagic.braids.util.testng.BraidsAssertFunctions; -import net.slightlymagic.braids.util.testng.ClumsyRunnable; - import org.testng.Assert; import org.testng.annotations.Test; @@ -104,55 +101,7 @@ public class BuildInfoTest { } } - /** - * Test BuildInfo with two mock forge jars placed in the class path; this is - * an error condition. - * - * @throws IOException - * indirectly - */ - @Test(enabled = false) - public final void test_BuildInfo_twoJarsInCP() throws IOException { - // by - // Braids - // on - // 8/12/11 - // 10:26 - // AM - final String origClassPath = System.getProperty(BuildInfoTest.JAVA_CLASS_PATH); - File jarAsFile1 = null; - File jarAsFile2 = null; - - try { - jarAsFile1 = this.makeTmpJarWithManifest("forge-BuildInfoTest-1-", "-with-dependencies.jar", new String[] { - BuildInfoTest.MF_ATTR_NAME_VERSION, "1.1.1", BuildInfoTest.MF_ATTR_NAME_BUILD, "1111" }); - - jarAsFile2 = this.makeTmpJarWithManifest("forge-BuildInfoTest-2-", "-with-dependencies.jar", new String[] { - BuildInfoTest.MF_ATTR_NAME_VERSION, "2.2.2", BuildInfoTest.MF_ATTR_NAME_BUILD, "2222" }); - - final String pathSep = System.getProperty("path.separator"); - - System.setProperty(BuildInfoTest.JAVA_CLASS_PATH, - jarAsFile1.getAbsolutePath() + pathSep + jarAsFile2.getAbsolutePath() + pathSep + origClassPath); - - final BuildInfo info = new BuildInfo(); - - BraidsAssertFunctions.assertThrowsException(MultipleForgeJarsFoundError.class, new ClumsyRunnable() { - @Override - public void run() throws Exception { - // 8/12/11 10:29 AM - info.getBuildID(); - } - }); - - } finally { - Assert.assertTrue(jarAsFile1.delete(), "attempting to delete 1st temporary jar"); - Assert.assertTrue(jarAsFile2.delete(), "attempting to delete 2nd temporary jar"); - System.setProperty(BuildInfoTest.JAVA_CLASS_PATH, origClassPath); - } - } - - /** + /** * Helper method to create jar files at specific locations with specific * name-value pairs in their manifests. * diff --git a/src/test/java/net/slightlymagic/braids/util/testng/BraidsAssertFunctions.java b/src/test/java/net/slightlymagic/braids/util/testng/BraidsAssertFunctions.java deleted file mode 100644 index ab61017d760..00000000000 --- a/src/test/java/net/slightlymagic/braids/util/testng/BraidsAssertFunctions.java +++ /dev/null @@ -1,39 +0,0 @@ -package net.slightlymagic.braids.util.testng; - - -import org.testng.Assert; - -/** - * A collection of assert functions that go with TestNG. - */ -public final class BraidsAssertFunctions { - - /** Do not instantiate. */ - private BraidsAssertFunctions() { - // empty - } - - /** - * Assert that a function (ClumsyRunnable) throws the given exception, or a - * subclass of it. - * - * @param exnClass - * the exception we expect - * @param withScissors - * the code to run - */ - public static void assertThrowsException(@SuppressWarnings("rawtypes") final Class exnClass, - final ClumsyRunnable withScissors) { - try { - withScissors.run(); - } catch (final Exception exn) { - if (!exnClass.isInstance(exn)) { - Assert.fail("caught exception " + exn.getClass().getName() + ", but expected " + exnClass.getName()); - } - - return; // success - } - - Assert.fail("expected exception " + exnClass.getName() + ", but none was thrown"); - } -} diff --git a/src/test/java/net/slightlymagic/braids/util/testng/ClumsyRunnable.java b/src/test/java/net/slightlymagic/braids/util/testng/ClumsyRunnable.java deleted file mode 100644 index 7dcacaef598..00000000000 --- a/src/test/java/net/slightlymagic/braids/util/testng/ClumsyRunnable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The files in the directory "net/slightlymagic/braids" and in all subdirectories of it (the "Files") are - * Copyright 2011 Braids Cabal-Conjurer. They are available under either Forge's - * main license (the GNU Public License; see LICENSE.txt in Forge's top directory) - * or under the Apache License, as explained below. - * - * The Files are additionally licensed under the Apache License, Version 2.0 (the - * "Apache License"); you may not use the files in this directory except in - * compliance with one of its two licenses. You may obtain a copy of the Apache - * License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Apache License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Apache License for the specific language governing permissions and - * limitations under the Apache License. - * - */ -package net.slightlymagic.braids.util.testng; - -/** - * Like Runnable, but it can throw any Exception. - */ -public interface ClumsyRunnable { - - /** - * Run. - * - * @throws Exception - * the exception - */ - void run() throws Exception; -} diff --git a/src/test/java/net/slightlymagic/braids/util/testng/LICENSE.txt b/src/test/java/net/slightlymagic/braids/util/testng/LICENSE.txt deleted file mode 100644 index 0c164f47300..00000000000 --- a/src/test/java/net/slightlymagic/braids/util/testng/LICENSE.txt +++ /dev/null @@ -1,17 +0,0 @@ -The files in this directory and in all subdirectories of it (the "Files") are -Copyright 2011 Braids Cabal-Conjurer. They are available under either Forge's -main license (the GNU Public License; see LICENSE.txt in Forge's top directory) -or under the Apache License, as explained below. - -The Files are additionally licensed under the Apache License, Version 2.0 (the -"Apache License"); you may not use the files in this directory except in -compliance with one of its two licenses. You may obtain a copy of the Apache -License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the Apache License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the Apache License for the specific language governing permissions and -limitations under the Apache License. diff --git a/src/test/java/net/slightlymagic/braids/util/testng/package-info.java b/src/test/java/net/slightlymagic/braids/util/testng/package-info.java deleted file mode 100644 index 3694b76b21e..00000000000 --- a/src/test/java/net/slightlymagic/braids/util/testng/package-info.java +++ /dev/null @@ -1,3 +0,0 @@ -/** Utilities for TestNG tests. Licensed under both Apache 2.0 and GNU Public Licenses. */ -package net.slightlymagic.braids.util.testng; -