ICU-13239 moves to its own file a currently disabled test and re-enable test.
X-SVN-Rev: 40215
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java
index ddfd80c..14de333 100644
--- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java
@@ -241,34 +241,6 @@
}
}
- /**
- * @author markdavis
- *
- */
- // TODO(junit): resolve
-// public static void main(String[] args) {
-// //generateConstants(); if (true) return;
-//
-// // Ticket #12034 deadlock on multi-threaded static init of MeasureUnit.
-// // The code below reliably deadlocks with ICU 56.
-// // The test is here in main() rather than in a test function so it can be made to run
-// // before anything else.
-// Thread thread = new Thread() {
-// @Override
-// public void run() {
-// @SuppressWarnings("unused")
-// Set<String> measureUnitTypes = MeasureUnit.getAvailableTypes();
-// }
-// };
-// thread.start();
-// @SuppressWarnings("unused")
-// Currency cur = Currency.getInstance(ULocale.ENGLISH);
-// try {thread.join();} catch(InterruptedException e) {};
-// // System.out.println("Done with MeasureUnit thread test.");
-//
-// new MeasureUnitTest().run(args);
-// }
-
/*
@Test
public void testZZZ() {
diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitThreadTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitThreadTest.java
new file mode 100644
index 0000000..e78f1cb
--- /dev/null
+++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitThreadTest.java
@@ -0,0 +1,31 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html#License
+
+package com.ibm.icu.dev.test.format;
+
+import org.junit.Test;
+
+import com.ibm.icu.dev.test.TestFmwk;
+import com.ibm.icu.util.Currency;
+import com.ibm.icu.util.MeasureUnit;
+import com.ibm.icu.util.ULocale;
+
+public class MeasureUnitThreadTest extends TestFmwk {
+
+ @Test
+ public void MUThreadTest() {
+ // Ticket #12034 deadlock on multi-threaded static init of MeasureUnit.
+ // The code below reliably deadlocks with ICU 56.
+ // The test is here in its own file so it can be made to run independent of anything else.
+ Thread thread = new Thread() {
+ @Override
+ public void run() {
+ MeasureUnit.getAvailableTypes();
+ }
+ };
+ thread.start();
+ Currency.getInstance(ULocale.ENGLISH);
+ try {thread.join();} catch(InterruptedException e) {};
+ }
+}
+