diff options
author | Thanh Le <thanhle@google.com> | 2012-11-19 11:54:15 -0800 |
---|---|---|
committer | Thanh Le <thanhle@google.com> | 2012-11-19 13:01:19 -0800 |
commit | 5478840ad89ace2474b9b4d3ab14b92d9e06bf47 (patch) | |
tree | 9a82697e2169f372695a3d8b05dd1e8fca7a5533 /library | |
parent | d85b547e0ddff955a8196abca0cabbdad2b57651 (diff) | |
download | uiautomator-5478840ad89ace2474b9b4d3ab14b92d9e06bf47.tar.gz |
Fixes lint errors in ui automator.
There are no functional change, but please double check the
javadoc, and feel free to make suggestions while i'm in
there.
Change-Id: Ia3c126736242624c4d7ab8d83e66f2a68b8eb1d5
Diffstat (limited to 'library')
10 files changed, 63 insertions, 64 deletions
diff --git a/library/src/com/android/uiautomator/core/AccessibilityNodeInfoDumper.java b/library/src/com/android/uiautomator/core/AccessibilityNodeInfoDumper.java index 65fcd28..10878e3 100644 --- a/library/src/com/android/uiautomator/core/AccessibilityNodeInfoDumper.java +++ b/library/src/com/android/uiautomator/core/AccessibilityNodeInfoDumper.java @@ -63,7 +63,8 @@ public class AccessibilityNodeInfoDumper { /** * Using {@link AccessibilityNodeInfo} this method will walk the layout hierarchy * and generates an xml dump to the location specified by <code>dumpFile</code> - * @param info + * @param root The root accessibility node. + * @param dumpFile The file to dump to. */ public static void dumpWindowToFile(AccessibilityNodeInfo root, File dumpFile) { if (root == null) { @@ -137,11 +138,11 @@ public class AccessibilityNodeInfoDumper { * only reduce noise from standard layout classes that may be falsely * configured to accept clicks and are also enabled. * - * @param n - * @return + * @param node + * @return true if node is excluded. */ - private static boolean nafExcludedClass(AccessibilityNodeInfo n) { - String className = safeCharSeqToString(n.getClassName()); + private static boolean nafExcludedClass(AccessibilityNodeInfo node) { + String className = safeCharSeqToString(node.getClassName()); for(String excludedClassName : NAF_EXCLUDED_CLASSES) { if(className.endsWith(excludedClassName)) return true; @@ -183,7 +184,7 @@ public class AccessibilityNodeInfoDumper { * considered by this dumper as acceptable for accessibility. * * @param node - * @return + * @return false if node fails the check. */ private static boolean childNafCheck(AccessibilityNodeInfo node) { int childCount = node.getChildCount(); diff --git a/library/src/com/android/uiautomator/core/InteractionController.java b/library/src/com/android/uiautomator/core/InteractionController.java index 5ba090b..0fc6466 100644 --- a/library/src/com/android/uiautomator/core/InteractionController.java +++ b/library/src/com/android/uiautomator/core/InteractionController.java @@ -162,7 +162,7 @@ class InteractionController { * @param timeout * @param waitForAll boolean to indicate whether to wait for any or all events * @param eventTypes mask - * @return + * @return true if events are received, else false if timeout. */ public boolean clickAndWaitForEvents(final int x, final int y, long timeout, boolean waitForAll, int eventTypes) { @@ -255,14 +255,14 @@ class InteractionController { * * Most key presses will cause some UI change to occur. If the device is busy, this will * block until the device begins to process the key press at which point the call returns - * and normal wait for idle processing may begin. If no evens are detected for the + * and normal wait for idle processing may begin. If no events are detected for the * timeout period specified, the call will return anyway with false. * * @param keyCode * @param metaState * @param eventType * @param timeout - * @return + * @return true if events is received, otherwise false. */ public boolean sendKeyAndWaitForEvent(final int keyCode, final int metaState, final int eventType, long timeout) { @@ -291,7 +291,7 @@ class InteractionController { * that require stressing the target. * @param x * @param y - * @return + * @return true if the click executed successfully */ public boolean click(int x, int y) { Log.d(LOG_TAG, "click (" + x + ", " + y + ")"); @@ -428,7 +428,7 @@ class InteractionController { * @param upX * @param upY * @param steps - * @return + * @return true if the swipe executed successfully */ public boolean swipe(int downX, int downY, int upX, int upY, int steps) { boolean ret = false; diff --git a/library/src/com/android/uiautomator/core/QueryController.java b/library/src/com/android/uiautomator/core/QueryController.java index d2938ac..f14b017 100644 --- a/library/src/com/android/uiautomator/core/QueryController.java +++ b/library/src/com/android/uiautomator/core/QueryController.java @@ -23,10 +23,8 @@ import android.view.accessibility.AccessibilityNodeInfo; import com.android.uiautomator.core.UiAutomatorBridge.AccessibilityEventListener; /** - * The QuertController main purpose is to translate a {@link UiSelector} selectors to - * {@link AccessibilityNodeInfo}. This is all this controller does. It is typically - * created in conjunction with a {@link InteractionController} by {@link UiAutomationContext} - * which owns both. {@link UiAutomationContext} is used by {@link UiBase} classes. + * The QueryController main purpose is to translate a {@link UiSelector} selectors to + * {@link AccessibilityNodeInfo}. This is all this controller does. */ class QueryController { @@ -88,7 +86,6 @@ class QueryController { * Returns the last text selection reported by accessibility * event TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY. One way to cause * this event is using a DPad arrows to focus on UI elements. - * @return */ public String getLastTraversedText() { mUiAutomatorBridge.waitForIdle(); @@ -115,7 +112,7 @@ class QueryController { mPatternCounter = 0; mPatternIndexer = 0; mLogIndent = 0; - mLogParentIndent = 0;; + mLogParentIndent = 0; } /** @@ -134,7 +131,7 @@ class QueryController { /** * Main search method for translating By selectors to AccessibilityInfoNodes * @param selector - * @return + * @return AccessibilityNodeInfo */ public AccessibilityNodeInfo findAccessibilityNodeInfo(UiSelector selector) { return findAccessibilityNodeInfo(selector, false); @@ -212,7 +209,7 @@ class QueryController { * @param selector * @param fromNode * @param isCounting - * @return + * @return AccessibilityNodeInfo */ private AccessibilityNodeInfo translateCompoundSelector(UiSelector selector, AccessibilityNodeInfo fromNode, boolean isCounting) { @@ -282,7 +279,6 @@ class QueryController { * <p/> * @param selector * @param fromNode - * @param index * @return AccessibilityNodeInfo if found else null */ private AccessibilityNodeInfo translateReqularSelector(UiSelector selector, @@ -369,7 +365,7 @@ class QueryController { * until the end of the tree. * @param subSelector * @param fromNode - * @param originalPattern + * @param isCounting * @return null of node is not found or if counting mode is true. * See {@link #translateCompoundSelector(UiSelector, AccessibilityNodeInfo, boolean)} */ diff --git a/library/src/com/android/uiautomator/core/UiDevice.java b/library/src/com/android/uiautomator/core/UiDevice.java index 09d8af3..7afc485 100644 --- a/library/src/com/android/uiautomator/core/UiDevice.java +++ b/library/src/com/android/uiautomator/core/UiDevice.java @@ -404,8 +404,8 @@ public class UiDevice { * @param timeout in milliseconds * @since API Level 16 */ - public void waitForIdle(long time) { - mUiAutomationBridge.waitForIdle(time); + public void waitForIdle(long timeout) { + mUiAutomationBridge.waitForIdle(timeout); } /** @@ -448,7 +448,6 @@ public class UiDevice { * * See {@link #registerWatcher(String, UiWatcher)} * @param name used to register the UiWatcher - * @throws UiAutomationException * @since API Level 16 */ public void removeWatcher(String name) { @@ -546,7 +545,6 @@ public class UiDevice { /** * Returns the current rotation of the display, as defined in {@link Surface} - * @return * @since API Level 17 */ public int getDisplayRotation() { diff --git a/library/src/com/android/uiautomator/core/UiObject.java b/library/src/com/android/uiautomator/core/UiObject.java index 42819e2..adacf39 100644 --- a/library/src/com/android/uiautomator/core/UiObject.java +++ b/library/src/com/android/uiautomator/core/UiObject.java @@ -147,7 +147,6 @@ public class UiObject { * Uses the member UiSelector properties to find a matching UI element reported in * the accessibility hierarchy. * - * @param selector {@link UiSelector} * @param timeout in milliseconds * @return AccessibilityNodeInfo if found else null * @since API Level 16 @@ -181,8 +180,8 @@ public class UiObject { /** * Perform the action on the UI element that is represented by this UiObject. Also see - * {@link #scrollToBeginning(int)}, {@link #scrollToEnd(int)}, {@link #scrollBackward()}, - * {@link #scrollForward()}. + * {@link UiScrollable#scrollToBeginning(int)}, {@link UiScrollable#scrollToEnd(int)}, + * {@link UiScrollable#scrollBackward()}, {@link UiScrollable#scrollForward()}. * * @param steps indicates the number of injected move steps into the system. Steps are * injected about 5ms apart. So a 100 steps may take about 1/2 second to complete. @@ -201,10 +200,11 @@ public class UiObject { /** * Perform the action on the UI element that is represented by this object, Also see - * {@link #scrollToBeginning(int)}, {@link #scrollToEnd(int)}, {@link #scrollBackward()}, - * {@link #scrollForward()}. This method will perform the swipe gesture over any - * surface. The targeted UI element does not need to have the attribute - * <code>scrollable</code> set to <code>true</code> for this operation to be performed. + * {@link UiScrollable#scrollToBeginning(int)}, {@link UiScrollable#scrollToEnd(int)}, + * {@link UiScrollable#scrollBackward()}, {@link UiScrollable#scrollForward()}. This method will + * perform the swipe gesture over any surface. The targeted UI element does not need to have + * the attribute <code>scrollable</code> set to <code>true</code> for this operation to be + * performed. * * @param steps indicates the number of injected move steps into the system. Steps are * injected about 5ms apart. So a 100 steps may take about 1/2 second to complete. @@ -223,10 +223,11 @@ public class UiObject { /** * Perform the action on the UI element that is represented by this object. Also see - * {@link #scrollToBeginning(int)}, {@link #scrollToEnd(int)}, {@link #scrollBackward()}, - * {@link #scrollForward()}. This method will perform the swipe gesture over any - * surface. The targeted UI element does not need to have the attribute - * <code>scrollable</code> set to <code>true</code> for this operation to be performed. + * {@link UiScrollable#scrollToBeginning(int)}, {@link UiScrollable#scrollToEnd(int)}, + * {@link UiScrollable#scrollBackward()}, {@link UiScrollable#scrollForward()}. This method will + * perform the swipe gesture over any surface. The targeted UI element does not need to have the + * attribute <code>scrollable</code> set to <code>true</code> for this operation to be + * performed. * * @param steps indicates the number of injected move steps into the system. Steps are * injected about 5ms apart. So a 100 steps may take about 1/2 second to complete. @@ -244,10 +245,11 @@ public class UiObject { /** * Perform the action on the UI element that is represented by this object. Also see - * {@link #scrollToBeginning(int)}, {@link #scrollToEnd(int)}, {@link #scrollBackward()}, - * {@link #scrollForward()}. This method will perform the swipe gesture over any - * surface. The targeted UI element does not need to have the attribute - * <code>scrollable</code> set to <code>true</code> for this operation to be performed. + * {@link UiScrollable#scrollToBeginning(int)}, {@link UiScrollable#scrollToEnd(int)}, + * {@link UiScrollable#scrollBackward()}, {@link UiScrollable#scrollForward()}. This method will + * perform the swipe gesture over any surface. The targeted UI element does not need to have the + * attribute <code>scrollable</code> set to <code>true</code> for this operation to be + * performed. * * @param steps indicates the number of injected move steps into the system. Steps are * injected about 5ms apart. So a 100 steps may take about 1/2 second to complete. @@ -299,7 +301,7 @@ public class UiObject { * adjustments should be made to the click coordinates. * * @param node - * @return + * @return The accessibility node info. */ private AccessibilityNodeInfo getScrollableParent(AccessibilityNodeInfo node) { AccessibilityNodeInfo parent = node; @@ -373,7 +375,7 @@ public class UiObject { * Clicks the top and left corner of the UI element * * @return true on success - * @throws Exception + * @throws UiObjectNotFoundException * @since API Level 16 */ public boolean clickTopLeft() throws UiObjectNotFoundException { @@ -405,7 +407,7 @@ public class UiObject { * Clicks the bottom and right corner of the UI element * * @return true on success - * @throws Exception + * @throws UiObjectNotFoundException * @since API Level 16 */ public boolean clickBottomRight() throws UiObjectNotFoundException { @@ -697,7 +699,7 @@ public class UiObject { * * @return Rect * @throws UiObjectNotFoundException - * @see {@link #getBound()} + * @see {@link #getBounds()} * @since API Level 17 */ public Rect getVisibleBounds() throws UiObjectNotFoundException { diff --git a/library/src/com/android/uiautomator/core/UiScrollable.java b/library/src/com/android/uiautomator/core/UiScrollable.java index 607ae6f..710c559 100644 --- a/library/src/com/android/uiautomator/core/UiScrollable.java +++ b/library/src/com/android/uiautomator/core/UiScrollable.java @@ -265,10 +265,11 @@ public class UiScrollable extends UiCollection { } /** - * {@link #getChildByDescription(String, boolean)} and {@link #getChildByText(String, boolean)} - * use an arguments that specifies if scrolling is allowed while searching for the UI element. - * The number of scrolls allowed to perform a search can be modified by this method. - * The current value can be read by calling {@link #getMaxSearchSwipes()} + * {@link #getChildByDescription(UiSelector, String)} and + * {@link #getChildByText(UiSelector, String)} use an arguments that specifies if scrolling is + * allowed while searching for the UI element. The number of scrolls allowed to perform a + * search can be modified by this method. The current value can be read by calling + * {@link #getMaxSearchSwipes()} * * @param swipes is the number of search swipes until abort * @return reference to itself @@ -280,9 +281,10 @@ public class UiScrollable extends UiCollection { } /** - * {@link #getChildByDescription(String, boolean)} and {@link #getChildByText(String, boolean)} - * use an arguments that specifies if scrolling is allowed while searching for the UI element. - * The number of scrolls currently allowed to perform a search can be read by this method. + * {@link #getChildByDescription(UiSelector, String)} and + * {@link #getChildByText(UiSelector, String)} use an arguments that specifies if scrolling is + * allowed while searching for the UI element. The number of scrolls currently allowed to + * perform a search can be read by this method. * See {@link #setMaxSearchSwipes(int)} * * @return max value of the number of swipes currently allowed during a scroll search @@ -329,7 +331,7 @@ public class UiScrollable extends UiCollection { if(node == null) { throw new UiObjectNotFoundException(getSelector().toString()); } - Rect rect = new Rect();; + Rect rect = new Rect(); node.getBoundsInScreen(rect); int downX = 0; @@ -395,7 +397,7 @@ public class UiScrollable extends UiCollection { if (node == null) { throw new UiObjectNotFoundException(getSelector().toString()); } - Rect rect = new Rect();; + Rect rect = new Rect(); node.getBoundsInScreen(rect); int downX = 0; @@ -488,7 +490,7 @@ public class UiScrollable extends UiCollection { } /** - * See {@link UiScrollable#scrollToEnd(int, int) + * See {@link UiScrollable#scrollToEnd(int, int)} * * @param maxSwipes * @return true on scrolled else false diff --git a/library/src/com/android/uiautomator/core/UiSelector.java b/library/src/com/android/uiautomator/core/UiSelector.java index d240ce9..8963c38 100644 --- a/library/src/com/android/uiautomator/core/UiSelector.java +++ b/library/src/com/android/uiautomator/core/UiSelector.java @@ -121,7 +121,7 @@ public class UiSelector { * The text for the widget must match exactly * with the string in your input argument. * - * @param regular expression + * @param regex a regular expression * @return UiSelector with the specified search criteria * @since API Level 17 */ @@ -176,7 +176,7 @@ public class UiSelector { * Set the search criteria to match the class property * for a widget (for example, "android.widget.Button"). * - * @param regular expression + * @param regex a regular expression * @return UiSelector with the specified search criteria * @since API Level 17 */ @@ -188,7 +188,7 @@ public class UiSelector { * Set the search criteria to match the class property * for a widget (for example, "android.widget.Button"). * - * @param class type + * @param type type * @return UiSelector with the specified search criteria * @since API Level 17 */ @@ -228,7 +228,7 @@ public class UiSelector { * for the widget must match exactly * with the string in your input argument. * - * @param regular expression + * @param regex a regular expression * @return UiSelector with the specified search criteria * @since API Level 17 */ @@ -529,7 +529,7 @@ public class UiSelector { * Set the search criteria to match the package name * of the application that contains the widget. * - * @param regular expression + * @param regex a regular expression * @return UiSelector with the specified search criteria * @since API Level 17 */ diff --git a/library/src/com/android/uiautomator/testrunner/IAutomationSupport.java b/library/src/com/android/uiautomator/testrunner/IAutomationSupport.java index bea9e9a..f0c60d2 100644 --- a/library/src/com/android/uiautomator/testrunner/IAutomationSupport.java +++ b/library/src/com/android/uiautomator/testrunner/IAutomationSupport.java @@ -28,7 +28,8 @@ public interface IAutomationSupport { /** * Allows the running test cases to send out interim status * - * @param bundle status report, consisting of key value pairs + * @param resultCode + * @param status status report, consisting of key value pairs * @since API Level 16 */ public void sendStatus(int resultCode, Bundle status); diff --git a/library/src/com/android/uiautomator/testrunner/TestCaseCollector.java b/library/src/com/android/uiautomator/testrunner/TestCaseCollector.java index ae27838..8bc9914 100644 --- a/library/src/com/android/uiautomator/testrunner/TestCaseCollector.java +++ b/library/src/com/android/uiautomator/testrunner/TestCaseCollector.java @@ -59,7 +59,7 @@ public class TestCaseCollector { * * The class name may be in "<class name>#<method name>" format * - * @param classNames classes must be subclass of {@link UiAutomatorTestCase} + * @param className classes must be subclass of {@link UiAutomatorTestCase} * @throws ClassNotFoundException */ public void addTestClass(String className) throws ClassNotFoundException { @@ -96,8 +96,7 @@ public class TestCaseCollector { /** * Gets the list of added test cases so far - * - * @return + * @return a list of {@link TestCase} */ public List<TestCase> getTestCases() { return Collections.unmodifiableList(mTestCases); diff --git a/library/src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java b/library/src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java index 926bff7..e7d961b 100644 --- a/library/src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java +++ b/library/src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java @@ -85,7 +85,7 @@ public class UiAutomatorTestCase extends TestCase { /** * Provides support for running tests to report interim status * - * @return + * @return IAutomationSupport * @since API Level 16 */ public IAutomationSupport getAutomationSupport() { |