aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2010-11-24 14:13:26 -0800
committerAndroid Code Review <code-review@android.com>2010-11-24 14:13:26 -0800
commit13d8e868bfdae8a4ed15059144e210d9e995c606 (patch)
treee06a7bf81247d10e979583a53ce7369c9a4acb5f
parent760c9781599d751ab375981a197177ffe1ab8d7d (diff)
parentccabacfacfcc90e1725f0342b2e6d273d0bc744e (diff)
downloadsdk-13d8e868bfdae8a4ed15059144e210d9e995c606.zip
sdk-13d8e868bfdae8a4ed15059144e210d9e995c606.tar.gz
sdk-13d8e868bfdae8a4ed15059144e210d9e995c606.tar.bz2
Merge "Unit test fixes"
-rw-r--r--eclipse/dictionary.txt1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java (renamed from eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbstractLayoutRuleTest.java)10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java2
-rwxr-xr-xsdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java6
9 files changed, 17 insertions, 12 deletions
diff --git a/eclipse/dictionary.txt b/eclipse/dictionary.txt
index 20ab93c..2a98805 100644
--- a/eclipse/dictionary.txt
+++ b/eclipse/dictionary.txt
@@ -145,6 +145,7 @@ traceview
ui
uncomment
undescribed
+unicode
uninstall
uninstallation
uninstalling
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java
index 7853410..ee2fcc7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java
@@ -21,7 +21,7 @@ import com.android.ide.common.api.Point;
import com.android.ide.common.api.Rect;
/** Test the {@link AbsoluteLayoutRule} */
-public class AbsoluteLayoutRuleTest extends AbstractLayoutRuleTest {
+public class AbsoluteLayoutRuleTest extends LayoutTestBase {
// Utility for other tests
protected INode dragInto(Rect dragBounds, Point dragPoint, int insertIndex, int currentIndex,
String... graphicsFragments) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java
index dad1420..8ac6c58 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java
@@ -31,7 +31,7 @@ import java.util.Set;
// TODO: Check equals() but not == strings by using new String("") to prevent interning
// TODO: Rename BaseLayout to BaseLayoutRule, and tests too of course
-public class BaseLayoutTest extends AbstractLayoutRuleTest {
+public class BaseLayoutTest extends LayoutTestBase {
/** Provides test data used by other test cases */
private IDragElement[] createSampleElements() {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java
index 2adf4f0..d84a2c0 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/FrameLayoutRuleTest.java
@@ -21,7 +21,7 @@ import com.android.ide.common.api.Point;
import com.android.ide.common.api.Rect;
/** Test the {@link FrameLayoutRule} */
-public class FrameLayoutRuleTest extends AbstractLayoutRuleTest {
+public class FrameLayoutRuleTest extends LayoutTestBase {
// Utility for other tests
protected void dragInto(Rect dragBounds, Point dragPoint, int insertIndex, int currentIndex,
String... graphicsFragments) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbstractLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java
index 96cdbb6..be3c196 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbstractLayoutRuleTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java
@@ -34,9 +34,9 @@ import junit.framework.TestCase;
/**
* Common layout helpers from LayoutRule tests
*/
-public abstract class AbstractLayoutRuleTest extends TestCase {
- public static String ANDROID_URI = BaseLayout.ANDROID_URI;
- public static String ATTR_ID = BaseLayout.ATTR_ID;
+public abstract class LayoutTestBase extends TestCase {
+ public static String ANDROID_URI = BaseView.ANDROID_URI;
+ public static String ATTR_ID = BaseView.ATTR_ID;
/**
* Helper function used by tests to drag a button into a canvas containing
@@ -52,7 +52,7 @@ public abstract class AbstractLayoutRuleTest extends TestCase {
* dropping at the dropPoint
* @param currentIndex If the dragged widget is already in the canvas this
* should be its child index; if not, pass in -1
- * @param graphicshicsFragments This is a varargs array of String fragments
+ * @param graphicsFragments This is a varargs array of String fragments
* we expect to see in the graphics output on the drag over
* event.
* @return The inserted node
@@ -151,6 +151,8 @@ public abstract class AbstractLayoutRuleTest extends TestCase {
/**
* Utility method for asserting that two collections contain exactly the
* same elements (regardless of order)
+ * @param expected expected collection
+ * @param actual actual collection
*/
public static void assertContainsSame(Collection<String> expected, Collection<String> actual) {
if (expected.size() != actual.size()) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
index 9796104..489d12c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java
@@ -29,7 +29,7 @@ import com.android.ide.common.api.MenuAction.Choices;
import java.util.List;
/** Test the {@link LinearLayoutRule} */
-public class LinearLayoutRuleTest extends AbstractLayoutRuleTest {
+public class LinearLayoutRuleTest extends LayoutTestBase {
// Utility for other tests
protected void dragIntoEmpty(Rect dragBounds) {
boolean haveBounds = dragBounds.isValid();
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java
index cc47df1..0ebec70 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java
@@ -24,7 +24,7 @@ import java.util.ArrayList;
import java.util.List;
/** Test the {@link RelativeLayoutRule} */
-public class RelativeLayoutRuleTest extends AbstractLayoutRuleTest {
+public class RelativeLayoutRuleTest extends LayoutTestBase {
// Utility for other tests
protected INode dragInto(Rect dragBounds, Point dragPoint, Point secondDragPoint,
int insertIndex, int currentIndex, String... graphicsFragments) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java
index ee08633..c20f550 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/ZoomControlsRuleTest.java
@@ -22,7 +22,7 @@ import com.android.ide.common.api.INode;
import com.android.ide.common.api.Rect;
/** Test the {@link ZoomControlsRule} */
-public class ZoomControlsRuleTest extends AbstractLayoutRuleTest {
+public class ZoomControlsRuleTest extends LayoutTestBase {
public void testDoNothing() {
String draggedButtonId = "@+id/DraggedButton";
diff --git a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java
index 67cd7ba..3f2bb84 100755
--- a/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java
+++ b/sdkmanager/libs/sdklib/tests/com/android/sdklib/internal/repository/AddonsListFetcherTest.java
@@ -112,8 +112,10 @@ public class AddonsListFetcherTest extends TestCase {
assertEquals("My Example Add-ons.", result[0].getUiName());
assertEquals("http://www.example.com/my_addons.xml", result[0].getUrl());
- // The XML file is UTF-8 so we support character sets
- assertEquals("ありがとうございます。", result[1].getUiName());
+ // The XML file is UTF-8 so we support character sets (but the Java source file is
+ // not, so we use the \\u notation to create the Unicode String)
+ assertEquals("\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002",
+ result[1].getUiName());
assertEquals("http://www.example.co.jp/addons.xml", result[1].getUrl());
assertEquals("Example of directory URL.", result[2].getUiName());