Skip to content

Commit

Permalink
Migrate java base tests to j2objc/ directory to avoid confusion
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 567016926
  • Loading branch information
Yuxi Sun authored and copybara-github committed Sep 20, 2023
1 parent 0273fba commit 4049398
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package java.lang;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down Expand Up @@ -31,6 +30,8 @@
* limitations under the License.
*/

package j2objc.java.lang;

import junit.framework.TestCase;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,23 @@
* limitations under the License.
*/

package java.lang.ref;
package j2objc.java.lang.ref;

import com.google.j2objc.annotations.AutoreleasePool;

import java.lang.ref.PhantomReference;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import junit.framework.TestCase;

import org.junit.Test;

import static org.junit.Assert.*;

/**
* iOS-specific unit test for {@link PhantomReference}. The Android and
* Apache Harmony tests can't be reused because they assume GC behavior.
* This class uses autorelease pools to manage when references have
* phantom referents.
* iOS-specific unit test for {@link PhantomReference}. The Android and Apache Harmony tests can't
* be reused because they assume GC behavior. This class uses autorelease pools to manage when
* references have phantom referents.
*
* @author Tom Ball
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
* limitations under the License.
*/

package java.lang.ref;
package j2objc.java.lang.ref;

import com.google.j2objc.annotations.AutoreleasePool;

import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import junit.framework.TestCase;

import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@
* limitations under the License.
*/

package java.lang.ref;
package j2objc.java.lang.ref;

import com.google.j2objc.annotations.AutoreleasePool;

import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import junit.framework.TestCase;

import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
* limitations under the License.
*/

package java.lang.reflect;
package j2objc.java.lang.reflect;

import java.lang.reflect.Method;
import junit.framework.TestCase;

import java.util.AbstractList;
Expand All @@ -41,7 +42,9 @@ private static boolean isSynthetic(Method m) {
public void testGenericMethodWithConcreteTypeArgument() throws Exception {
for (Method m : MyList.class.getDeclaredMethods()) {
if (m.getName().equals("add") && !isSynthetic(m)) {
assertEquals("public boolean java.lang.reflect.MethodTest$MyList.add(java.lang.String)",
assertEquals(
"public boolean"
+ " j2objc.java.lang.reflect.MethodTest$MyList.add(java.lang.String)",
m.toString());
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
* limitations under the License.
*/

package java.util;
package j2objc.java.util;

import com.google.j2objc.annotations.AutoreleasePool;
import java.util.ArrayList;
import java.util.HashMap;
import junit.framework.TestCase;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
* limitations under the License.
*/

package java.util;
package j2objc.java.util;

import java.util.Map;
import java.util.TreeMap;
import junit.framework.TestCase;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
* limitations under the License.
*/

package java.util;
package j2objc.java.util;

import com.google.j2objc.annotations.AutoreleasePool;

import java.util.WeakHashMap;
import junit.framework.TestCase;

import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
* limitations under the License.
*/

package java.util.regex;
package j2objc.java.util.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import junit.framework.TestCase;

/**
Expand Down
18 changes: 9 additions & 9 deletions jre_emul/test_sources.mk
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,7 @@ NATIVE_SOURCES = dalvik_system_JniTest.cpp
# com/google/j2objc/security/IosSecureRandomImplTest.java \
# com/google/j2objc/util/NativeTimeZoneTest.java \
# dalvik/system/JniTest.java \
# java/lang/SystemTest.java \
# java/lang/ref/PhantomReferenceTest.java \
# java/lang/ref/SoftReferenceTest.java \
# java/lang/ref/WeakReferenceTest.java \
# java/lang/reflect/MethodTest.java \
# java/nio/file/attribute/FileTimeTest.java \
# java/util/HashMapTest.java \
# java/util/TreeMapTest.java \
# java/util/WeakHashMapTest.java \
# java/util/regex/MatcherTest.java \
# libcore/icu/NativeDecimalFormatTest.java \
# libcore/io/PosixTest.java \
# libcore/java/io/ObjectOutputStreamTest.java \
Expand Down Expand Up @@ -446,6 +437,15 @@ TEST_SOURCES := \
jsr166/TreeSubMapTest.java \
jsr166/TreeSubSetTest.java \
j2objc/java/io/FileTest.java \
j2objc/java/lang/SystemTest.java \
j2objc/java/lang/ref/PhantomReferenceTest.java \
j2objc/java/lang/ref/SoftReferenceTest.java \
j2objc/java/lang/ref/WeakReferenceTest.java \
j2objc/java/lang/reflect/MethodTest.java \
j2objc/java/util/HashMapTest.java \
j2objc/java/util/TreeMapTest.java \
j2objc/java/util/WeakHashMapTest.java \
j2objc/java/util/regex/MatcherTest.java \
libcore/java/awt/font/TextAttributeTest.java \
libcore/java/io/CharArrayWriterTest.java \
libcore/java/io/DataOutputStreamTest.java \
Expand Down

0 comments on commit 4049398

Please sign in to comment.