aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2010-11-24 09:27:54 -0800
committerTor Norbye <tnorbye@google.com>2010-11-24 09:28:52 -0800
commitccabacfacfcc90e1725f0342b2e6d273d0bc744e (patch)
treee06a7bf81247d10e979583a53ce7369c9a4acb5f /eclipse/plugins
parent760c9781599d751ab375981a197177ffe1ab8d7d (diff)
downloadsdk-ccabacfacfcc90e1725f0342b2e6d273d0bc744e.zip
sdk-ccabacfacfcc90e1725f0342b2e6d273d0bc744e.tar.gz
sdk-ccabacfacfcc90e1725f0342b2e6d273d0bc744e.tar.bz2
Unit test fixes
First, the AddonsListFetcherTest#testLoadSample_1 was failing on the Mac, because the source code contained non-ASCII unicode characters, and the encoding differs between Windows, Linux and Mac -- and on the Mac the characters were garbage (not the intended Japanese characters). Fixed by using unicode escape sequences to define the expected output instead. Second, rename the AbstractLayoutTest to LayoutTestBase; the test runner (for plugins, not unit tests) was assuming this was a test case (even though it's an abstract class!) so it was emitting a warning about the class containing no test cases. This is simply a base class for all the individual layout tests defining a bunch of useful inherited shared behavior, so rename to avoid the warning. Change-Id: I6e29316c5644db35051218aef8b99ac41ab0cda4
Diffstat (limited to 'eclipse/plugins')
-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
7 files changed, 12 insertions, 10 deletions
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";