aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Woodworth <[email protected]>2012-12-07 22:52:49 -0800
committerPatrick Woodworth <[email protected]>2012-12-07 22:52:49 -0800
commit9f42486dcf2896fc0b649f9fd915e26e3a8a5589 (patch)
tree8db2c9932e8a5fc938e2f4aa61943818d508181e
parent9bf77befdd3a8871cc8ed2c4de561095f2d4958c (diff)
Fixing test source compilation with new Q2TestDataUtil.
-rw-r--r--pom.xml2
-rw-r--r--test/jake2/qcommon/Q2TestDataUtil.java51
-rw-r--r--test/jake2/render/DancingQueens.java4
-rw-r--r--test/jake2/render/TestMap.java4
-rw-r--r--test/jake2/render/TestRenderer.java4
5 files changed, 55 insertions, 10 deletions
diff --git a/pom.xml b/pom.xml
index a2aabda..dd391f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
<jake.build.outputDirectory>${project.build.directory}/classes</jake.build.outputDirectory>
<jake.dist.lib.directory>${project.build.directory}</jake.dist.lib.directory>
<jake.dist.dep.prefix/>
- <jake.test.skip>true</jake.test.skip>
+ <jake.test.skip>false</jake.test.skip>
<jake.javac.source>1.6</jake.javac.source>
<jake.javac.target>${jake.javac.source}</jake.javac.target>
<jogamp.version>2.0-rc11</jogamp.version>
diff --git a/test/jake2/qcommon/Q2TestDataUtil.java b/test/jake2/qcommon/Q2TestDataUtil.java
new file mode 100644
index 0000000..e273215
--- /dev/null
+++ b/test/jake2/qcommon/Q2TestDataUtil.java
@@ -0,0 +1,51 @@
+package jake2.qcommon;
+
+import jake2.Jake2;
+
+import java.util.Locale;
+
+/** @author Patrick Woodworth */
+public class Q2TestDataUtil {
+
+ private static final boolean USE_DATA_DIALOG = Boolean.getBoolean("jake.data.dialog");
+
+ public static final void initQ2DataTool() {
+ if (USE_DATA_DIALOG) {
+ Q2DataDialogWrapper tmpq2DataTool = new Q2DataDialogWrapper();
+ Locale.setDefault(Locale.US);
+ tmpq2DataTool.setVisible(true);
+ Jake2.q2DataTool = tmpq2DataTool;
+ } else {
+ Jake2.q2DataTool = new Q2DataTool();
+ Locale.setDefault(Locale.US);
+ }
+ }
+
+ public static class Q2DataDialogWrapper extends Q2DataTool {
+
+ private final Q2DataDialog m_data = new Q2DataDialog();
+
+ public Q2DataDialogWrapper() {
+ super();
+ }
+
+ @Override
+ public void testQ2Data() {
+ m_data.testQ2Data();
+ }
+
+ @Override
+ void dispose() {
+ m_data.dispose();
+ }
+
+ @Override
+ void setStatus(String text) {
+ m_data.setStatus(text);
+ }
+
+ public void setVisible(boolean b) {
+ m_data.setVisible(b);
+ }
+ }
+}
diff --git a/test/jake2/render/DancingQueens.java b/test/jake2/render/DancingQueens.java
index 4097d21..1b98ea0 100644
--- a/test/jake2/render/DancingQueens.java
+++ b/test/jake2/render/DancingQueens.java
@@ -67,9 +67,7 @@ public class DancingQueens {
void init() {
Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
- Jake2.Q2Dialog = new Q2DataDialog();
- Locale.setDefault(Locale.US);
- Jake2.Q2Dialog.setVisible(true);
+ Q2TestDataUtil.initQ2DataTool();
String DRIVER = "lwjgl";
diff --git a/test/jake2/render/TestMap.java b/test/jake2/render/TestMap.java
index 3dd89fd..10112d1 100644
--- a/test/jake2/render/TestMap.java
+++ b/test/jake2/render/TestMap.java
@@ -75,9 +75,7 @@ public class TestMap
// open the q2dialog, if we are not in dedicated mode.
if (Globals.dedicated.value != 1.0f)
{
- Jake2.Q2Dialog = new Q2DataDialog();
- Locale.setDefault(Locale.US);
- Jake2.Q2Dialog.setVisible(true);
+ Q2TestDataUtil.initQ2DataTool();
}
Qcommon.Init(new String[] { "TestMap" });
diff --git a/test/jake2/render/TestRenderer.java b/test/jake2/render/TestRenderer.java
index 3c0bb7f..f12edd6 100644
--- a/test/jake2/render/TestRenderer.java
+++ b/test/jake2/render/TestRenderer.java
@@ -72,9 +72,7 @@ public class TestRenderer {
void init() {
Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
- Jake2.Q2Dialog = new Q2DataDialog();
- Locale.setDefault(Locale.US);
- Jake2.Q2Dialog.setVisible(true);
+ Q2TestDataUtil.initQ2DataTool();
String DRIVER = "joglgl2";