mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
from tests removed braids legacy
This commit is contained in:
4
.gitattributes
vendored
4
.gitattributes
vendored
@@ -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/item/DeckHintsTest.java -text
|
||||||
src/test/java/forge/model/BuildInfoTest.java -text
|
src/test/java/forge/model/BuildInfoTest.java -text
|
||||||
src/test/java/forge/model/FModelTest.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
|
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ import java.io.IOException;
|
|||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipOutputStream;
|
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.Assert;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
@@ -104,54 +101,6 @@ 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
|
* Helper method to create jar files at specific locations with specific
|
||||||
* name-value pairs in their manifests.
|
* name-value pairs in their manifests.
|
||||||
|
|||||||
@@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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.
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
/** Utilities for TestNG tests. Licensed under both Apache 2.0 and GNU Public Licenses. */
|
|
||||||
package net.slightlymagic.braids.util.testng;
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user