├── .buildscript └── deploy_snapshot.sh ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── RELEASING.md ├── assertj-android-appcompat-v7 ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── appcompat │ └── v7 │ └── api │ ├── Assertions.java │ ├── app │ ├── ActionBarAssert.java │ ├── ActionBarDisplayOptions.java │ └── ActionBarNavigationMode.java │ ├── view │ └── ActionModeAssert.java │ └── widget │ ├── AbstractLinearLayoutCompatAssert.java │ ├── LinearLayoutCompatAssert.java │ └── SearchViewAssert.java ├── assertj-android-cardview-v7 ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── cardview │ └── v7 │ └── api │ ├── Assertions.java │ └── widget │ └── CardViewAssert.java ├── assertj-android-design ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── design │ └── api │ ├── Assertions.java │ └── widget │ ├── NavigationViewAssert.java │ ├── SnackbarAssert.java │ ├── TabAssert.java │ ├── TabGravity.java │ ├── TabLayoutAssert.java │ ├── TabMode.java │ └── TextInputLayoutAssert.java ├── assertj-android-gridlayout-v7 ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── gridlayout │ └── v7 │ └── api │ ├── Assertions.java │ └── widget │ ├── GridLayoutAlignmentMode.java │ ├── GridLayoutAssert.java │ └── GridLayoutOrientation.java ├── assertj-android-mediarouter-v7 ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── mediarouter │ └── v7 │ └── api │ ├── Assertions.java │ └── media │ ├── MediaItemStatusAssert.java │ ├── MediaItemStatusPlaybackState.java │ ├── MediaRouteDescriptorAssert.java │ ├── MediaRouteDiscoveryRequestAssert.java │ ├── MediaRouteProviderProviderMetadataAssert.java │ ├── MediaRouterProviderInfoAssert.java │ ├── MediaRouterRouteInfoAssert.java │ ├── MediaSessionStatusAssert.java │ ├── MediaSessionStatusState.java │ └── RemotePlaybackClientAssert.java ├── assertj-android-palette-v7 ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── palette │ └── v7 │ └── api │ ├── Assertions.java │ └── graphics │ ├── PaletteAssert.java │ └── PaletteSwatchAssert.java ├── assertj-android-play-services ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── playservices │ └── api │ ├── Assertions.java │ ├── location │ ├── ActivityRecognitionResultAssert.java │ ├── DetectedActivityAssert.java │ ├── DetectedActivityType.java │ └── LocationRequestAssert.java │ └── maps │ ├── CameraPositionAssert.java │ ├── GoogleMapAssert.java │ ├── MarkerAssert.java │ └── UiSettingsAssert.java ├── assertj-android-recyclerview-v7 ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── recyclerview │ └── v7 │ └── api │ ├── Assertions.java │ └── widget │ ├── RecyclerViewAdapterAssert.java │ ├── RecyclerViewAssert.java │ ├── RecyclerViewItemAnimatorAssert.java │ ├── RecyclerViewLayoutManagerAssert.java │ ├── RecyclerViewLayoutParamsAssert.java │ ├── RecyclerViewScrollState.java │ ├── RecyclerViewSmoothScrollerActionAssert.java │ ├── RecyclerViewSmoothScrollerAssert.java │ └── RecyclerViewViewHolderAssert.java ├── assertj-android-support-v4 ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ └── support │ └── v4 │ └── api │ ├── Assertions.java │ ├── app │ ├── AbstractFragmentAssert.java │ ├── ActionBarDrawerToggleAssert.java │ ├── DialogFragmentAssert.java │ ├── FragmentAssert.java │ ├── FragmentManagerAssert.java │ ├── FragmentTransactionAssert.java │ ├── ListFragmentAssert.java │ └── LoaderManagerAssert.java │ ├── content │ ├── AbstractLoaderAssert.java │ ├── CursorLoaderAssert.java │ └── LoaderAssert.java │ ├── media │ └── MediaControllerCompatAssert.java │ ├── print │ ├── PrintHelperAssert.java │ ├── PrintHelperColorMode.java │ ├── PrintHelperOrientation.java │ └── PrintHelperScaleMode.java │ ├── util │ ├── AtomicFileAssert.java │ ├── CircularArrayAssert.java │ ├── LongSparseArrayAssert.java │ ├── LruCacheAssert.java │ └── SparseArrayCompatAssert.java │ ├── view │ ├── PagerAdapterAssert.java │ └── ViewPagerAssert.java │ └── widget │ ├── AbstractCursorAdapterAssert.java │ ├── CursorAdapterAssert.java │ ├── SimpleCursorAdapterAssert.java │ ├── SlidingPaneLayoutAssert.java │ └── SwipeRefreshLayoutAssert.java ├── assertj-android ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── org │ └── assertj │ └── android │ ├── api │ ├── Assertions.java │ ├── accessibilityservice │ │ ├── AccessibilityServiceInfoAssert.java │ │ └── AccessibilityServiceInfoCapabilities.java │ ├── accounts │ │ └── AccountAssert.java │ ├── animation │ │ ├── AbstractAnimatorAssert.java │ │ ├── AbstractValueAnimatorAssert.java │ │ ├── AnimatorAssert.java │ │ ├── AnimatorSetAssert.java │ │ ├── KeyframeAssert.java │ │ ├── ObjectAnimatorAssert.java │ │ ├── PropertyValuesHolderAssert.java │ │ ├── ValueAnimatorAssert.java │ │ └── ValueAnimatorRepeatMode.java │ ├── app │ │ ├── AbstractActivityAssert.java │ │ ├── AbstractDialogAssert.java │ │ ├── AbstractFragmentAssert.java │ │ ├── AbstractListActivityAssert.java │ │ ├── AbstractServiceAssert.java │ │ ├── ActionBarAssert.java │ │ ├── ActionBarDisplayOptions.java │ │ ├── ActionBarNavigationMode.java │ │ ├── ActivityAssert.java │ │ ├── ActivityScreenOrientation.java │ │ ├── DialogAssert.java │ │ ├── DialogFragmentAssert.java │ │ ├── ExpandableListActivityAssert.java │ │ ├── FragmentAssert.java │ │ ├── FragmentManagerAssert.java │ │ ├── FragmentTransactionAssert.java │ │ ├── InstrumentationActivityMonitorAssert.java │ │ ├── InstrumentationActivityResultAssert.java │ │ ├── KeyguardManagerAssert.java │ │ ├── ListActivityAssert.java │ │ ├── ListFragmentAssert.java │ │ ├── LoaderManagerAssert.java │ │ ├── LocalActivityManagerAssert.java │ │ ├── NotificationAssert.java │ │ ├── NotificationFlags.java │ │ ├── NotificationPriority.java │ │ ├── PendingIntentAssert.java │ │ ├── ProgressDialogAssert.java │ │ ├── ServiceAssert.java │ │ ├── TaskStackBuilderAssert.java │ │ └── UiModeManagerAssert.java │ ├── bluetooth │ │ ├── BluetoothClassAssert.java │ │ ├── BluetoothDeviceAssert.java │ │ ├── BluetoothDeviceBondState.java │ │ ├── BluetoothDeviceType.java │ │ ├── BluetoothGattCharacteristicAssert.java │ │ ├── BluetoothGattCharacteristicPermissions.java │ │ ├── BluetoothGattCharacteristicProperties.java │ │ ├── BluetoothGattCharacteristicWriteType.java │ │ ├── BluetoothGattDescriptorAssert.java │ │ ├── BluetoothGattDescriptorPermissions.java │ │ ├── BluetoothGattServiceAssert.java │ │ └── BluetoothGattServiceType.java │ ├── content │ │ ├── AbstractContextAssert.java │ │ ├── AbstractLoaderAssert.java │ │ ├── AbstractSharedPreferencesAssert.java │ │ ├── AsyncTaskLoaderAssert.java │ │ ├── ContentValuesAssert.java │ │ ├── ContentValuesEntry.java │ │ ├── CursorLoaderAssert.java │ │ ├── IntentAssert.java │ │ ├── IntentFlags.java │ │ ├── LoaderAssert.java │ │ ├── SharedPreferencesAssert.java │ │ └── res │ │ │ ├── ConfigurationAssert.java │ │ │ └── ConfigurationUiModeType.java │ ├── database │ │ ├── AbstractAbstractCursorAssert.java │ │ ├── AbstractCursorAssert.java │ │ ├── AbstractCursor_Assert.java │ │ ├── CursorAssert.java │ │ ├── CursorWindowAssert.java │ │ └── sqlite │ │ │ └── SqliteDatabaseAssert.java │ ├── gesture │ │ ├── GestureAssert.java │ │ ├── GestureLibraryAssert.java │ │ ├── GestureOverlayViewAssert.java │ │ ├── GestureOverlayViewGestureStrokeType.java │ │ ├── GestureOverlayViewOrientation.java │ │ ├── GesturePointAssert.java │ │ ├── GestureStoreAssert.java │ │ ├── GestureStrokeAssert.java │ │ ├── OrientedBoundingBoxAssert.java │ │ └── PredictionAssert.java │ ├── graphics │ │ ├── AbstractPaintAssert.java │ │ ├── BitmapAssert.java │ │ ├── BitmapRegionDecoderAssert.java │ │ ├── CameraAssert.java │ │ ├── CanvasAssert.java │ │ ├── InterpolatorAssert.java │ │ ├── MatrixAssert.java │ │ ├── MovieAssert.java │ │ ├── NinePatchAssert.java │ │ ├── PaintAssert.java │ │ ├── PaintFlags.java │ │ ├── PathAssert.java │ │ ├── PathMeasureAssert.java │ │ ├── PictureAssert.java │ │ ├── PointAssert.java │ │ ├── PointFAssert.java │ │ ├── RectAssert.java │ │ ├── RectFAssert.java │ │ ├── RegionAssert.java │ │ ├── TypefaceAssert.java │ │ ├── YuvImageAssert.java │ │ └── drawable │ │ │ ├── AbstractDrawableAssert.java │ │ │ ├── AnimationDrawableAssert.java │ │ │ ├── BitmapDrawableAssert.java │ │ │ ├── ColorDrawableAssert.java │ │ │ ├── DrawableAssert.java │ │ │ ├── GradientDrawableAssert.java │ │ │ ├── LayerDrawableAssert.java │ │ │ ├── TransitionDrawableAssert.java │ │ │ └── shapes │ │ │ └── ShapeAssert.java │ ├── hardware │ │ ├── SensorAssert.java │ │ ├── SensorEventAssert.java │ │ ├── SensorType.java │ │ └── usb │ │ │ ├── UsbAccessoryAssert.java │ │ │ ├── UsbDeviceAssert.java │ │ │ ├── UsbDeviceConnectionAssert.java │ │ │ ├── UsbEndpointAssert.java │ │ │ ├── UsbInterfaceAssert.java │ │ │ └── UsbRequestAssert.java │ ├── inputmethodservice │ │ └── ExtractEditTextAssert.java │ ├── location │ │ ├── AddressAssert.java │ │ ├── CriteriaAccuracy.java │ │ ├── CriteriaAccuracyRequirement.java │ │ ├── CriteriaAssert.java │ │ ├── CriteriaPowerRequirement.java │ │ ├── GpsSatelliteAssert.java │ │ ├── GpsStatusAssert.java │ │ ├── LocationAssert.java │ │ └── LocationProviderAssert.java │ ├── net │ │ └── UriAssert.java │ ├── os │ │ ├── AsyncTaskAssert.java │ │ ├── BundleAssert.java │ │ ├── PowerManagerAssert.java │ │ └── VibratorAssert.java │ ├── preference │ │ ├── AbstractDialogPreferenceAssert.java │ │ ├── AbstractPreferenceAssert.java │ │ ├── AbstractPreferenceGroupAssert.java │ │ ├── AbstractTwoStatePreference.java │ │ ├── CheckBoxPreferenceAssert.java │ │ ├── DialogPreferenceAssert.java │ │ ├── EditTextPreferenceAssert.java │ │ ├── ListPreferenceAssert.java │ │ ├── MultiSelectListPreferenceAssert.java │ │ ├── PreferenceActivityAssert.java │ │ ├── PreferenceAssert.java │ │ ├── PreferenceGroupAssert.java │ │ ├── PreferenceScreenAssert.java │ │ ├── RingtonePreferenceAssert.java │ │ ├── RingtoneType.java │ │ ├── SwitchPreferenceAssert.java │ │ └── TwoStatePreferenceAssert.java │ ├── telephony │ │ ├── AbstractCellSignalStrengthAssert.java │ │ ├── CellIdentityCdmaAssert.java │ │ ├── CellIdentityGsmAssert.java │ │ ├── CellIdentityLteAssert.java │ │ ├── CellIdentityWcdmaAssert.java │ │ ├── CellInfoAssert.java │ │ ├── CellInfoCdmaAssert.java │ │ ├── CellInfoGsmAssert.java │ │ ├── CellInfoLteAssert.java │ │ ├── CellInfoWcdmaAssert.java │ │ ├── CellSignalStrengthCdmaAssert.java │ │ ├── CellSignalStrengthGsmAssert.java │ │ ├── CellSignalStrengthLteAssert.java │ │ ├── CellSignalStrengthWcdmaAssert.java │ │ ├── NeighboringCellInfoAssert.java │ │ ├── ServiceStateAssert.java │ │ ├── ServiceStateState.java │ │ ├── SignalStrengthAssert.java │ │ ├── SmsMessageAssert.java │ │ ├── TelephonyManagerAssert.java │ │ ├── TelephonyManagerCallState.java │ │ ├── TelephonyManagerDataActivity.java │ │ ├── TelephonyManagerDataState.java │ │ ├── TelephonyManagerNetworkType.java │ │ ├── TelephonyManagerPhoneType.java │ │ ├── TelephonyManagerSimState.java │ │ ├── cdma │ │ │ └── CdmaCellLocationAssert.java │ │ └── gsm │ │ │ └── GsmCellLocationAssert.java │ ├── text │ │ └── BidiFormatterAssert.java │ ├── util │ │ ├── ArrayMapAssert.java │ │ ├── AtomicFileAssert.java │ │ ├── AttributeSetAssert.java │ │ ├── DisplayMetricsAssert.java │ │ ├── LongSparseArrayAssert.java │ │ ├── LruCacheAssert.java │ │ ├── PairAssert.java │ │ ├── PropertyAssert.java │ │ ├── SparseArrayAssert.java │ │ ├── SparseBooleanArrayAssert.java │ │ ├── SparseIntArrayAssert.java │ │ └── SparseLongArrayAssert.java │ ├── view │ │ ├── AbstractInputEventAssert.java │ │ ├── AbstractViewAssert.java │ │ ├── AbstractViewGroupAssert.java │ │ ├── AbstractViewGroupLayoutParamsAssert.java │ │ ├── AbstractViewGroupMarginLayoutParamsAssert.java │ │ ├── ActionModeAssert.java │ │ ├── ActionProviderAssert.java │ │ ├── DisplayAssert.java │ │ ├── DisplayFlags.java │ │ ├── DisplayPixelFormat.java │ │ ├── DisplayState.java │ │ ├── DragEventAction.java │ │ ├── DragEventAssert.java │ │ ├── KeyCharacterMapAssert.java │ │ ├── KeyCharacterMapKeyboardType.java │ │ ├── KeyEventAssert.java │ │ ├── MenuAssert.java │ │ ├── MenuItemAssert.java │ │ ├── OrientationEventListenerAssert.java │ │ ├── ScaleGestureDetectorAssert.java │ │ ├── SurfaceAssert.java │ │ ├── SurfaceRotation.java │ │ ├── TextureViewAssert.java │ │ ├── VelocityTrackerAssert.java │ │ ├── ViewAssert.java │ │ ├── ViewConfigurationAssert.java │ │ ├── ViewGroupAssert.java │ │ ├── ViewGroupDescendantFocusability.java │ │ ├── ViewGroupLayoutMode.java │ │ ├── ViewGroupLayoutParamsAssert.java │ │ ├── ViewGroupMarginLayoutParamsAssert.java │ │ ├── ViewGroupPersistentDrawingCache.java │ │ ├── ViewLayerType.java │ │ ├── ViewLayoutDirection.java │ │ ├── ViewOverscrollMode.java │ │ ├── ViewPropertyAnimatorAssert.java │ │ ├── ViewScrollBarPosition.java │ │ ├── ViewScrollBarStyle.java │ │ ├── ViewStubAssert.java │ │ ├── ViewTextAlignment.java │ │ ├── ViewTextDirection.java │ │ ├── ViewTreeObserverAssert.java │ │ ├── ViewVisibility.java │ │ ├── WindowAssert.java │ │ ├── WindowFeature.java │ │ ├── accessibility │ │ │ ├── AbstractAccessibilityRecordAssert.java │ │ │ ├── AccessibilityEventAssert.java │ │ │ ├── AccessibilityManagerAssert.java │ │ │ ├── AccessibilityNodeInfoAssert.java │ │ │ └── AccessibilityRecordAssert.java │ │ └── animation │ │ │ ├── AbstractAnimationAssert.java │ │ │ ├── AbstractLayoutAnimationControllerAssert.java │ │ │ ├── AnimationAssert.java │ │ │ ├── AnimationRepeatMode.java │ │ │ ├── AnimationSetAssert.java │ │ │ ├── GridLayoutAnimationControllerAssert.java │ │ │ ├── GridLayoutAnimationControllerDirection.java │ │ │ ├── GridLayoutAnimationControllerDirectionPriority.java │ │ │ ├── LayoutAnimationControllerAssert.java │ │ │ ├── TransformationAssert.java │ │ │ └── TransformationType.java │ ├── webkit │ │ └── WebViewAssert.java │ └── widget │ │ ├── AbsListViewAssert.java │ │ ├── AbsSeekBarAssert.java │ │ ├── AbsSpinnerAssert.java │ │ ├── AbsoluteLayoutAssert.java │ │ ├── AbstractAbsListViewAssert.java │ │ ├── AbstractAbsSeekBarAssert.java │ │ ├── AbstractAbsSpinnerAssert.java │ │ ├── AbstractAbsoluteLayoutAssert.java │ │ ├── AbstractAdapterAssert.java │ │ ├── AbstractAdapterViewAssert.java │ │ ├── AbstractCompoundButtonAssert.java │ │ ├── AbstractCursorAdapterAssert.java │ │ ├── AbstractFrameLayoutAssert.java │ │ ├── AbstractHorizontalScrollViewAssert.java │ │ ├── AbstractLinearLayoutAssert.java │ │ ├── AbstractListAdapterAssert.java │ │ ├── AbstractListViewAssert.java │ │ ├── AbstractProgressBarAssert.java │ │ ├── AbstractRelativeLayoutAssert.java │ │ ├── AbstractTextViewAssert.java │ │ ├── AbstractViewAnimatorAssert.java │ │ ├── AbstractWrapperListAdapterAssert.java │ │ ├── AdapterAssert.java │ │ ├── AdapterViewAssert.java │ │ ├── ArrayAdapterAssert.java │ │ ├── AutoCompleteTextViewAssert.java │ │ ├── CalendarViewAssert.java │ │ ├── CheckedTextViewAssert.java │ │ ├── ChronometerAssert.java │ │ ├── CompoundButtonAssert.java │ │ ├── CursorAdapterAssert.java │ │ ├── DatePickerAssert.java │ │ ├── ExpandableListViewAssert.java │ │ ├── FrameLayoutAssert.java │ │ ├── GridLayoutAlignmentMode.java │ │ ├── GridLayoutAssert.java │ │ ├── GridLayoutOrientation.java │ │ ├── GridViewAssert.java │ │ ├── GridViewStretchMode.java │ │ ├── HeaderViewListAdapterAssert.java │ │ ├── HorizontalScrollViewAssert.java │ │ ├── ImageViewAssert.java │ │ ├── LinearLayoutAssert.java │ │ ├── LinearLayoutOrientation.java │ │ ├── LinearLayoutShowDividers.java │ │ ├── ListAdapterAssert.java │ │ ├── ListPopupWindowAssert.java │ │ ├── ListPopupWindowInputMethodMode.java │ │ ├── ListViewAssert.java │ │ ├── MediaControllerAssert.java │ │ ├── NumberPickerAssert.java │ │ ├── PopupWindowAssert.java │ │ ├── PopupWindowInputMethodMode.java │ │ ├── ProgressBarAssert.java │ │ ├── RadioGroupAssert.java │ │ ├── RatingBarAssert.java │ │ ├── RelativeLayoutAssert.java │ │ ├── ScrollViewAssert.java │ │ ├── SearchViewAssert.java │ │ ├── SimpleAdapterAssert.java │ │ ├── SimpleCursorAdapterAssert.java │ │ ├── SlidingDrawerAssert.java │ │ ├── SpinnerAssert.java │ │ ├── SwitchAssert.java │ │ ├── TabHostAssert.java │ │ ├── TabWidgetAssert.java │ │ ├── TableLayoutAssert.java │ │ ├── TableRowAssert.java │ │ ├── TextViewAssert.java │ │ ├── TextViewGravity.java │ │ ├── TextViewImeOptions.java │ │ ├── TimePickerAssert.java │ │ ├── ToastAssert.java │ │ ├── ToggleButtonAssert.java │ │ ├── VideoViewAssert.java │ │ ├── ViewAnimatorAssert.java │ │ ├── ViewFlipperAssert.java │ │ ├── ViewSwitcherAssert.java │ │ └── WrapperListAdapterAssert.java │ └── internal │ └── BitmaskUtils.java ├── build.gradle ├── check-missing-assertions.sh ├── checkstyle.xml ├── deploy_website.sh ├── generate-assertions-java.py ├── gradle.properties ├── gradle ├── checkstyle.gradle ├── gradle-mvn-push.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── website ├── index.html └── static ├── app.css ├── bootstrap-responsive.min.css ├── bootstrap.min.css ├── jquery-maven-artifact.min.js ├── prettify.css ├── prettify.js ├── ribbon.png ├── square.png └── waves.png /.buildscript/deploy_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo. 4 | # 5 | # Adapted from https://coderwall.com/p/9b_lfq and 6 | # http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ 7 | 8 | SLUG="square/assertj-android" 9 | JDK="oraclejdk8" 10 | BRANCH="master" 11 | 12 | set -e 13 | 14 | if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then 15 | echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'." 16 | elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then 17 | echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'." 18 | elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 19 | echo "Skipping snapshot deployment: was pull request." 20 | elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then 21 | echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'." 22 | else 23 | echo "Deploying snapshot..." 24 | ./gradlew clean uploadArchives 25 | echo "Snapshot deployed!" 26 | fi 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .classpath 2 | .project 3 | .settings 4 | eclipsebin 5 | 6 | bin 7 | gen 8 | build 9 | out 10 | lib 11 | 12 | .idea 13 | *.iml 14 | classes 15 | 16 | obj 17 | 18 | .DS_Store 19 | 20 | build 21 | .gradle 22 | local.properties 23 | reports 24 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | android: 4 | components: 5 | - tools 6 | - platform-tools 7 | - build-tools-26.0.1 8 | - extra-google-m2repository 9 | - android-26 10 | 11 | jdk: 12 | - oraclejdk8 13 | 14 | before_install: 15 | - ./check-missing-assertions.sh 16 | 17 | script: 18 | - ./gradlew clean check 19 | 20 | after_success: 21 | - .buildscript/deploy_snapshot.sh 22 | 23 | env: 24 | global: 25 | - secure: "Z09ZjFkdbvkqpqwzeqz1W9/yPo5IKtsPeRDjplXVeNSZGBLm/YOyzKHZ2htROIrck31Edl/k79fC9P9jaL98VrI4EfzeAg1pXWeQWjqpPoBsyI8kYIf5OmJecOqxFhcE7hTJNI7XxmfzMpMkK8946oegWna9Bf1WWDgW/7iHHgo=" 26 | - secure: "icw0oEYt9x2BJ5f1m3nFVV+QkBfDAYs/H6toNeqf/jFuPSbyl+TNTCKTUJj4BKCwmMjLsDSsR3TZi4iKfTQu6x1A8w+2u7gw/wQrFY2tzPqW7/BlOMFEGS/tWpRmw1sLwqQEFd+Fa2Redy2xQywcwFAgjN0zFTfFOQU4UBIcAQo=" 27 | 28 | branches: 29 | except: 30 | - gh-pages 31 | 32 | notifications: 33 | email: false 34 | 35 | sudo: false 36 | 37 | cache: 38 | directories: 39 | - $HOME/.gradle 40 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 4 | If you would like to contribute code you can do so through GitHub by forking 5 | the repository and sending a pull request. 6 | 7 | When submitting code, please make every effort to follow existing conventions 8 | and style in order to keep the code as readable as possible. Please also make 9 | sure your code compiles by running `./gradlew clean build`. Checkstyle failures 10 | during compilation indicate errors in your style and can be viewed in files 11 | located at `*/build/report/checkstyle` directories. 12 | 13 | Before your code can be accepted into the project you must also sign the 14 | [Individual Contributor License Agreement (CLA)][1]. 15 | 16 | 17 | [1]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1 18 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | Releasing 2 | ======== 3 | 4 | 1. Change the version in `gradle.properties` to a non-SNAPSHOT version. 5 | 2. Update the `CHANGELOG.md` for the impending release. 6 | 3. Update the `README.md` with the new version. 7 | 4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version) 8 | 5. `git tag -a X.Y.X -m "Version X.Y.Z"` (where X.Y.Z is the new version) 9 | 6. `./gradlew clean uploadArchives` 10 | 7. Update the `gradle.properties` to the next SNAPSHOT version. 11 | 8. `git commit -am "Prepare next development version."` 12 | 9. `git push && git push --tags` 13 | 10. Visit [Sonatype Nexus](https://oss.sonatype.org/) and promote the artifact. 14 | -------------------------------------------------------------------------------- /assertj-android-appcompat-v7/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.supportAppCompat 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | apply from: rootProject.file('gradle/checkstyle.gradle') 27 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 28 | -------------------------------------------------------------------------------- /assertj-android-appcompat-v7/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-appcompat-v7 2 | POM_NAME=AssertJ for Android AppCompat v7 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android-appcompat-v7/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-appcompat-v7/src/main/java/org/assertj/android/appcompat/v7/api/Assertions.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Square, Inc. 2 | // 3 | // This class is generated. Do not modify directly! 4 | package org.assertj.android.appcompat.v7.api; 5 | 6 | /** Assertions for testing Android classes. */ 7 | @SuppressWarnings("deprecation") 8 | public final class Assertions { 9 | public static org.assertj.android.appcompat.v7.api.app.ActionBarAssert assertThat( 10 | android.support.v7.app.ActionBar actual) { 11 | return new org.assertj.android.appcompat.v7.api.app.ActionBarAssert(actual); 12 | } 13 | 14 | public static org.assertj.android.appcompat.v7.api.view.ActionModeAssert assertThat( 15 | android.support.v7.view.ActionMode actual) { 16 | return new org.assertj.android.appcompat.v7.api.view.ActionModeAssert(actual); 17 | } 18 | 19 | public static org.assertj.android.appcompat.v7.api.widget.LinearLayoutCompatAssert assertThat( 20 | android.support.v7.widget.LinearLayoutCompat actual) { 21 | return new org.assertj.android.appcompat.v7.api.widget.LinearLayoutCompatAssert(actual); 22 | } 23 | 24 | public static org.assertj.android.appcompat.v7.api.widget.SearchViewAssert assertThat( 25 | android.support.v7.widget.SearchView actual) { 26 | return new org.assertj.android.appcompat.v7.api.widget.SearchViewAssert(actual); 27 | } 28 | 29 | private Assertions() { 30 | throw new AssertionError("No instances."); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android-appcompat-v7/src/main/java/org/assertj/android/appcompat/v7/api/app/ActionBarDisplayOptions.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.appcompat.v7.api.app; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v7.app.ActionBar; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | ActionBar.DISPLAY_HOME_AS_UP, 13 | ActionBar.DISPLAY_SHOW_CUSTOM, 14 | ActionBar.DISPLAY_SHOW_HOME, 15 | ActionBar.DISPLAY_SHOW_TITLE, 16 | ActionBar.DISPLAY_USE_LOGO 17 | }) 18 | @Retention(SOURCE) 19 | @interface ActionBarDisplayOptions { 20 | } 21 | -------------------------------------------------------------------------------- /assertj-android-appcompat-v7/src/main/java/org/assertj/android/appcompat/v7/api/app/ActionBarNavigationMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.appcompat.v7.api.app; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v7.app.ActionBar; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ActionBar.NAVIGATION_MODE_LIST, 11 | ActionBar.NAVIGATION_MODE_STANDARD, 12 | ActionBar.NAVIGATION_MODE_TABS 13 | }) 14 | @Retention(SOURCE) 15 | @interface ActionBarNavigationMode { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android-appcompat-v7/src/main/java/org/assertj/android/appcompat/v7/api/widget/LinearLayoutCompatAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.appcompat.v7.api.widget; 2 | 3 | import android.support.v7.widget.LinearLayoutCompat; 4 | 5 | /** 6 | * Assertions for {@link LinearLayoutCompat} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractLinearLayoutCompatAssert}. 9 | */ 10 | public final class LinearLayoutCompatAssert extends 11 | AbstractLinearLayoutCompatAssert { 12 | public LinearLayoutCompatAssert(LinearLayoutCompat actual) { 13 | super(actual, LinearLayoutCompatAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-cardview-v7/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.supportCardView 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | apply from: rootProject.file('gradle/checkstyle.gradle') 27 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 28 | -------------------------------------------------------------------------------- /assertj-android-cardview-v7/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-cardview-v7 2 | POM_NAME=AssertJ for Android CardView v7 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android-cardview-v7/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-cardview-v7/src/main/java/org/assertj/android/cardview/v7/api/Assertions.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Square, Inc. 2 | // 3 | // This class is generated. Do not modify directly! 4 | package org.assertj.android.cardview.v7.api; 5 | 6 | /** Assertions for testing Android classes. */ 7 | @SuppressWarnings("deprecation") 8 | public final class Assertions { 9 | public static org.assertj.android.cardview.v7.api.widget.CardViewAssert assertThat( 10 | android.support.v7.widget.CardView actual) { 11 | return new org.assertj.android.cardview.v7.api.widget.CardViewAssert(actual); 12 | } 13 | 14 | private Assertions() { 15 | throw new AssertionError("No instances."); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android-cardview-v7/src/main/java/org/assertj/android/cardview/v7/api/widget/CardViewAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.cardview.v7.api.widget; 2 | 3 | import android.support.v7.widget.CardView; 4 | 5 | import org.assertj.android.api.view.AbstractViewGroupAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** 10 | * Assertions for {@link CardView} instances. 11 | */ 12 | public class CardViewAssert extends AbstractViewGroupAssert { 13 | public CardViewAssert(CardView actual) { 14 | super(actual, CardViewAssert.class); 15 | } 16 | 17 | public CardViewAssert hasRadius(int radius) { 18 | isNotNull(); 19 | float actualRadius = actual.getRadius(); 20 | assertThat(actualRadius) // 21 | .overridingErrorMessage("Expected radius <%s> but was <%s>", radius, actualRadius) // 22 | .isEqualTo(radius); 23 | return this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /assertj-android-design/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.supportDesign 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | apply from: rootProject.file('gradle/checkstyle.gradle') 27 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 28 | -------------------------------------------------------------------------------- /assertj-android-design/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-design 2 | POM_NAME=AssertJ for Android Design Support 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android-design/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-design/src/main/java/org/assertj/android/design/api/widget/NavigationViewAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.design.api.widget; 2 | 3 | import android.graphics.drawable.Drawable; 4 | import android.support.design.widget.NavigationView; 5 | import org.assertj.android.api.widget.AbstractFrameLayoutAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link NavigationView} instances. */ 10 | public class NavigationViewAssert 11 | extends AbstractFrameLayoutAssert { 12 | public NavigationViewAssert(NavigationView actual) { 13 | super(actual, NavigationViewAssert.class); 14 | } 15 | 16 | public NavigationViewAssert hasItemBackground(Drawable itemBackground) { 17 | isNotNull(); 18 | Drawable actualItemBackground = actual.getItemBackground(); 19 | assertThat(actualItemBackground) // 20 | .overridingErrorMessage("Expected item background <%s> but was <%s>.", itemBackground, 21 | actualItemBackground) // 22 | .isEqualTo(itemBackground); 23 | return this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /assertj-android-design/src/main/java/org/assertj/android/design/api/widget/SnackbarAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.design.api.widget; 2 | 3 | import android.support.design.widget.Snackbar; 4 | import android.view.View; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Snackbar} instances. */ 10 | public class SnackbarAssert extends AbstractAssert { 11 | public SnackbarAssert(Snackbar actual) { 12 | super(actual, SnackbarAssert.class); 13 | } 14 | 15 | public SnackbarAssert hasDuration(int duration) { 16 | isNotNull(); 17 | int actualDuration = actual.getDuration(); 18 | assertThat(actualDuration) // 19 | .overridingErrorMessage("Expected duration <%s> but was <%s>.", duration, actualDuration) // 20 | .isEqualTo(duration); 21 | return this; 22 | } 23 | 24 | public SnackbarAssert hasView(View view) { 25 | isNotNull(); 26 | View actualView = actual.getView(); 27 | assertThat(actualView) // 28 | .overridingErrorMessage("Expected view <%s> but was <%s>.", view, actualView) // 29 | .isSameAs(view); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android-design/src/main/java/org/assertj/android/design/api/widget/TabGravity.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.design.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.design.widget.TabLayout; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | TabLayout.GRAVITY_CENTER, 11 | TabLayout.GRAVITY_FILL 12 | }) 13 | @Retention(SOURCE) 14 | @interface TabGravity { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-design/src/main/java/org/assertj/android/design/api/widget/TabMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.design.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.design.widget.TabLayout; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | TabLayout.MODE_FIXED, 11 | TabLayout.MODE_SCROLLABLE 12 | }) 13 | @Retention(SOURCE) 14 | @interface TabMode { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-design/src/main/java/org/assertj/android/design/api/widget/TextInputLayoutAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.design.api.widget; 2 | 3 | import android.support.design.widget.TextInputLayout; 4 | import org.assertj.android.api.widget.AbstractLinearLayoutAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link TextInputLayout} instances. */ 9 | public class TextInputLayoutAssert extends AbstractLinearLayoutAssert { 10 | public TextInputLayoutAssert(TextInputLayout actual) { 11 | super(actual, TextInputLayoutAssert.class); 12 | } 13 | 14 | public TextInputLayoutAssert hasError(CharSequence error) { 15 | isNotNull(); 16 | CharSequence actualError = actual.getError(); 17 | 18 | assertThat(actualError) // 19 | .overridingErrorMessage("Expected error '<%s>' but was '<%s>'.", error, actualError) // 20 | .isEqualTo(error); 21 | return this; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /assertj-android-gridlayout-v7/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.supportGridLayout 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | apply from: rootProject.file('gradle/checkstyle.gradle') 27 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 28 | -------------------------------------------------------------------------------- /assertj-android-gridlayout-v7/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-gridlayout-v7 2 | POM_NAME=AssertJ for Android GridLayout v7 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android-gridlayout-v7/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-gridlayout-v7/src/main/java/org/assertj/android/gridlayout/v7/api/Assertions.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Square, Inc. 2 | // 3 | // This class is generated. Do not modify directly! 4 | package org.assertj.android.gridlayout.v7.api; 5 | 6 | /** Assertions for testing Android classes. */ 7 | @SuppressWarnings("deprecation") 8 | public final class Assertions { 9 | public static org.assertj.android.gridlayout.v7.api.widget.GridLayoutAssert assertThat( 10 | android.support.v7.widget.GridLayout actual) { 11 | return new org.assertj.android.gridlayout.v7.api.widget.GridLayoutAssert(actual); 12 | } 13 | 14 | private Assertions() { 15 | throw new AssertionError("No instances."); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android-gridlayout-v7/src/main/java/org/assertj/android/gridlayout/v7/api/widget/GridLayoutAlignmentMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.gridlayout.v7.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v7.widget.GridLayout; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GridLayout.ALIGN_BOUNDS, 11 | GridLayout.ALIGN_MARGINS 12 | }) 13 | @Retention(SOURCE) 14 | @interface GridLayoutAlignmentMode { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-gridlayout-v7/src/main/java/org/assertj/android/gridlayout/v7/api/widget/GridLayoutOrientation.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.gridlayout.v7.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v7.widget.GridLayout; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GridLayout.HORIZONTAL, 11 | GridLayout.VERTICAL 12 | }) 13 | @Retention(SOURCE) 14 | @interface GridLayoutOrientation { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-mediarouter-v7/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.supportMediaRouter 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | apply from: rootProject.file('gradle/checkstyle.gradle') 27 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 28 | -------------------------------------------------------------------------------- /assertj-android-mediarouter-v7/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-mediarouter-v7 2 | POM_NAME=AssertJ for Android MediaRouter v7 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android-mediarouter-v7/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-mediarouter-v7/src/main/java/org/assertj/android/mediarouter/v7/api/media/MediaItemStatusPlaybackState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.mediarouter.v7.api.media; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v7.media.MediaItemStatus; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | MediaItemStatus.PLAYBACK_STATE_BUFFERING, 11 | MediaItemStatus.PLAYBACK_STATE_CANCELED, 12 | MediaItemStatus.PLAYBACK_STATE_ERROR, 13 | MediaItemStatus.PLAYBACK_STATE_FINISHED, 14 | MediaItemStatus.PLAYBACK_STATE_INVALIDATED, 15 | MediaItemStatus.PLAYBACK_STATE_PAUSED, 16 | MediaItemStatus.PLAYBACK_STATE_PENDING, 17 | MediaItemStatus.PLAYBACK_STATE_PLAYING 18 | }) 19 | @Retention(SOURCE) 20 | @interface MediaItemStatusPlaybackState { 21 | } 22 | -------------------------------------------------------------------------------- /assertj-android-mediarouter-v7/src/main/java/org/assertj/android/mediarouter/v7/api/media/MediaSessionStatusState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.mediarouter.v7.api.media; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v7.media.MediaSessionStatus; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | MediaSessionStatus.SESSION_STATE_ACTIVE, 11 | MediaSessionStatus.SESSION_STATE_ENDED, 12 | MediaSessionStatus.SESSION_STATE_INVALIDATED 13 | }) 14 | @Retention(SOURCE) 15 | @interface MediaSessionStatusState { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android-palette-v7/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.supportPalette 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | apply from: rootProject.file('gradle/checkstyle.gradle') 27 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 28 | -------------------------------------------------------------------------------- /assertj-android-palette-v7/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-palette-v7 2 | POM_NAME=AssertJ for Android Palette v7 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android-palette-v7/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-palette-v7/src/main/java/org/assertj/android/palette/v7/api/Assertions.java: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Square, Inc. 2 | // 3 | // This class is generated. Do not modify directly! 4 | package org.assertj.android.palette.v7.api; 5 | 6 | /** Assertions for testing Android classes. */ 7 | @SuppressWarnings("deprecation") 8 | public final class Assertions { 9 | public static org.assertj.android.palette.v7.api.graphics.PaletteAssert assertThat( 10 | android.support.v7.graphics.Palette actual) { 11 | return new org.assertj.android.palette.v7.api.graphics.PaletteAssert(actual); 12 | } 13 | 14 | public static org.assertj.android.palette.v7.api.graphics.PaletteSwatchAssert assertThat( 15 | android.support.v7.graphics.Palette.Swatch actual) { 16 | return new org.assertj.android.palette.v7.api.graphics.PaletteSwatchAssert(actual); 17 | } 18 | 19 | private Assertions() { 20 | throw new AssertionError("No instances."); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /assertj-android-palette-v7/src/main/java/org/assertj/android/palette/v7/api/graphics/PaletteSwatchAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.palette.v7.api.graphics; 2 | 3 | import android.support.v7.graphics.Palette; 4 | 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** 10 | * Assertions for {@link Palette.Swatch} instances. 11 | */ 12 | public class PaletteSwatchAssert extends AbstractAssert { 13 | public PaletteSwatchAssert(Palette.Swatch actual) { 14 | super(actual, PaletteSwatchAssert.class); 15 | } 16 | 17 | public PaletteSwatchAssert hasRgb(int rgb) { 18 | isNotNull(); 19 | int actualRgb = actual.getRgb(); 20 | assertThat(actualRgb) // 21 | .overridingErrorMessage("Expected RGB <%s> but was <%s>", rgb, actualRgb) // 22 | .isEqualTo(rgb); 23 | return this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /assertj-android-play-services/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.playServices 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | disable 'InlinedApi', 'AllowBackup' 24 | } 25 | } 26 | 27 | apply from: rootProject.file('gradle/checkstyle.gradle') 28 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 29 | -------------------------------------------------------------------------------- /assertj-android-play-services/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-play-services 2 | POM_NAME=AssertJ for Google Play Services 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android-play-services/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-play-services/src/main/java/org/assertj/android/playservices/api/location/ActivityRecognitionResultAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.playservices.api.location; 2 | 3 | import com.google.android.gms.location.ActivityRecognitionResult; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public class ActivityRecognitionResultAssert 9 | extends AbstractAssert { 10 | public ActivityRecognitionResultAssert(ActivityRecognitionResult actual) { 11 | super(actual, ActivityRecognitionResultAssert.class); 12 | } 13 | 14 | public ActivityRecognitionResultAssert hasElapsedRealtimeMillis(long millis) { 15 | isNotNull(); 16 | long actualMillis = actual.getElapsedRealtimeMillis(); 17 | assertThat(actualMillis) // 18 | .overridingErrorMessage("Expected elapsed realtime millis <%s> but was <%s>.", millis, 19 | actualMillis) // 20 | .isEqualTo(millis); 21 | return this; 22 | } 23 | 24 | public ActivityRecognitionResultAssert hasTime(long time) { 25 | isNotNull(); 26 | long actualTime = actual.getTime(); 27 | assertThat(actualTime) // 28 | .overridingErrorMessage("Expected time <%s> but was <%s>.", time, actualTime) // 29 | .isEqualTo(time); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android-play-services/src/main/java/org/assertj/android/playservices/api/location/DetectedActivityType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.playservices.api.location; 2 | 3 | import android.support.annotation.IntDef; 4 | 5 | import com.google.android.gms.location.DetectedActivity; 6 | import java.lang.annotation.Retention; 7 | 8 | import static java.lang.annotation.RetentionPolicy.SOURCE; 9 | 10 | @IntDef({ 11 | DetectedActivity.IN_VEHICLE, 12 | DetectedActivity.ON_BICYCLE, 13 | DetectedActivity.ON_FOOT, 14 | DetectedActivity.RUNNING, 15 | DetectedActivity.STILL, 16 | DetectedActivity.TILTING, 17 | DetectedActivity.UNKNOWN, 18 | DetectedActivity.WALKING 19 | }) 20 | @Retention(SOURCE) 21 | @interface DetectedActivityType { 22 | } 23 | -------------------------------------------------------------------------------- /assertj-android-recyclerview-v7/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.supportRecyclerView 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | apply from: rootProject.file('gradle/checkstyle.gradle') 27 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 28 | -------------------------------------------------------------------------------- /assertj-android-recyclerview-v7/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-recyclerview-v7 2 | POM_NAME=AssertJ for Android RecyclerView v7 3 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /assertj-android-recyclerview-v7/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-recyclerview-v7/src/main/java/org/assertj/android/recyclerview/v7/api/widget/RecyclerViewScrollState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.recyclerview.v7.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v7.widget.RecyclerView; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | RecyclerView.SCROLL_STATE_DRAGGING, 11 | RecyclerView.SCROLL_STATE_IDLE, 12 | RecyclerView.SCROLL_STATE_SETTLING, 13 | }) 14 | @Retention(SOURCE) 15 | @interface RecyclerViewScrollState { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android-support-v4/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile project(':assertj-android') 5 | compile rootProject.ext.supportV4 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | disable 'InlinedApi', 'AllowBackup' 24 | } 25 | } 26 | 27 | apply from: rootProject.file('gradle/checkstyle.gradle') 28 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 29 | -------------------------------------------------------------------------------- /assertj-android-support-v4/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android-support-v4 2 | POM_NAME=AssertJ for Android Support v4 Library 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/app/ActionBarDrawerToggleAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.support.v4.api.app; 2 | 3 | import android.support.v4.app.ActionBarDrawerToggle; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public class ActionBarDrawerToggleAssert extends AbstractAssert { 9 | public ActionBarDrawerToggleAssert(ActionBarDrawerToggle actual) { 10 | super(actual, ActionBarDrawerToggleAssert.class); 11 | } 12 | 13 | public ActionBarDrawerToggleAssert hasDrawerIndicatorEnabled() { 14 | isNotNull(); 15 | assertThat(actual.isDrawerIndicatorEnabled()) // 16 | .overridingErrorMessage("Expected drawer indicator to be enabled but was disabled.") // 17 | .isTrue(); 18 | return this; 19 | } 20 | 21 | public ActionBarDrawerToggleAssert doesNotHaveDrawerIndicatorEnabled() { 22 | isNotNull(); 23 | assertThat(actual.isDrawerIndicatorEnabled()) // 24 | .overridingErrorMessage("Expected drawer indicator to be disabled but was enabled.") // 25 | .isFalse(); 26 | return this; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/app/DialogFragmentAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.support.v4.api.app; 3 | 4 | import android.support.v4.app.DialogFragment; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link DialogFragment} instances. */ 9 | public class DialogFragmentAssert 10 | extends AbstractFragmentAssert { 11 | public DialogFragmentAssert(DialogFragment actual) { 12 | super(actual, DialogFragmentAssert.class); 13 | } 14 | 15 | public DialogFragmentAssert isCancelable() { 16 | isNotNull(); 17 | assertThat(actual.isCancelable()) // 18 | .overridingErrorMessage("Expected to be cancelable but was not cancelable.") // 19 | .isTrue(); 20 | return this; 21 | } 22 | 23 | public DialogFragmentAssert isNotCancelable() { 24 | isNotNull(); 25 | assertThat(actual.isCancelable()) // 26 | .overridingErrorMessage("Expected to be not cancelable but was cancelable.") // 27 | .isFalse(); 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/app/FragmentAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.support.v4.api.app; 3 | 4 | import android.support.v4.app.Fragment; 5 | 6 | /** 7 | * Assertions for {@link Fragment} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractFragmentAssert}. 10 | */ 11 | public final class FragmentAssert extends AbstractFragmentAssert { 12 | public FragmentAssert(Fragment actual) { 13 | super(actual, FragmentAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/app/ListFragmentAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.support.v4.api.app; 3 | 4 | import android.support.v4.app.ListFragment; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link ListFragment} instances. */ 9 | public class ListFragmentAssert extends AbstractFragmentAssert { 10 | public ListFragmentAssert(ListFragment actual) { 11 | super(actual, ListFragmentAssert.class); 12 | } 13 | 14 | public ListFragmentAssert hasSelectedItemId(long id) { 15 | isNotNull(); 16 | long actualId = actual.getSelectedItemId(); 17 | assertThat(actualId) // 18 | .overridingErrorMessage("Expected selected ID <%s> but was <%s>.", id, actualId) // 19 | .isEqualTo(id); 20 | return this; 21 | } 22 | 23 | public ListFragmentAssert hasSelectedItemPosition(int position) { 24 | isNotNull(); 25 | long actualPosition = actual.getSelectedItemPosition(); 26 | assertThat(actualPosition) // 27 | .overridingErrorMessage("Expected selected position <%s> but was <%s>.", position, 28 | actualPosition) // 29 | .isEqualTo(position); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/app/LoaderManagerAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.support.v4.api.app; 3 | 4 | import android.support.v4.app.LoaderManager; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link LoaderManager} instances. */ 10 | public class LoaderManagerAssert extends AbstractAssert { 11 | public LoaderManagerAssert(LoaderManager actual) { 12 | super(actual, LoaderManagerAssert.class); 13 | } 14 | 15 | public LoaderManagerAssert hasLoader(int id) { 16 | isNotNull(); 17 | assertThat(actual.getLoader(id)) 18 | .overridingErrorMessage("Expected loader with ID <%s> but was not present.", id) 19 | .isNotNull(); 20 | return this; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/content/LoaderAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.support.v4.api.content; 3 | 4 | import android.support.v4.content.Loader; 5 | 6 | /** 7 | * Assertions for {@link Loader} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractLoaderAssert}. 10 | */ 11 | public final class LoaderAssert extends AbstractLoaderAssert { 12 | public LoaderAssert(Loader actual) { 13 | super(actual, LoaderAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/print/PrintHelperColorMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.support.v4.api.print; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v4.print.PrintHelper; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | PrintHelper.COLOR_MODE_COLOR, 11 | PrintHelper.COLOR_MODE_MONOCHROME 12 | }) 13 | @Retention(SOURCE) 14 | @interface PrintHelperColorMode { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/print/PrintHelperOrientation.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.support.v4.api.print; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v4.print.PrintHelper; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | PrintHelper.ORIENTATION_LANDSCAPE, 11 | PrintHelper.ORIENTATION_PORTRAIT 12 | }) 13 | @Retention(SOURCE) 14 | @interface PrintHelperOrientation { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/print/PrintHelperScaleMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.support.v4.api.print; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.support.v4.print.PrintHelper; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | PrintHelper.SCALE_MODE_FILL, 11 | PrintHelper.SCALE_MODE_FIT 12 | }) 13 | @Retention(SOURCE) 14 | @interface PrintHelperScaleMode { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/util/AtomicFileAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.support.v4.api.util; 2 | 3 | import android.support.v4.util.AtomicFile; 4 | import java.io.File; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | public class AtomicFileAssert extends AbstractAssert { 10 | public AtomicFileAssert(AtomicFile actual) { 11 | super(actual, AtomicFileAssert.class); 12 | } 13 | 14 | public AtomicFileAssert hasBaseFile(File file) { 15 | isNotNull(); 16 | File actualFile = actual.getBaseFile(); 17 | assertThat(actualFile) // 18 | .overridingErrorMessage("Expected base file <%s> but was <%s>.", file, actualFile) // 19 | .isEqualTo(file); 20 | return this; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/util/LongSparseArrayAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.support.v4.api.util; 2 | 3 | import android.support.v4.util.LongSparseArray; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link LongSparseArray} instances. */ 9 | public class LongSparseArrayAssert extends AbstractAssert { 10 | public LongSparseArrayAssert(LongSparseArray actual) { 11 | super(actual, LongSparseArrayAssert.class); 12 | } 13 | 14 | public LongSparseArrayAssert hasKey(int key) { 15 | isNotNull(); 16 | assertThat(actual.get(key)) // 17 | .overridingErrorMessage("Expected key <%s> to be present but was not present.", key) // 18 | .isNotNull(); 19 | return this; 20 | } 21 | 22 | public LongSparseArrayAssert hasSize(int size) { 23 | isNotNull(); 24 | int actualSize = actual.size(); 25 | assertThat(actualSize) // 26 | .overridingErrorMessage("Expected size <%s> but was <%s>.", size, actualSize) // 27 | .isEqualTo(size); 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/util/SparseArrayCompatAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.support.v4.api.util; 2 | 3 | import android.support.v4.util.SparseArrayCompat; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link SparseArrayCompat} instances. */ 9 | public class SparseArrayCompatAssert 10 | extends AbstractAssert, SparseArrayCompat> { 11 | public SparseArrayCompatAssert(SparseArrayCompat actual) { 12 | super(actual, SparseArrayCompatAssert.class); 13 | } 14 | 15 | public SparseArrayCompatAssert hasKey(int key) { 16 | isNotNull(); 17 | assertThat(actual.indexOfKey(key)) // 18 | .overridingErrorMessage("Expected key <%s> to be present but was not present.", key) // 19 | .isGreaterThanOrEqualTo(0); 20 | return this; 21 | } 22 | 23 | public SparseArrayCompatAssert hasSize(int size) { 24 | isNotNull(); 25 | int actualSize = actual.size(); 26 | assertThat(actualSize) // 27 | .overridingErrorMessage("Expected size <%s> but was <%s>.", size, actualSize) // 28 | .isEqualTo(size); 29 | return this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/view/PagerAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.support.v4.api.view; 3 | 4 | import android.support.v4.view.PagerAdapter; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link PagerAdapter} instances. */ 10 | public class PagerAdapterAssert extends AbstractAssert { 11 | public PagerAdapterAssert(PagerAdapter actual) { 12 | super(actual, PagerAdapterAssert.class); 13 | } 14 | 15 | public PagerAdapterAssert hasCount(int count) { 16 | isNotNull(); 17 | int actualCount = actual.getCount(); 18 | assertThat(actualCount) // 19 | .overridingErrorMessage("Expected count <%s> but was <%s>.", count, actualCount) // 20 | .isEqualTo(count); 21 | return this; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/widget/AbstractCursorAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.support.v4.api.widget; 3 | 4 | import android.database.Cursor; 5 | import android.support.v4.widget.CursorAdapter; 6 | import android.widget.Filter; 7 | import org.assertj.android.api.widget.AbstractListAdapterAssert; 8 | 9 | import static org.assertj.core.api.Assertions.assertThat; 10 | 11 | public abstract class AbstractCursorAdapterAssert, A extends CursorAdapter> 12 | extends AbstractListAdapterAssert { 13 | protected AbstractCursorAdapterAssert(A actual, Class selfType) { 14 | super(actual, selfType); 15 | } 16 | 17 | public S hasCursor(Cursor cursor) { 18 | isNotNull(); 19 | Cursor actualCursor = actual.getCursor(); 20 | assertThat(actualCursor) // 21 | .overridingErrorMessage("Expected cursor <%s> but was <%s>.", cursor, actualCursor) // 22 | .isSameAs(cursor); 23 | return myself; 24 | } 25 | 26 | public S hasFilter(Filter filter) { 27 | isNotNull(); 28 | Filter actualFilter = actual.getFilter(); 29 | assertThat(actualFilter) // 30 | .overridingErrorMessage("Expected filter <%s> but was <%s>.", filter, actualFilter) // 31 | .isSameAs(filter); 32 | return myself; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/widget/CursorAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.support.v4.api.widget; 3 | 4 | import android.support.v4.widget.CursorAdapter; 5 | 6 | /** 7 | * Assertions for {@link CursorAdapter} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractCursorAdapterAssert}. 10 | */ 11 | public final class CursorAdapterAssert 12 | extends AbstractCursorAdapterAssert { 13 | public CursorAdapterAssert(CursorAdapter actual) { 14 | super(actual, CursorAdapterAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android-support-v4/src/main/java/org/assertj/android/support/v4/api/widget/SwipeRefreshLayoutAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.support.v4.api.widget; 2 | 3 | import android.support.v4.widget.SwipeRefreshLayout; 4 | import org.assertj.android.api.view.AbstractViewGroupAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public class SwipeRefreshLayoutAssert 9 | extends AbstractViewGroupAssert { 10 | public SwipeRefreshLayoutAssert(SwipeRefreshLayout actual) { 11 | super(actual, SwipeRefreshLayoutAssert.class); 12 | } 13 | 14 | public SwipeRefreshLayoutAssert isRefreshing() { 15 | isNotNull(); 16 | assertThat(actual.isRefreshing()) // 17 | .overridingErrorMessage("Expected to be refreshing but was not.") // 18 | .isTrue(); 19 | return this; 20 | } 21 | 22 | public SwipeRefreshLayoutAssert isNotRefreshing() { 23 | isNotNull(); 24 | assertThat(actual.isRefreshing()) // 25 | .overridingErrorMessage("Expected to not be refreshing but was.") // 26 | .isFalse(); 27 | return this; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile rootProject.ext.assertj 5 | compile rootProject.ext.supportAnnotations 6 | } 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | minSdkVersion rootProject.ext.minSdkVersion 14 | } 15 | 16 | compileOptions { 17 | sourceCompatibility JavaVersion.VERSION_1_7 18 | targetCompatibility JavaVersion.VERSION_1_7 19 | } 20 | 21 | lintOptions { 22 | abortOnError false 23 | disable 'InlinedApi', 'AllowBackup' 24 | } 25 | } 26 | 27 | apply from: rootProject.file('gradle/checkstyle.gradle') 28 | apply from: rootProject.file('gradle/gradle-mvn-push.gradle') 29 | -------------------------------------------------------------------------------- /assertj-android/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_ARTIFACT_ID=assertj-android 2 | POM_NAME=AssertJ for Android 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /assertj-android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/accessibilityservice/AccessibilityServiceInfoCapabilities.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.accessibilityservice; 2 | 3 | import android.accessibilityservice.AccessibilityServiceInfo; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | AccessibilityServiceInfo.CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY, 13 | AccessibilityServiceInfo.CAPABILITY_CAN_REQUEST_FILTER_KEY_EVENTS, 14 | AccessibilityServiceInfo.CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION, 15 | AccessibilityServiceInfo.CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT 16 | } 17 | ) 18 | @Retention(SOURCE) 19 | @interface AccessibilityServiceInfoCapabilities { 20 | } 21 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/accounts/AccountAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.accounts; 3 | 4 | import android.accounts.Account; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Account} instances. */ 10 | public class AccountAssert extends AbstractAssert { 11 | public AccountAssert(Account actual) { 12 | super(actual, AccountAssert.class); 13 | } 14 | 15 | public AccountAssert hasName(String name) { 16 | isNotNull(); 17 | String actualName = actual.name; 18 | assertThat(actualName) // 19 | .overridingErrorMessage("Expected name <%s> but was <%s>.", name, actualName) // 20 | .isEqualTo(name); 21 | return this; 22 | } 23 | 24 | public AccountAssert hasType(String type) { 25 | isNotNull(); 26 | String actualType = actual.type; 27 | assertThat(actualType) // 28 | .overridingErrorMessage("Expected type <%s> but was <%s>.", type, actualType) // 29 | .isEqualTo(type); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/animation/AnimatorAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.animation; 3 | 4 | import android.animation.Animator; 5 | import android.annotation.TargetApi; 6 | 7 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 8 | 9 | /** 10 | * Assertions for {@link Animator} instances. 11 | *

12 | * This class is final. To extend use {@link AbstractAnimatorAssert}. 13 | */ 14 | @TargetApi(HONEYCOMB) 15 | public final class AnimatorAssert extends AbstractAnimatorAssert { 16 | public AnimatorAssert(Animator actual) { 17 | super(actual, AnimatorAssert.class); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/animation/AnimatorSetAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.animation; 3 | 4 | import android.animation.AnimatorSet; 5 | import android.annotation.TargetApi; 6 | 7 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | @TargetApi(HONEYCOMB) 11 | public class AnimatorSetAssert extends AbstractAnimatorAssert { 12 | public AnimatorSetAssert(AnimatorSet actual) { 13 | super(actual, AnimatorSetAssert.class); 14 | } 15 | 16 | public AnimatorSetAssert hasAnimatorCount(int count) { 17 | isNotNull(); 18 | int actualCount = actual.getChildAnimations().size(); 19 | assertThat(actualCount) // 20 | .overridingErrorMessage("Expected animator count <%s> but was <%s>.", count, actualCount) // 21 | .isEqualTo(count); 22 | return myself; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/animation/ObjectAnimatorAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.animation; 3 | 4 | import android.animation.ObjectAnimator; 5 | import android.annotation.TargetApi; 6 | 7 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | /** Assertions for {@link ObjectAnimator} instances. */ 11 | @TargetApi(HONEYCOMB) 12 | public class ObjectAnimatorAssert 13 | extends AbstractValueAnimatorAssert { 14 | public ObjectAnimatorAssert(ObjectAnimator actual) { 15 | super(actual, ObjectAnimatorAssert.class); 16 | } 17 | 18 | public ObjectAnimatorAssert hasPropertyName(String name) { 19 | isNotNull(); 20 | String actualName = actual.getPropertyName(); 21 | assertThat(actualName) // 22 | .overridingErrorMessage("Expected property name <%s> but was <%s>.", name, actualName) // 23 | .isEqualTo(name); 24 | return this; 25 | } 26 | 27 | public ObjectAnimatorAssert hasTarget(Object target) { 28 | isNotNull(); 29 | Object actualTarget = actual.getTarget(); 30 | assertThat(actualTarget) // 31 | .overridingErrorMessage("Expected target <%s> but was <%s>.", target, actualTarget) // 32 | .isSameAs(target); 33 | return this; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/animation/PropertyValuesHolderAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.animation; 3 | 4 | import android.animation.PropertyValuesHolder; 5 | import android.annotation.TargetApi; 6 | import org.assertj.core.api.AbstractAssert; 7 | 8 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 9 | import static org.assertj.core.api.Assertions.assertThat; 10 | 11 | /** Assertions for {@link PropertyValuesHolder} instances. */ 12 | @TargetApi(HONEYCOMB) 13 | public class PropertyValuesHolderAssert 14 | extends AbstractAssert { 15 | public PropertyValuesHolderAssert(PropertyValuesHolder actual) { 16 | super(actual, PropertyValuesHolderAssert.class); 17 | } 18 | 19 | public PropertyValuesHolderAssert hasPropertyName(String name) { 20 | isNotNull(); 21 | String actualName = actual.getPropertyName(); 22 | assertThat(actualName) // 23 | .overridingErrorMessage("Expected property name <%s> but was <%s>.", name, actualName) // 24 | .isEqualTo(name); 25 | return this; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/animation/ValueAnimatorAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.animation; 3 | 4 | import android.animation.ValueAnimator; 5 | import android.annotation.TargetApi; 6 | 7 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 8 | 9 | /** 10 | * Assertions for {@link ValueAnimator} instances. 11 | *

12 | * This class is final. To extend use {@link AbstractValueAnimatorAssert}. 13 | */ 14 | @TargetApi(HONEYCOMB) 15 | public final class ValueAnimatorAssert 16 | extends AbstractValueAnimatorAssert { 17 | public ValueAnimatorAssert(ValueAnimator actual) { 18 | super(actual, ValueAnimatorAssert.class); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/animation/ValueAnimatorRepeatMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.animation; 2 | 3 | import android.animation.ValueAnimator; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ValueAnimator.RESTART, 11 | ValueAnimator.REVERSE 12 | }) 13 | @Retention(SOURCE) 14 | @interface ValueAnimatorRepeatMode { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/AbstractDialogAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Dialog; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public abstract class AbstractDialogAssert, A extends Dialog> 9 | extends AbstractAssert { 10 | public AbstractDialogAssert(A actual, Class selfType) { 11 | super(actual, selfType); 12 | } 13 | 14 | public S isShowing() { 15 | isNotNull(); 16 | assertThat(actual.isShowing()) // 17 | .overridingErrorMessage("Expected showing but was not showing") // 18 | .isTrue(); 19 | return myself; 20 | } 21 | 22 | public S isNotShowing() { 23 | isNotNull(); 24 | assertThat(actual.isShowing()) // 25 | .overridingErrorMessage("Expected not showing but was showing") // 26 | .isFalse(); 27 | return myself; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/AbstractServiceAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Service; 4 | import org.assertj.android.api.content.AbstractContextAssert; 5 | 6 | public abstract class AbstractServiceAssert, A extends Service> extends 7 | AbstractContextAssert { 8 | protected AbstractServiceAssert(A actual, Class selfType) { 9 | super(actual, selfType); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/ActionBarDisplayOptions.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.ActionBar; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | ActionBar.DISPLAY_HOME_AS_UP, 13 | ActionBar.DISPLAY_SHOW_CUSTOM, 14 | ActionBar.DISPLAY_SHOW_HOME, 15 | ActionBar.DISPLAY_SHOW_TITLE, 16 | ActionBar.DISPLAY_USE_LOGO 17 | }) 18 | @Retention(SOURCE) 19 | @interface ActionBarDisplayOptions { 20 | } 21 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/ActionBarNavigationMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.ActionBar; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ActionBar.NAVIGATION_MODE_LIST, 11 | ActionBar.NAVIGATION_MODE_STANDARD, 12 | ActionBar.NAVIGATION_MODE_TABS 13 | }) 14 | @Retention(SOURCE) 15 | @interface ActionBarNavigationMode { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/ActivityAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Activity; 4 | 5 | /** 6 | * Assertions for {@link Activity} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractActivityAssert}. 9 | */ 10 | public final class ActivityAssert extends AbstractActivityAssert { 11 | public ActivityAssert(Activity actual) { 12 | super(actual, ActivityAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/ActivityScreenOrientation.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.content.pm.ActivityInfo; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, 11 | ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, 12 | ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, 13 | ActivityInfo.SCREEN_ORIENTATION_USER, 14 | ActivityInfo.SCREEN_ORIENTATION_BEHIND, 15 | ActivityInfo.SCREEN_ORIENTATION_SENSOR, 16 | ActivityInfo.SCREEN_ORIENTATION_NOSENSOR, 17 | ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE, 18 | ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT, 19 | ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE, 20 | ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT, 21 | ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR, 22 | ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE, 23 | ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT, 24 | ActivityInfo.SCREEN_ORIENTATION_FULL_USER, 25 | ActivityInfo.SCREEN_ORIENTATION_LOCKED 26 | }) 27 | @Retention(SOURCE) 28 | @interface ActivityScreenOrientation { 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/DialogAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Dialog; 4 | 5 | /** 6 | * Assertions for {@link Dialog} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractDialogAssert}. 9 | */ 10 | public final class DialogAssert extends AbstractDialogAssert { 11 | public DialogAssert(Dialog actual) { 12 | super(actual, DialogAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/DialogFragmentAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.annotation.TargetApi; 4 | import android.app.DialogFragment; 5 | 6 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link DialogFragment} instances. */ 10 | @TargetApi(HONEYCOMB) 11 | public class DialogFragmentAssert 12 | extends AbstractFragmentAssert { 13 | public DialogFragmentAssert(DialogFragment actual) { 14 | super(actual, DialogFragmentAssert.class); 15 | } 16 | 17 | public DialogFragmentAssert isCancelable() { 18 | isNotNull(); 19 | assertThat(actual.isCancelable()) // 20 | .overridingErrorMessage("Expected to be cancelable but was not cancelable.") // 21 | .isTrue(); 22 | return this; 23 | } 24 | 25 | public DialogFragmentAssert isNotCancelable() { 26 | isNotNull(); 27 | assertThat(actual.isCancelable()) // 28 | .overridingErrorMessage("Expected to be not cancelable but was cancelable.") // 29 | .isFalse(); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/ExpandableListActivityAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.ExpandableListActivity; 4 | 5 | import static org.assertj.core.api.Assertions.assertThat; 6 | 7 | /** Assertions for {@link ExpandableListActivity} instances. */ 8 | public class ExpandableListActivityAssert 9 | extends AbstractActivityAssert { 10 | public ExpandableListActivityAssert(ExpandableListActivity actual) { 11 | super(actual, ExpandableListActivityAssert.class); 12 | } 13 | 14 | protected ExpandableListActivityAssert hasSelectedId(long id) { 15 | isNotNull(); 16 | long actualId = actual.getSelectedId(); 17 | assertThat(actualId) // 18 | .overridingErrorMessage("Expected selected ID <%s> but was <%s>.", id, actualId) // 19 | .isEqualTo(id); 20 | return this; 21 | } 22 | 23 | public ExpandableListActivityAssert hasSelectedPosition(long position) { 24 | isNotNull(); 25 | long actualPosition = actual.getSelectedPosition(); 26 | assertThat(actualPosition) // 27 | .overridingErrorMessage("Expected selected position <%s> bus was <%s>.", position, 28 | actualPosition) // 29 | .isEqualTo(position); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/FragmentAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Fragment; 4 | 5 | /** 6 | * Assertions for {@link Fragment} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractFragmentAssert}. 9 | */ 10 | public final class FragmentAssert extends AbstractFragmentAssert { 11 | public FragmentAssert(Fragment actual) { 12 | super(actual, FragmentAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/InstrumentationActivityMonitorAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Activity; 4 | import android.app.Instrumentation; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Instrumentation.ActivityMonitor} instances. */ 10 | public class InstrumentationActivityMonitorAssert 11 | extends AbstractAssert { 12 | public InstrumentationActivityMonitorAssert(Instrumentation.ActivityMonitor actual) { 13 | super(actual, InstrumentationActivityMonitorAssert.class); 14 | } 15 | 16 | public InstrumentationActivityMonitorAssert hasHits(int hits) { 17 | isNotNull(); 18 | int actualHits = actual.getHits(); 19 | assertThat(actualHits) // 20 | .overridingErrorMessage("Expected hits <%s> but was <%s>.", hits, actualHits) // 21 | .isEqualTo(hits); 22 | return this; 23 | } 24 | 25 | public InstrumentationActivityMonitorAssert hasLastActivity(Activity activity) { 26 | isNotNull(); 27 | Activity actualActivity = actual.getLastActivity(); 28 | assertThat(actualActivity) // 29 | .overridingErrorMessage("Expected last activity <%s> but was <%s>.", activity, 30 | actualActivity) // 31 | .isSameAs(activity); 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/InstrumentationActivityResultAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Instrumentation; 4 | import android.content.Intent; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Instrumentation.ActivityResult} instances. */ 10 | public class InstrumentationActivityResultAssert 11 | extends AbstractAssert { 12 | public InstrumentationActivityResultAssert(Instrumentation.ActivityResult actual) { 13 | super(actual, InstrumentationActivityResultAssert.class); 14 | } 15 | 16 | public InstrumentationActivityResultAssert hasResultCode(int code) { 17 | isNotNull(); 18 | int actualCode = actual.getResultCode(); 19 | assertThat(actualCode) // 20 | .overridingErrorMessage("Expected result code <%s> but was <%s>.", code, actualCode) // 21 | .isEqualTo(code); 22 | return this; 23 | } 24 | 25 | public InstrumentationActivityResultAssert hasResultData(Intent intent) { 26 | isNotNull(); 27 | Intent actualIntent = actual.getResultData(); 28 | assertThat(actualIntent) // 29 | .overridingErrorMessage("Expected result data <%s> but was <%s>.", intent, actualIntent) // 30 | .isEqualTo(intent); 31 | return this; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/ListActivityAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.app; 3 | 4 | import android.app.ListActivity; 5 | 6 | /** 7 | * Assertions for {@link ListActivity} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractListActivityAssert}. 10 | */ 11 | public final class ListActivityAssert 12 | extends AbstractListActivityAssert { 13 | public ListActivityAssert(ListActivity actual) { 14 | super(actual, ListActivityAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/ListFragmentAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.annotation.TargetApi; 4 | import android.app.ListFragment; 5 | 6 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link ListFragment} instances. */ 10 | @TargetApi(HONEYCOMB) 11 | public class ListFragmentAssert extends AbstractFragmentAssert { 12 | public ListFragmentAssert(ListFragment actual) { 13 | super(actual, ListFragmentAssert.class); 14 | } 15 | 16 | public ListFragmentAssert hasSelectedItemId(long id) { 17 | isNotNull(); 18 | long actualId = actual.getSelectedItemId(); 19 | assertThat(actualId) // 20 | .overridingErrorMessage("Expected selected ID <%s> but was <%s>.", id, actualId) // 21 | .isEqualTo(id); 22 | return this; 23 | } 24 | 25 | public ListFragmentAssert hasSelectedItemPosition(int position) { 26 | isNotNull(); 27 | long actualPosition = actual.getSelectedItemPosition(); 28 | assertThat(actualPosition) // 29 | .overridingErrorMessage("Expected selected position <%s> but was <%s>.", position, 30 | actualPosition) // 31 | .isEqualTo(position); 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/LoaderManagerAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.annotation.TargetApi; 4 | import android.app.LoaderManager; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | /** Assertions for {@link LoaderManager} instances. */ 11 | @TargetApi(HONEYCOMB) 12 | public class LoaderManagerAssert extends AbstractAssert { 13 | public LoaderManagerAssert(LoaderManager actual) { 14 | super(actual, LoaderManagerAssert.class); 15 | } 16 | 17 | public LoaderManagerAssert hasLoader(int id) { 18 | isNotNull(); 19 | assertThat(actual.getLoader(id)) 20 | .overridingErrorMessage("Expected loader with ID <%s> but was not present.", id) 21 | .isNotNull(); 22 | return this; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/LocalActivityManagerAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.LocalActivityManager; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link LocalActivityManager} instances. */ 9 | public class LocalActivityManagerAssert extends AbstractAssert { 10 | public LocalActivityManagerAssert(LocalActivityManager actual) { 11 | super(actual, LocalActivityManagerAssert.class); 12 | } 13 | 14 | public LocalActivityManagerAssert hasActivity(String id) { 15 | isNotNull(); 16 | assertThat(actual.getActivity(id)) 17 | .overridingErrorMessage("Expected activity with ID <%s> but was not present.", id) 18 | .isNotNull(); 19 | return this; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/NotificationFlags.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Notification; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | Notification.FLAG_AUTO_CANCEL, 13 | Notification.FLAG_FOREGROUND_SERVICE, 14 | Notification.FLAG_INSISTENT, 15 | Notification.FLAG_NO_CLEAR, 16 | Notification.FLAG_ONGOING_EVENT, 17 | Notification.FLAG_ONLY_ALERT_ONCE, 18 | Notification.FLAG_SHOW_LIGHTS, 19 | Notification.FLAG_HIGH_PRIORITY 20 | } 21 | ) 22 | @Retention(SOURCE) 23 | @interface NotificationFlags { 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/NotificationPriority.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Notification; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Notification.PRIORITY_MIN, 11 | Notification.PRIORITY_LOW, 12 | Notification.PRIORITY_DEFAULT, 13 | Notification.PRIORITY_HIGH, 14 | Notification.PRIORITY_MAX 15 | }) 16 | @Retention(SOURCE) 17 | @interface NotificationPriority { 18 | } 19 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/ServiceAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.app.Service; 4 | 5 | /** 6 | * Assertions for {@link Service} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractServiceAssert}. 9 | */ 10 | public final class ServiceAssert extends AbstractServiceAssert { 11 | public ServiceAssert(Service actual) { 12 | super(actual, ServiceAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/app/TaskStackBuilderAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.app; 2 | 3 | import android.annotation.TargetApi; 4 | import android.app.TaskStackBuilder; 5 | import android.content.Intent; 6 | import org.assertj.core.api.AbstractAssert; 7 | 8 | import static android.os.Build.VERSION_CODES.JELLY_BEAN; 9 | import static org.assertj.core.api.Assertions.assertThat; 10 | 11 | /** Assertions for {@link TaskStackBuilder} instances. */ 12 | @TargetApi(JELLY_BEAN) 13 | public class TaskStackBuilderAssert extends AbstractAssert { 14 | public TaskStackBuilderAssert(TaskStackBuilder actual) { 15 | super(actual, TaskStackBuilderAssert.class); 16 | } 17 | 18 | public TaskStackBuilderAssert hasIntentCount(int count) { 19 | isNotNull(); 20 | int actualCount = actual.getIntentCount(); 21 | assertThat(actualCount) // 22 | .overridingErrorMessage("Expected intent count <%s> but was <%s>.", count, actualCount) // 23 | .isEqualTo(count); 24 | return this; 25 | } 26 | 27 | public TaskStackBuilderAssert containsIntents(Intent... intents) { 28 | isNotNull(); 29 | assertThat(actual.getIntents()).contains(intents); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/bluetooth/BluetoothDeviceBondState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.bluetooth; 2 | 3 | import android.bluetooth.BluetoothDevice; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | BluetoothDevice.BOND_NONE, 11 | BluetoothDevice.BOND_BONDING, 12 | BluetoothDevice.BOND_BONDED 13 | }) 14 | @Retention(SOURCE) 15 | @interface BluetoothDeviceBondState { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/bluetooth/BluetoothDeviceType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.bluetooth; 2 | 3 | import android.bluetooth.BluetoothDevice; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | BluetoothDevice.DEVICE_TYPE_CLASSIC, 11 | BluetoothDevice.DEVICE_TYPE_DUAL, 12 | BluetoothDevice.DEVICE_TYPE_LE, 13 | BluetoothDevice.DEVICE_TYPE_UNKNOWN 14 | }) 15 | @Retention(SOURCE) 16 | @interface BluetoothDeviceType { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/bluetooth/BluetoothGattCharacteristicPermissions.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.bluetooth; 2 | 3 | import android.bluetooth.BluetoothGattCharacteristic; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | BluetoothGattCharacteristic.PERMISSION_READ, 13 | BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED, 14 | BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED_MITM, 15 | BluetoothGattCharacteristic.PERMISSION_WRITE, 16 | BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED, 17 | BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM, 18 | BluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED, 19 | BluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED_MITM 20 | } 21 | ) 22 | @Retention(SOURCE) 23 | @interface BluetoothGattCharacteristicPermissions { 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/bluetooth/BluetoothGattCharacteristicProperties.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.bluetooth; 2 | 3 | import android.bluetooth.BluetoothGattCharacteristic; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | BluetoothGattCharacteristic.PROPERTY_BROADCAST, 13 | BluetoothGattCharacteristic.PROPERTY_EXTENDED_PROPS, 14 | BluetoothGattCharacteristic.PROPERTY_INDICATE, 15 | BluetoothGattCharacteristic.PROPERTY_NOTIFY, 16 | BluetoothGattCharacteristic.PROPERTY_READ, 17 | BluetoothGattCharacteristic.PROPERTY_SIGNED_WRITE, 18 | BluetoothGattCharacteristic.PROPERTY_WRITE, 19 | BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE 20 | } 21 | ) 22 | @Retention(SOURCE) 23 | @interface BluetoothGattCharacteristicProperties { 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/bluetooth/BluetoothGattCharacteristicWriteType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.bluetooth; 2 | 3 | import android.bluetooth.BluetoothGattCharacteristic; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | BluetoothGattCharacteristic.WRITE_TYPE_DEFAULT, 11 | BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE, 12 | BluetoothGattCharacteristic.WRITE_TYPE_SIGNED 13 | }) 14 | @Retention(SOURCE) 15 | @interface BluetoothGattCharacteristicWriteType { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/bluetooth/BluetoothGattDescriptorPermissions.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.bluetooth; 2 | 3 | import android.bluetooth.BluetoothGattDescriptor; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | BluetoothGattDescriptor.PERMISSION_READ, 13 | BluetoothGattDescriptor.PERMISSION_READ_ENCRYPTED, 14 | BluetoothGattDescriptor.PERMISSION_READ_ENCRYPTED_MITM, 15 | BluetoothGattDescriptor.PERMISSION_WRITE, 16 | BluetoothGattDescriptor.PERMISSION_WRITE_ENCRYPTED, 17 | BluetoothGattDescriptor.PERMISSION_WRITE_ENCRYPTED_MITM, 18 | BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED, 19 | BluetoothGattDescriptor.PERMISSION_WRITE_SIGNED_MITM 20 | } 21 | ) 22 | @Retention(SOURCE) 23 | @interface BluetoothGattDescriptorPermissions { 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/bluetooth/BluetoothGattServiceType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.bluetooth; 2 | 3 | import android.bluetooth.BluetoothGattService; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | BluetoothGattService.SERVICE_TYPE_PRIMARY, 11 | BluetoothGattService.SERVICE_TYPE_SECONDARY 12 | }) 13 | @Retention(SOURCE) 14 | @interface BluetoothGattServiceType { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/content/AbstractContextAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.content; 2 | 3 | import android.content.Context; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | public abstract class AbstractContextAssert, A extends Context> 7 | extends AbstractAssert { 8 | protected AbstractContextAssert(A actual, Class selfType) { 9 | super(actual, selfType); 10 | } 11 | 12 | // TODO! 13 | } 14 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/content/AsyncTaskLoaderAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.content; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.AsyncTaskLoader; 5 | 6 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 7 | import static android.os.Build.VERSION_CODES.JELLY_BEAN; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | /** Assertions for {@link AsyncTaskLoader} instances. */ 11 | @TargetApi(HONEYCOMB) 12 | public class AsyncTaskLoaderAssert 13 | extends AbstractLoaderAssert { 14 | public AsyncTaskLoaderAssert(AsyncTaskLoader actual) { 15 | super(actual, AsyncTaskLoaderAssert.class); 16 | } 17 | 18 | @TargetApi(JELLY_BEAN) 19 | public AsyncTaskLoaderAssert hasLoadInBackgroundCancelled() { 20 | isNotNull(); 21 | assertThat(actual.isLoadInBackgroundCanceled()) // 22 | .overridingErrorMessage("Expected load in background cancelled but was not cancelled.") // 23 | .isTrue(); 24 | return this; 25 | } 26 | 27 | @TargetApi(JELLY_BEAN) 28 | public AsyncTaskLoaderAssert hasLoadInBackgroundNotCancelled() { 29 | isNotNull(); 30 | assertThat(actual.isLoadInBackgroundCanceled()) // 31 | .overridingErrorMessage("Expected load in background not cancelled but was cancelled.") // 32 | .isFalse(); 33 | return this; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/content/LoaderAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.content; 2 | 3 | import android.content.Loader; 4 | 5 | /** 6 | * Assertions for {@link Loader} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractLoaderAssert}. 9 | */ 10 | public final class LoaderAssert extends AbstractLoaderAssert { 11 | public LoaderAssert(Loader actual) { 12 | super(actual, LoaderAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/content/SharedPreferencesAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.content; 2 | 3 | import android.content.SharedPreferences; 4 | 5 | /** 6 | * Assertions for {@link android.content.SharedPreferences} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractSharedPreferencesAssert}. 9 | */ 10 | public final class SharedPreferencesAssert extends 11 | AbstractSharedPreferencesAssert { 12 | public SharedPreferencesAssert(SharedPreferences actual) { 13 | super(actual, SharedPreferencesAssert.class); 14 | } 15 | } -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/content/res/ConfigurationUiModeType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.content.res; 2 | 3 | import android.content.res.Configuration; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Configuration.UI_MODE_TYPE_NORMAL, 11 | Configuration.UI_MODE_TYPE_APPLIANCE, 12 | Configuration.UI_MODE_TYPE_CAR, 13 | Configuration.UI_MODE_TYPE_DESK, 14 | Configuration.UI_MODE_TYPE_TELEVISION, 15 | Configuration.UI_MODE_TYPE_UNDEFINED, 16 | Configuration.UI_MODE_TYPE_WATCH 17 | }) 18 | @Retention(SOURCE) 19 | public @interface ConfigurationUiModeType { 20 | } 21 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/database/AbstractAbstractCursorAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.database; 3 | 4 | import android.annotation.TargetApi; 5 | import android.database.AbstractCursor; 6 | import android.net.Uri; 7 | 8 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 9 | import static org.assertj.core.api.Assertions.assertThat; 10 | 11 | public abstract class AbstractAbstractCursorAssert, A extends AbstractCursor> 12 | extends AbstractCursorAssert { 13 | protected AbstractAbstractCursorAssert(A actual, Class selfType) { 14 | super(actual, selfType); 15 | } 16 | 17 | @TargetApi(HONEYCOMB) 18 | public S hasNotificationUri(Uri uri) { 19 | isNotNull(); 20 | Uri actualUri = actual.getNotificationUri(); 21 | assertThat(actualUri) // 22 | .overridingErrorMessage("Expected notification URI <%s> but was <%s>.", uri, actualUri) // 23 | .isEqualTo(uri); 24 | return myself; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/database/AbstractCursor_Assert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.database; 3 | 4 | import android.database.AbstractCursor; 5 | 6 | /** 7 | * Assertions for {@link AbstractCursor} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractAbstractCursorAssert}. 10 | */ 11 | public final class AbstractCursor_Assert 12 | extends AbstractAbstractCursorAssert { 13 | public AbstractCursor_Assert(AbstractCursor actual) { 14 | super(actual, AbstractCursor_Assert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/database/CursorAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.database; 3 | 4 | import android.database.Cursor; 5 | 6 | /** 7 | * Assertions for {@link Cursor} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractCursorAssert}. 10 | */ 11 | public final class CursorAssert extends AbstractCursorAssert { 12 | public CursorAssert(Cursor actual) { 13 | super(actual, CursorAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/database/CursorWindowAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.database; 3 | 4 | import android.database.CursorWindow; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link CursorWindow} instances. */ 10 | public class CursorWindowAssert extends AbstractAssert { 11 | public CursorWindowAssert(CursorWindow actual) { 12 | super(actual, CursorWindowAssert.class); 13 | } 14 | 15 | public CursorWindowAssert hasRowCount(int count) { 16 | isNotNull(); 17 | int actualCount = actual.getNumRows(); 18 | assertThat(actualCount) // 19 | .overridingErrorMessage("Expected row count <%s> but was <%s>.", count, actualCount) // 20 | .isEqualTo(count); 21 | return this; 22 | } 23 | 24 | public CursorWindowAssert hasStartPosition(int position) { 25 | isNotNull(); 26 | int actualPosition = actual.getStartPosition(); 27 | assertThat(actualPosition) // 28 | .overridingErrorMessage("Expected start position <%s> but was <%s>.", position, 29 | actualPosition) // 30 | .isEqualTo(position); 31 | return this; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/gesture/GestureOverlayViewGestureStrokeType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.gesture; 2 | 3 | import android.gesture.GestureOverlayView; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GestureOverlayView.GESTURE_STROKE_TYPE_SINGLE, 11 | GestureOverlayView.GESTURE_STROKE_TYPE_MULTIPLE 12 | }) 13 | @Retention(SOURCE) 14 | @interface GestureOverlayViewGestureStrokeType { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/gesture/GestureOverlayViewOrientation.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.gesture; 2 | 3 | import android.gesture.GestureOverlayView; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GestureOverlayView.ORIENTATION_HORIZONTAL, 11 | GestureOverlayView.ORIENTATION_VERTICAL 12 | }) 13 | @Retention(SOURCE) 14 | @interface GestureOverlayViewOrientation { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/gesture/PredictionAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.gesture; 3 | 4 | import android.gesture.Prediction; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Prediction} instances. */ 10 | public class PredictionAssert extends AbstractAssert { 11 | public PredictionAssert(Prediction actual) { 12 | super(actual, PredictionAssert.class); 13 | } 14 | 15 | public PredictionAssert hasName(String name) { 16 | isNotNull(); 17 | String actualName = actual.name; 18 | assertThat(actualName) // 19 | .overridingErrorMessage("Expected name <%s> but was <%s>.", name, actualName) // 20 | .isEqualTo(name); 21 | return this; 22 | } 23 | 24 | public PredictionAssert hasScore(double score) { 25 | isNotNull(); 26 | double actualScore = actual.score; 27 | assertThat(actualScore) // 28 | .overridingErrorMessage("Expected score <%s> but was <%s>.", score, actualScore) // 29 | .isEqualTo(score); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/InterpolatorAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics; 3 | 4 | import android.graphics.Interpolator; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Interpolator} instances. */ 10 | public class InterpolatorAssert extends AbstractAssert { 11 | public InterpolatorAssert(Interpolator actual) { 12 | super(actual, InterpolatorAssert.class); 13 | } 14 | 15 | public InterpolatorAssert hasKeyFrameCount(int count) { 16 | isNotNull(); 17 | int actualCount = actual.getKeyFrameCount(); 18 | assertThat(actualCount) // 19 | .overridingErrorMessage("Expected key frame count <%s> but was <%s>.", count, actualCount) // 20 | .isEqualTo(count); 21 | return this; 22 | } 23 | 24 | public InterpolatorAssert hasValueCount(int count) { 25 | isNotNull(); 26 | int actualCount = actual.getValueCount(); 27 | assertThat(actualCount) // 28 | .overridingErrorMessage("Expected value count <%s> but was <%s>.", count, actualCount) // 29 | .isEqualTo(count); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/MatrixAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics; 3 | 4 | import android.graphics.Matrix; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Matrix} instances. */ 10 | public class MatrixAssert extends AbstractAssert { 11 | public MatrixAssert(Matrix actual) { 12 | super(actual, MatrixAssert.class); 13 | } 14 | 15 | public MatrixAssert isIdentity() { 16 | isNotNull(); 17 | assertThat(actual.isIdentity()) // 18 | .overridingErrorMessage("Expected to be identity matrix but was not.") // 19 | .isTrue(); 20 | return this; 21 | } 22 | 23 | public MatrixAssert isNotIdentity() { 24 | isNotNull(); 25 | assertThat(actual.isIdentity()) // 26 | .overridingErrorMessage("Expected to not be identity matrix but was.") // 27 | .isTrue(); 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/PaintAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics; 3 | 4 | import android.graphics.Paint; 5 | 6 | /** 7 | * Assertions for {@link PaintAssert} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractPaintAssert}. 10 | */ 11 | public final class PaintAssert extends AbstractPaintAssert { 12 | public PaintAssert(Paint actual) { 13 | super(actual, PaintAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/PaintFlags.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.graphics; 2 | 3 | import android.graphics.Paint; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | Paint.ANTI_ALIAS_FLAG, 13 | Paint.DEV_KERN_TEXT_FLAG, 14 | Paint.DITHER_FLAG, 15 | Paint.FAKE_BOLD_TEXT_FLAG, 16 | Paint.FILTER_BITMAP_FLAG, 17 | Paint.LINEAR_TEXT_FLAG, 18 | Paint.STRIKE_THRU_TEXT_FLAG, 19 | Paint.SUBPIXEL_TEXT_FLAG, 20 | Paint.UNDERLINE_TEXT_FLAG 21 | }) 22 | @Retention(SOURCE) 23 | @interface PaintFlags { 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/PathAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics; 3 | 4 | import android.graphics.Path; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Path} instances. */ 10 | public class PathAssert extends AbstractAssert { 11 | public PathAssert(Path actual) { 12 | super(actual, PathAssert.class); 13 | } 14 | 15 | public PathAssert hasFillType(Path.FillType type) { 16 | isNotNull(); 17 | Path.FillType actualType = actual.getFillType(); 18 | assertThat(actualType) // 19 | .overridingErrorMessage("Expected fill type <%s> but was <%s>.", type, actualType) // 20 | .isEqualTo(type); 21 | return this; 22 | } 23 | 24 | public PathAssert isEmpty() { 25 | isNotNull(); 26 | assertThat(actual.isEmpty()) // 27 | .overridingErrorMessage("Expected to be empty but was not.") // 28 | .isTrue(); 29 | return this; 30 | } 31 | 32 | public PathAssert isNotEmpty() { 33 | isNotNull(); 34 | assertThat(actual.isEmpty()) // 35 | .overridingErrorMessage("Expected to not be empty but was.") // 36 | .isFalse(); 37 | return this; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/PathMeasureAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics; 3 | 4 | import android.graphics.PathMeasure; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link PathMeasure} instances. */ 10 | public class PathMeasureAssert extends AbstractAssert { 11 | public PathMeasureAssert(PathMeasure actual) { 12 | super(actual, PathMeasureAssert.class); 13 | } 14 | 15 | public PathMeasureAssert hasLength(float length) { 16 | isNotNull(); 17 | float actualLength = actual.getLength(); 18 | assertThat(actualLength) // 19 | .overridingErrorMessage("Expected length <%s> but was <%s>.", length, actualLength) // 20 | .isEqualTo(length); 21 | return this; 22 | } 23 | 24 | public PathMeasureAssert isClosed() { 25 | isNotNull(); 26 | assertThat(actual.isClosed()) // 27 | .overridingErrorMessage("Expected to be closed but was not.") // 28 | .isTrue(); 29 | return this; 30 | } 31 | 32 | public PathMeasureAssert isNotClosed() { 33 | isNotNull(); 34 | assertThat(actual.isClosed()) // 35 | .overridingErrorMessage("Expected to not be closed but was.") // 36 | .isFalse(); 37 | return this; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/PictureAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics; 3 | 4 | import android.graphics.Picture; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Picture} instances. */ 10 | public class PictureAssert extends AbstractAssert { 11 | public PictureAssert(Picture actual) { 12 | super(actual, PictureAssert.class); 13 | } 14 | 15 | public PictureAssert hasHeight(int height) { 16 | isNotNull(); 17 | int actualHeight = actual.getHeight(); 18 | assertThat(actualHeight) // 19 | .overridingErrorMessage("Expected height <%s> but was <%s>.", height, actualHeight) // 20 | .isEqualTo(height); 21 | return this; 22 | } 23 | 24 | public PictureAssert hasWidth(int width) { 25 | isNotNull(); 26 | int actualWidth = actual.getWidth(); 27 | assertThat(actualWidth) // 28 | .overridingErrorMessage("Expected width <%s> but was <%s>.", width, actualWidth) // 29 | .isEqualTo(width); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/PointAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics; 3 | 4 | import android.graphics.Point; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Point} instances. */ 10 | public class PointAssert extends AbstractAssert { 11 | public PointAssert(Point actual) { 12 | super(actual, PointAssert.class); 13 | } 14 | 15 | public PointAssert hasX(int x) { 16 | isNotNull(); 17 | int actualX = actual.x; 18 | assertThat(actualX) // 19 | .overridingErrorMessage("Expected X <%s> but was <%s>.", x, actualX) // 20 | .isEqualTo(x); 21 | return this; 22 | } 23 | 24 | public PointAssert hasY(int y) { 25 | isNotNull(); 26 | int actualY = actual.y; 27 | assertThat(actualY) // 28 | .overridingErrorMessage("Expected Y <%s> but was <%s>.", y, actualY) // 29 | .isEqualTo(y); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/PointFAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics; 3 | 4 | import android.graphics.PointF; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link PointF} instances. */ 10 | public class PointFAssert extends AbstractAssert { 11 | public PointFAssert(PointF actual) { 12 | super(actual, PointFAssert.class); 13 | } 14 | 15 | public PointFAssert hasX(float x) { 16 | isNotNull(); 17 | float actualX = actual.x; 18 | assertThat(actualX) // 19 | .overridingErrorMessage("Expected X <%s> but was <%s>.", x, actualX) // 20 | .isEqualTo(x); 21 | return this; 22 | } 23 | 24 | public PointFAssert hasY(float y) { 25 | isNotNull(); 26 | float actualY = actual.y; 27 | assertThat(actualY) // 28 | .overridingErrorMessage("Expected Y <%s> but was <%s>.", y, actualY) // 29 | .isEqualTo(y); 30 | return this; 31 | } 32 | 33 | public PointFAssert hasLength(float length) { 34 | isNotNull(); 35 | float actualLength = actual.length(); 36 | assertThat(actualLength) // 37 | .overridingErrorMessage("Expected length <%s> but was <%s>.", length, actualLength) // 38 | .isEqualTo(length); 39 | return this; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/drawable/ColorDrawableAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics.drawable; 3 | 4 | import android.annotation.TargetApi; 5 | import android.graphics.drawable.ColorDrawable; 6 | 7 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | /** Assertions for {@link ColorDrawable} instances. */ 11 | public class ColorDrawableAssert 12 | extends AbstractDrawableAssert { 13 | public ColorDrawableAssert(ColorDrawable actual) { 14 | super(actual, ColorDrawableAssert.class); 15 | } 16 | 17 | @TargetApi(HONEYCOMB) 18 | public ColorDrawableAssert hasColor(int color) { 19 | isNotNull(); 20 | int actualColor = actual.getColor(); 21 | assertThat(actualColor) // 22 | .overridingErrorMessage("Expected color <%s> but was <%s>.", Integer.toHexString(color), 23 | Integer.toHexString(actualColor)) // 24 | .isEqualTo(color); 25 | return this; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/drawable/DrawableAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics.drawable; 3 | 4 | import android.graphics.drawable.Drawable; 5 | 6 | /** 7 | * Assertions for {@link Drawable} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractDrawableAssert}. 10 | */ 11 | public final class DrawableAssert extends AbstractDrawableAssert { 12 | public DrawableAssert(Drawable actual) { 13 | super(actual, DrawableAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/drawable/GradientDrawableAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics.drawable; 3 | 4 | import android.annotation.TargetApi; 5 | import android.graphics.drawable.GradientDrawable; 6 | 7 | import static android.os.Build.VERSION_CODES.JELLY_BEAN; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | /** Assertions for {@link android.graphics.drawable.GradientDrawable} instances. */ 11 | public class GradientDrawableAssert 12 | extends AbstractDrawableAssert { 13 | public GradientDrawableAssert(GradientDrawable actual) { 14 | super(actual, GradientDrawableAssert.class); 15 | } 16 | 17 | @TargetApi(JELLY_BEAN) 18 | public GradientDrawableAssert hasOrientation(GradientDrawable.Orientation orientation) { 19 | isNotNull(); 20 | GradientDrawable.Orientation actualOrientation = actual.getOrientation(); 21 | assertThat(actualOrientation) // 22 | .overridingErrorMessage("Expected orientation <%s> but was <%s>.", orientation, 23 | actualOrientation) // 24 | .isEqualTo(orientation); 25 | return this; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/drawable/LayerDrawableAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics.drawable; 3 | 4 | import android.graphics.drawable.LayerDrawable; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link LayerDrawable} instances. */ 9 | public class LayerDrawableAssert 10 | extends AbstractDrawableAssert { 11 | public LayerDrawableAssert(LayerDrawable actual) { 12 | super(actual, LayerDrawableAssert.class); 13 | } 14 | 15 | public LayerDrawableAssert hasLayerCount(int count) { 16 | isNotNull(); 17 | int actualCount = actual.getNumberOfLayers(); 18 | assertThat(actualCount) // 19 | .overridingErrorMessage("Expected layer count <%s> but was <%s>.", count, actualCount) // 20 | .isEqualTo(count); 21 | return this; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/graphics/drawable/TransitionDrawableAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.graphics.drawable; 3 | 4 | import android.graphics.drawable.TransitionDrawable; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link TransitionDrawable} instances. */ 9 | public class TransitionDrawableAssert 10 | extends AbstractDrawableAssert { 11 | public TransitionDrawableAssert(TransitionDrawable actual) { 12 | super(actual, TransitionDrawableAssert.class); 13 | } 14 | 15 | public TransitionDrawableAssert isCrossFadeEnabled() { 16 | isNotNull(); 17 | assertThat(actual.isCrossFadeEnabled()) // 18 | .overridingErrorMessage("Expected cross-fade to be enabled but was disabled.") // 19 | .isTrue(); 20 | return this; 21 | } 22 | 23 | public TransitionDrawableAssert isCrossFadeDisabled() { 24 | isNotNull(); 25 | assertThat(actual.isCrossFadeEnabled()) // 26 | .overridingErrorMessage("Expected cross-fade to be disabled but was enabled.") // 27 | .isFalse(); 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/hardware/SensorType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.hardware; 2 | 3 | import android.hardware.Sensor; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Sensor.TYPE_ACCELEROMETER, 11 | Sensor.TYPE_ALL, 12 | Sensor.TYPE_AMBIENT_TEMPERATURE, 13 | Sensor.TYPE_GAME_ROTATION_VECTOR, 14 | Sensor.TYPE_GEOMAGNETIC_ROTATION_VECTOR, 15 | Sensor.TYPE_GRAVITY, 16 | Sensor.TYPE_GYROSCOPE, 17 | Sensor.TYPE_GYROSCOPE_UNCALIBRATED, 18 | Sensor.TYPE_HEART_RATE, 19 | Sensor.TYPE_LIGHT, 20 | Sensor.TYPE_LINEAR_ACCELERATION, 21 | Sensor.TYPE_MAGNETIC_FIELD, 22 | Sensor.TYPE_MAGNETIC_FIELD_UNCALIBRATED, 23 | Sensor.TYPE_ORIENTATION, 24 | Sensor.TYPE_PRESSURE, 25 | Sensor.TYPE_PROXIMITY, 26 | Sensor.TYPE_RELATIVE_HUMIDITY, 27 | Sensor.TYPE_ROTATION_VECTOR, 28 | Sensor.TYPE_SIGNIFICANT_MOTION, 29 | Sensor.TYPE_STEP_COUNTER, 30 | Sensor.TYPE_STEP_DETECTOR, 31 | Sensor.TYPE_TEMPERATURE 32 | }) 33 | @Retention(SOURCE) 34 | @interface SensorType { 35 | } 36 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/hardware/usb/UsbRequestAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.hardware.usb; 3 | 4 | import android.annotation.TargetApi; 5 | import android.hardware.usb.UsbEndpoint; 6 | import android.hardware.usb.UsbRequest; 7 | import org.assertj.core.api.AbstractAssert; 8 | 9 | import static android.os.Build.VERSION_CODES.HONEYCOMB_MR1; 10 | import static org.assertj.core.api.Assertions.assertThat; 11 | 12 | /** Assertions for {@link UsbRequest} instances. */ 13 | @TargetApi(HONEYCOMB_MR1) 14 | public class UsbRequestAssert extends AbstractAssert { 15 | public UsbRequestAssert(UsbRequest actual) { 16 | super(actual, UsbRequestAssert.class); 17 | } 18 | 19 | public UsbRequestAssert hasClientData(Object data) { 20 | isNotNull(); 21 | Object actualData = actual.getClientData(); 22 | assertThat(actualData) // 23 | .overridingErrorMessage("Expected client data <%s> but was <%s>.", data, actualData) // 24 | .isEqualTo(data); 25 | return this; 26 | } 27 | 28 | public UsbRequestAssert hasEndpoint(UsbEndpoint endpoint) { 29 | isNotNull(); 30 | UsbEndpoint actualEndpoint = actual.getEndpoint(); 31 | assertThat(actualEndpoint) // 32 | .overridingErrorMessage("Expected endpoint <%s> but was <%s>.", endpoint, actualEndpoint) // 33 | .isEqualTo(endpoint); 34 | return this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/inputmethodservice/ExtractEditTextAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.inputmethodservice; 3 | 4 | import android.inputmethodservice.ExtractEditText; 5 | import org.assertj.android.api.widget.AbstractTextViewAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | public class ExtractEditTextAssert extends AbstractTextViewAssert { 10 | public ExtractEditTextAssert(ExtractEditText actual) { 11 | super(actual, ExtractEditTextAssert.class); 12 | } 13 | 14 | public ExtractEditTextAssert isInputMethodTarget() { 15 | isNotNull(); 16 | assertThat(actual.isInputMethodTarget()) // 17 | .overridingErrorMessage("Expected to be input method target but was not.") // 18 | .isTrue(); 19 | return this; 20 | } 21 | 22 | public ExtractEditTextAssert isNotInputMethodTarget() { 23 | isNotNull(); 24 | assertThat(actual.isInputMethodTarget()) // 25 | .overridingErrorMessage("Expected to not be input method target but was.") // 26 | .isFalse(); 27 | return this; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/location/CriteriaAccuracy.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.location; 2 | 3 | import android.location.Criteria; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Criteria.ACCURACY_LOW, 11 | Criteria.ACCURACY_MEDIUM, 12 | Criteria.ACCURACY_HIGH 13 | }) 14 | @Retention(SOURCE) 15 | @interface CriteriaAccuracy { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/location/CriteriaAccuracyRequirement.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.location; 2 | 3 | import android.location.Criteria; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Criteria.ACCURACY_COARSE, 11 | Criteria.ACCURACY_FINE 12 | }) 13 | @Retention(SOURCE) 14 | @interface CriteriaAccuracyRequirement { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/location/CriteriaPowerRequirement.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.location; 2 | 3 | import android.location.Criteria; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Criteria.NO_REQUIREMENT, 11 | Criteria.POWER_LOW, 12 | Criteria.POWER_MEDIUM, 13 | Criteria.POWER_HIGH 14 | }) 15 | @Retention(SOURCE) 16 | @interface CriteriaPowerRequirement { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/location/GpsStatusAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.location; 3 | 4 | import android.location.GpsStatus; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link GpsStatus} instances. */ 10 | public class GpsStatusAssert extends AbstractAssert { 11 | public GpsStatusAssert(GpsStatus actual) { 12 | super(actual, GpsStatusAssert.class); 13 | } 14 | 15 | public GpsStatusAssert hasMaximumSatellites(int count) { 16 | isNotNull(); 17 | int actualCount = actual.getMaxSatellites(); 18 | assertThat(actualCount) // 19 | .overridingErrorMessage("Expected maximum satellites <%s> but was <%s>.", count, 20 | actualCount) // 21 | .isEqualTo(count); 22 | return this; 23 | } 24 | 25 | public GpsStatusAssert hasTimeToFirstFix(int time) { 26 | isNotNull(); 27 | int actualTime = actual.getTimeToFirstFix(); 28 | assertThat(actualTime) // 29 | .overridingErrorMessage("Expected time to first fix <%s> but was <%s>.", time, 30 | actualTime) // 31 | .isEqualTo(time); 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/os/AsyncTaskAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.os; 3 | 4 | import android.os.AsyncTask; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link AsyncTask} instances. */ 10 | public class AsyncTaskAssert extends AbstractAssert { 11 | public AsyncTaskAssert(AsyncTask actual) { 12 | super(actual, AsyncTaskAssert.class); 13 | } 14 | 15 | public AsyncTaskAssert hasStatus(AsyncTask.Status status) { 16 | isNotNull(); 17 | AsyncTask.Status actualStatus = actual.getStatus(); 18 | assertThat(actualStatus) // 19 | .overridingErrorMessage("Expected status <%s> but was <%s>.", status, actualStatus) // 20 | .isEqualTo(status); 21 | return this; 22 | } 23 | 24 | public AsyncTaskAssert isCancelled() { 25 | isNotNull(); 26 | assertThat(actual.isCancelled()) // 27 | .overridingErrorMessage("Expected to be cancelled but was not.") // 28 | .isTrue(); 29 | return this; 30 | } 31 | 32 | public AsyncTaskAssert isNotCancelled() { 33 | isNotNull(); 34 | assertThat(actual.isCancelled()) // 35 | .overridingErrorMessage("Expected to not be cancelled but was.") // 36 | .isFalse(); 37 | return this; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/os/VibratorAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.os; 3 | 4 | import android.annotation.TargetApi; 5 | import android.os.Vibrator; 6 | import org.assertj.core.api.AbstractAssert; 7 | import org.assertj.core.api.Assertions; 8 | 9 | import static android.os.Build.VERSION_CODES.HONEYCOMB; 10 | 11 | /** Assertions for {@link Vibrator} instances. Buzz buzz. */ 12 | public class VibratorAssert extends AbstractAssert { 13 | public VibratorAssert(Vibrator actual) { 14 | super(actual, VibratorAssert.class); 15 | } 16 | 17 | @TargetApi(HONEYCOMB) 18 | public VibratorAssert hasVibrator() { 19 | isNotNull(); 20 | Assertions.assertThat(actual.hasVibrator()) // 21 | .overridingErrorMessage("Expected to have vibrator but did not.") // 22 | .isTrue(); 23 | return this; 24 | } 25 | 26 | @TargetApi(HONEYCOMB) 27 | public VibratorAssert hasNoVibrator() { 28 | isNotNull(); 29 | Assertions.assertThat(actual.hasVibrator()) // 30 | .overridingErrorMessage("Expected to not have vibrator but did.") // 31 | .isFalse(); 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/AbstractPreferenceGroupAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.preference; 3 | 4 | import android.preference.PreferenceGroup; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public abstract class AbstractPreferenceGroupAssert, A extends PreferenceGroup> 9 | extends AbstractPreferenceAssert { 10 | protected AbstractPreferenceGroupAssert(A actual, Class selfType) { 11 | super(actual, selfType); 12 | } 13 | 14 | public S hasPreferenceCount(int count) { 15 | isNotNull(); 16 | int actualCount = actual.getPreferenceCount(); 17 | assertThat(actualCount) // 18 | .overridingErrorMessage("Expected preference count <%s> but was <%s>.", count, 19 | actualCount) // 20 | .isEqualTo(count); 21 | return myself; 22 | } 23 | 24 | public S isOrderingAsAdded() { 25 | isNotNull(); 26 | assertThat(actual.isOrderingAsAdded()) // 27 | .overridingErrorMessage("Expected to be ordering as added but was not.") // 28 | .isTrue(); 29 | return myself; 30 | } 31 | 32 | public S isNotOrderingAsAdded() { 33 | isNotNull(); 34 | assertThat(actual.isOrderingAsAdded()) // 35 | .overridingErrorMessage("Expected to not be ordering as added but was.") // 36 | .isFalse(); 37 | return myself; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/CheckBoxPreferenceAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.preference; 3 | 4 | import android.preference.CheckBoxPreference; 5 | 6 | /** Assertions for {@link CheckBoxPreference} instances. */ 7 | public class CheckBoxPreferenceAssert 8 | extends AbstractTwoStatePreference { 9 | /* Since TwoStatePreference is ICS+ this class allows CheckBoxPreference asserts on pre-ICS. */ 10 | public CheckBoxPreferenceAssert(CheckBoxPreference actual) { 11 | super(actual, CheckBoxPreferenceAssert.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/DialogPreferenceAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.preference; 3 | 4 | import android.preference.DialogPreference; 5 | 6 | /** 7 | * Assertions for {@link DialogPreference} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractDialogPreferenceAssert}. 10 | */ 11 | public final class DialogPreferenceAssert 12 | extends AbstractDialogPreferenceAssert { 13 | public DialogPreferenceAssert(DialogPreference actual) { 14 | super(actual, DialogPreferenceAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/EditTextPreferenceAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.preference; 3 | 4 | import android.preference.EditTextPreference; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link EditTextPreference} instances. */ 9 | public class EditTextPreferenceAssert 10 | extends AbstractDialogPreferenceAssert { 11 | public EditTextPreferenceAssert(EditTextPreference actual) { 12 | super(actual, EditTextPreferenceAssert.class); 13 | } 14 | 15 | public EditTextPreferenceAssert hasText(String text) { 16 | isNotNull(); 17 | String actualText = actual.getText(); 18 | assertThat(actualText) // 19 | .overridingErrorMessage("Expected text <%s> but was <%s>.", text, actualText) // 20 | .isEqualTo(text); 21 | return this; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/PreferenceAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.preference; 3 | 4 | import android.preference.Preference; 5 | 6 | /** 7 | * Assertions for {@link Preference} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractPreferenceAssert}. 10 | */ 11 | public final class PreferenceAssert extends AbstractPreferenceAssert { 12 | public PreferenceAssert(Preference actual) { 13 | super(actual, PreferenceAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/PreferenceGroupAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.preference; 3 | 4 | import android.preference.PreferenceGroup; 5 | 6 | /** 7 | * Assertions for {@link PreferenceGroup} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractPreferenceGroupAssert}. 10 | */ 11 | public final class PreferenceGroupAssert 12 | extends AbstractPreferenceGroupAssert { 13 | public PreferenceGroupAssert(PreferenceGroup actual) { 14 | super(actual, PreferenceGroupAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/PreferenceScreenAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.preference; 3 | 4 | import android.app.Dialog; 5 | import android.preference.PreferenceScreen; 6 | import android.widget.ListAdapter; 7 | 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | /** Assertions for {@link PreferenceScreen} instances. */ 11 | public class PreferenceScreenAssert 12 | extends AbstractPreferenceGroupAssert { 13 | public PreferenceScreenAssert(PreferenceScreen actual) { 14 | super(actual, PreferenceScreenAssert.class); 15 | } 16 | 17 | public PreferenceScreenAssert hasDialog(Dialog dialog) { 18 | isNotNull(); 19 | Dialog actualDialog = actual.getDialog(); 20 | assertThat(actualDialog) // 21 | .overridingErrorMessage("Expected dialog <%s> but was <%s>.", dialog, actualDialog) // 22 | .isSameAs(dialog); 23 | return this; 24 | } 25 | 26 | public PreferenceScreenAssert hasRootAdapter(ListAdapter adapter) { 27 | isNotNull(); 28 | ListAdapter actualAdapter = actual.getRootAdapter(); 29 | assertThat(actualAdapter) // 30 | .overridingErrorMessage("Expected root adapter <%s> but was <%s>.", adapter, 31 | actualAdapter) // 32 | .isSameAs(adapter); 33 | return this; 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/RingtoneType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.preference; 2 | 3 | import android.media.RingtoneManager; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | RingtoneManager.TYPE_ALARM, 13 | RingtoneManager.TYPE_NOTIFICATION, 14 | RingtoneManager.TYPE_RINGTONE 15 | } 16 | ) 17 | @Retention(SOURCE) 18 | @interface RingtoneType { 19 | } 20 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/preference/TwoStatePreferenceAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.preference; 3 | 4 | import android.preference.TwoStatePreference; 5 | 6 | /** 7 | * Assertions for {@link TwoStatePreference} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractTwoStatePreference}. 10 | */ 11 | public final class TwoStatePreferenceAssert 12 | extends AbstractTwoStatePreference { 13 | public TwoStatePreferenceAssert(TwoStatePreference actual) { 14 | super(actual, TwoStatePreferenceAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/CellInfoAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.annotation.TargetApi; 4 | import android.telephony.CellInfo; 5 | 6 | import org.assertj.core.api.AbstractAssert; 7 | 8 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; 9 | import static org.assertj.core.api.Assertions.assertThat; 10 | 11 | @TargetApi(JELLY_BEAN_MR1) 12 | public class CellInfoAssert extends AbstractAssert { 13 | public CellInfoAssert(CellInfo actual) { 14 | super(actual, CellInfoAssert.class); 15 | } 16 | 17 | public CellInfoAssert hasTimeStamp(long timeStamp) { 18 | isNotNull(); 19 | long actualTimeStamp = actual.getTimeStamp(); 20 | assertThat(actualTimeStamp) // 21 | .overridingErrorMessage("Expected time stamp <%s> but was <%s>.", timeStamp, actualTimeStamp) // 22 | .isEqualTo(timeStamp); 23 | return this; 24 | } 25 | 26 | public CellInfoAssert isRegistered() { 27 | isNotNull(); 28 | assertThat(actual.isRegistered()) // 29 | .overridingErrorMessage("Expected to be registered but was not") // 30 | .isTrue(); 31 | return this; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/CellSignalStrengthGsmAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.annotation.TargetApi; 4 | import android.telephony.CellSignalStrengthGsm; 5 | 6 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; 7 | 8 | @TargetApi(JELLY_BEAN_MR1) 9 | public class CellSignalStrengthGsmAssert extends AbstractCellSignalStrengthAssert { 10 | public CellSignalStrengthGsmAssert(CellSignalStrengthGsm actual) { 11 | super(actual, CellSignalStrengthGsmAssert.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/CellSignalStrengthLteAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.annotation.TargetApi; 4 | import android.telephony.CellSignalStrengthLte; 5 | 6 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | @TargetApi(JELLY_BEAN_MR1) 10 | public class CellSignalStrengthLteAssert extends AbstractCellSignalStrengthAssert { 11 | public CellSignalStrengthLteAssert(CellSignalStrengthLte actual) { 12 | super(actual, CellSignalStrengthLteAssert.class); 13 | } 14 | 15 | public CellSignalStrengthLteAssert hasTimingAdvance(int timingAdvance) { 16 | isNotNull(); 17 | int actualTimingAdvance = actual.getTimingAdvance(); 18 | assertThat(actualTimingAdvance) // 19 | .overridingErrorMessage("Expected timing advance <%s> but was <%s>.", timingAdvance, actualTimingAdvance) // 20 | .isEqualTo(timingAdvance); 21 | return this; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/CellSignalStrengthWcdmaAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.annotation.TargetApi; 4 | import android.telephony.CellSignalStrengthWcdma; 5 | 6 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR2; 7 | 8 | @TargetApi(JELLY_BEAN_MR2) 9 | public class CellSignalStrengthWcdmaAssert extends AbstractCellSignalStrengthAssert { 10 | public CellSignalStrengthWcdmaAssert(CellSignalStrengthWcdma actual) { 11 | super(actual, CellSignalStrengthWcdmaAssert.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/ServiceStateState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.telephony.ServiceState; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ServiceState.STATE_EMERGENCY_ONLY, 11 | ServiceState.STATE_IN_SERVICE, 12 | ServiceState.STATE_OUT_OF_SERVICE, 13 | ServiceState.STATE_POWER_OFF 14 | }) 15 | @Retention(SOURCE) 16 | @interface ServiceStateState { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/TelephonyManagerCallState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.telephony.TelephonyManager; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | TelephonyManager.CALL_STATE_IDLE, 11 | TelephonyManager.CALL_STATE_OFFHOOK, 12 | TelephonyManager.CALL_STATE_RINGING 13 | }) 14 | @Retention(SOURCE) 15 | @interface TelephonyManagerCallState { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/TelephonyManagerDataActivity.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.telephony.TelephonyManager; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | TelephonyManager.DATA_ACTIVITY_DORMANT, 11 | TelephonyManager.DATA_ACTIVITY_IN, 12 | TelephonyManager.DATA_ACTIVITY_INOUT, 13 | TelephonyManager.DATA_ACTIVITY_NONE, 14 | TelephonyManager.DATA_ACTIVITY_OUT 15 | }) 16 | @Retention(SOURCE) 17 | @interface TelephonyManagerDataActivity { 18 | } 19 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/TelephonyManagerDataState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.telephony.TelephonyManager; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | TelephonyManager.DATA_CONNECTED, 11 | TelephonyManager.DATA_CONNECTING, 12 | TelephonyManager.DATA_DISCONNECTED, 13 | TelephonyManager.DATA_SUSPENDED 14 | }) 15 | @Retention(SOURCE) 16 | @interface TelephonyManagerDataState { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/TelephonyManagerNetworkType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.telephony.TelephonyManager; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | TelephonyManager.NETWORK_TYPE_1xRTT, 11 | TelephonyManager.NETWORK_TYPE_CDMA, 12 | TelephonyManager.NETWORK_TYPE_EDGE, 13 | TelephonyManager.NETWORK_TYPE_EHRPD, 14 | TelephonyManager.NETWORK_TYPE_EVDO_0, 15 | TelephonyManager.NETWORK_TYPE_EVDO_A, 16 | TelephonyManager.NETWORK_TYPE_EVDO_B, 17 | TelephonyManager.NETWORK_TYPE_GPRS, 18 | TelephonyManager.NETWORK_TYPE_HSDPA, 19 | TelephonyManager.NETWORK_TYPE_HSPA, 20 | TelephonyManager.NETWORK_TYPE_HSPAP, 21 | TelephonyManager.NETWORK_TYPE_HSUPA, 22 | TelephonyManager.NETWORK_TYPE_IDEN, 23 | TelephonyManager.NETWORK_TYPE_LTE, 24 | TelephonyManager.NETWORK_TYPE_UMTS, 25 | TelephonyManager.NETWORK_TYPE_UNKNOWN 26 | }) 27 | @Retention(SOURCE) 28 | @interface TelephonyManagerNetworkType { 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/TelephonyManagerPhoneType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.telephony.TelephonyManager; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | TelephonyManager.PHONE_TYPE_CDMA, 11 | TelephonyManager.PHONE_TYPE_GSM, 12 | TelephonyManager.PHONE_TYPE_NONE, 13 | TelephonyManager.PHONE_TYPE_SIP 14 | }) 15 | @Retention(SOURCE) 16 | @interface TelephonyManagerPhoneType { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/telephony/TelephonyManagerSimState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.telephony; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.telephony.TelephonyManager; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | TelephonyManager.SIM_STATE_ABSENT, 11 | TelephonyManager.SIM_STATE_NETWORK_LOCKED, 12 | TelephonyManager.SIM_STATE_PIN_REQUIRED, 13 | TelephonyManager.SIM_STATE_PUK_REQUIRED, 14 | TelephonyManager.SIM_STATE_READY, 15 | TelephonyManager.SIM_STATE_UNKNOWN 16 | }) 17 | @Retention(SOURCE) 18 | @interface TelephonyManagerSimState { 19 | } 20 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/text/BidiFormatterAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.text; 2 | 3 | import android.annotation.TargetApi; 4 | import android.text.BidiFormatter; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR2; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | @TargetApi(JELLY_BEAN_MR2) 11 | public class BidiFormatterAssert extends AbstractAssert { 12 | public BidiFormatterAssert(BidiFormatter actual) { 13 | super(actual, BidiFormatterAssert.class); 14 | } 15 | 16 | public BidiFormatterAssert hasRtlContext() { 17 | isNotNull(); 18 | assertThat(actual.isRtlContext()) // 19 | .overridingErrorMessage("Expected RTL context but was not.") // 20 | .isTrue(); 21 | return this; 22 | } 23 | 24 | public BidiFormatterAssert doesNotHaveRtlContext() { 25 | isNotNull(); 26 | assertThat(actual.isRtlContext()) // 27 | .overridingErrorMessage("Expected not to be RTL context but was.") // 28 | .isFalse(); 29 | return this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/util/ArrayMapAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.util; 2 | 3 | import android.annotation.TargetApi; 4 | import android.util.ArrayMap; 5 | import org.assertj.core.api.AbstractMapAssert; 6 | 7 | import static android.os.Build.VERSION_CODES.KITKAT; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | @TargetApi(KITKAT) 11 | public class ArrayMapAssert 12 | extends AbstractMapAssert, ArrayMap, K, V> { 13 | public ArrayMapAssert(ArrayMap actual) { 14 | super(actual, ArrayMapAssert.class); 15 | } 16 | 17 | public ArrayMapAssert hasKeyAt(int index, K key) { 18 | isNotNull(); 19 | K actualKey = actual.keyAt(index); 20 | assertThat(actualKey) // 21 | .overridingErrorMessage("Expected key <%s> at index <%s> but was <%s>.", key, actualKey, 22 | index) // 23 | .isEqualTo(key); 24 | return this; 25 | } 26 | 27 | public ArrayMapAssert hasValueAt(int index, V value) { 28 | isNotNull(); 29 | V actualValue = actual.valueAt(index); 30 | assertThat(actualValue) // 31 | .overridingErrorMessage("Expected value <%s> but was <%s> at index <%s>.", value, 32 | actualValue, index) // 33 | .isEqualTo(value); 34 | return this; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/util/AtomicFileAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.util; 2 | 3 | import android.annotation.TargetApi; 4 | import android.util.AtomicFile; 5 | import java.io.File; 6 | import org.assertj.core.api.AbstractAssert; 7 | 8 | import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; 9 | import static org.assertj.core.api.Assertions.assertThat; 10 | 11 | @TargetApi(JELLY_BEAN_MR1) 12 | public class AtomicFileAssert extends AbstractAssert { 13 | public AtomicFileAssert(AtomicFile actual) { 14 | super(actual, AtomicFileAssert.class); 15 | } 16 | 17 | public AtomicFileAssert hasBaseFile(File file) { 18 | isNotNull(); 19 | File actualFile = actual.getBaseFile(); 20 | assertThat(actualFile) // 21 | .overridingErrorMessage("Expected base file <%s> but was <%s>.", file, actualFile) // 22 | .isEqualTo(file); 23 | return this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/util/PairAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.util; 3 | 4 | import android.util.Pair; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link Pair} instances. */ 10 | public class PairAssert extends AbstractAssert, Pair> { 11 | public PairAssert(Pair actual) { 12 | super(actual, PairAssert.class); 13 | } 14 | 15 | public PairAssert hasFirst(F first) { 16 | isNotNull(); 17 | F actualFirst = actual.first; 18 | assertThat(actualFirst) // 19 | .overridingErrorMessage("Expected first value <%s> but was <%s>.", first, actualFirst) // 20 | .isEqualTo(first); 21 | return this; 22 | } 23 | 24 | public PairAssert hasSecond(S second) { 25 | isNotNull(); 26 | S actualSecond = actual.second; 27 | assertThat(actualSecond) // 28 | .overridingErrorMessage("Expected second value <%s> but was <%s>.", second, actualSecond) // 29 | .isEqualTo(second); 30 | return this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/util/SparseArrayAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.util; 2 | 3 | import android.util.SparseArray; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link SparseArray} instances. */ 9 | public class SparseArrayAssert extends AbstractAssert, SparseArray> { 10 | public SparseArrayAssert(SparseArray actual) { 11 | super(actual, SparseArrayAssert.class); 12 | } 13 | 14 | public SparseArrayAssert hasKey(int key) { 15 | isNotNull(); 16 | assertThat(actual.indexOfKey(key)) // 17 | .overridingErrorMessage("Expected key <%s> to be present but was not.", key) // 18 | .isGreaterThanOrEqualTo(0); 19 | return this; 20 | } 21 | 22 | public SparseArrayAssert doesNotHaveKey(int key) { 23 | isNotNull(); 24 | assertThat(actual.indexOfKey(key)) // 25 | .overridingErrorMessage("Expected key <%s> to not be present but was.") // 26 | .isLessThan(0); 27 | return this; 28 | } 29 | 30 | public SparseArrayAssert hasSize(int size) { 31 | isNotNull(); 32 | int actualSize = actual.size(); 33 | assertThat(actualSize) // 34 | .overridingErrorMessage("Expected size <%s> but was <%s>.", size, actualSize) // 35 | .isEqualTo(size); 36 | return this; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/util/SparseIntArrayAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.util; 2 | 3 | import android.util.SparseIntArray; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link SparseIntArray} instances. */ 9 | public class SparseIntArrayAssert extends AbstractAssert { 10 | public SparseIntArrayAssert(SparseIntArray actual) { 11 | super(actual, SparseIntArrayAssert.class); 12 | } 13 | 14 | public SparseIntArrayAssert hasKey(int key) { 15 | isNotNull(); 16 | assertThat(actual.indexOfKey(key)) // 17 | .overridingErrorMessage("Expected key <%s> to be present but was not.", key) // 18 | .isGreaterThanOrEqualTo(0); 19 | return this; 20 | } 21 | 22 | public SparseIntArrayAssert doesNotHaveKey(int key) { 23 | isNotNull(); 24 | assertThat(actual.indexOfKey(key)) // 25 | .overridingErrorMessage("Expected key <%s> to not be present but was.") // 26 | .isLessThan(0); 27 | return this; 28 | } 29 | 30 | public SparseIntArrayAssert hasSize(int size) { 31 | isNotNull(); 32 | int actualSize = actual.size(); 33 | assertThat(actualSize) // 34 | .overridingErrorMessage("Expected size <%s> but was <%s>.", size, actualSize) // 35 | .isEqualTo(size); 36 | return this; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/AbstractViewGroupLayoutParamsAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.ViewGroup; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public abstract class AbstractViewGroupLayoutParamsAssert, A extends ViewGroup.LayoutParams> 9 | extends AbstractAssert { 10 | protected AbstractViewGroupLayoutParamsAssert(A actual, Class selfType) { 11 | super(actual, selfType); 12 | } 13 | 14 | public S hasHeight(int height) { 15 | isNotNull(); 16 | int actualHeight = actual.height; 17 | assertThat(actualHeight) // 18 | .overridingErrorMessage("Expected height <%s> but was <%s>", height, actualHeight) // 19 | .isEqualTo(height); 20 | return myself; 21 | } 22 | 23 | public S hasWidth(int width) { 24 | isNotNull(); 25 | int actualWidth = actual.width; 26 | assertThat(actualWidth) // 27 | .overridingErrorMessage("Expected width <%s> but was <%s>", width, actualWidth) // 28 | .isEqualTo(width); 29 | return myself; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/DisplayFlags.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.Display; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | Display.FLAG_PRESENTATION, 13 | Display.FLAG_PRIVATE, 14 | Display.FLAG_SECURE, 15 | Display.FLAG_SUPPORTS_PROTECTED_BUFFERS 16 | } 17 | ) 18 | @Retention(SOURCE) 19 | @interface DisplayFlags { 20 | } 21 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/DisplayPixelFormat.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.graphics.PixelFormat; 4 | import android.support.annotation.IntDef; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | PixelFormat.UNKNOWN, 11 | PixelFormat.TRANSLUCENT, 12 | PixelFormat.TRANSPARENT, 13 | PixelFormat.OPAQUE, 14 | PixelFormat.RGBA_8888, 15 | PixelFormat.RGBX_8888, 16 | PixelFormat.RGB_888, 17 | PixelFormat.RGB_565, 18 | PixelFormat.RGBA_5551, 19 | PixelFormat.RGBA_4444, 20 | PixelFormat.A_8, 21 | PixelFormat.L_8, 22 | PixelFormat.LA_88, 23 | PixelFormat.RGB_332, 24 | PixelFormat.YCbCr_422_SP, 25 | PixelFormat.YCbCr_420_SP, 26 | PixelFormat.YCbCr_422_I, 27 | PixelFormat.JPEG 28 | }) 29 | @Retention(SOURCE) 30 | @interface DisplayPixelFormat { 31 | } 32 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/DisplayState.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.Display; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Display.STATE_DOZE, 11 | Display.STATE_DOZE_SUSPEND, 12 | Display.STATE_OFF, 13 | Display.STATE_ON, 14 | Display.STATE_UNKNOWN 15 | }) 16 | @Retention(SOURCE) 17 | @interface DisplayState { 18 | } 19 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/DragEventAction.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.DragEvent; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | DragEvent.ACTION_DRAG_ENDED, 11 | DragEvent.ACTION_DRAG_ENTERED, 12 | DragEvent.ACTION_DRAG_EXITED, 13 | DragEvent.ACTION_DRAG_LOCATION, 14 | DragEvent.ACTION_DRAG_STARTED, 15 | DragEvent.ACTION_DROP 16 | }) 17 | @Retention(SOURCE) 18 | @interface DragEventAction { 19 | } 20 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/KeyCharacterMapKeyboardType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.KeyCharacterMap; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | KeyCharacterMap.NUMERIC, 11 | KeyCharacterMap.PREDICTIVE, 12 | KeyCharacterMap.ALPHA, 13 | KeyCharacterMap.FULL, 14 | KeyCharacterMap.SPECIAL_FUNCTION 15 | }) 16 | @Retention(SOURCE) 17 | @interface KeyCharacterMapKeyboardType { 18 | } 19 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/OrientationEventListenerAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.OrientationEventListener; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link OrientationEventListener} instances. */ 9 | public class OrientationEventListenerAssert 10 | extends AbstractAssert { 11 | public OrientationEventListenerAssert(OrientationEventListener actual) { 12 | super(actual, OrientationEventListenerAssert.class); 13 | } 14 | 15 | public OrientationEventListenerAssert isDetectingOrientation() { 16 | isNotNull(); 17 | assertThat(actual.canDetectOrientation()) // 18 | .overridingErrorMessage("Expected to be able to detect orientation but could not.") // 19 | .isTrue(); 20 | return this; 21 | } 22 | 23 | public OrientationEventListenerAssert isNotDetectingOrientation() { 24 | isNotNull(); 25 | assertThat(actual.canDetectOrientation()) // 26 | .overridingErrorMessage("Expected to not be able to detect orientation but could.") // 27 | .isFalse(); 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/SurfaceAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.Surface; 4 | import org.assertj.core.api.AbstractAssert; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public class SurfaceAssert extends AbstractAssert { 9 | public SurfaceAssert(Surface actual) { 10 | super(actual, SurfaceAssert.class); 11 | } 12 | 13 | public SurfaceAssert isValid() { 14 | isNotNull(); 15 | assertThat(actual.isValid()) // 16 | .overridingErrorMessage("Expected to be valid but was not valid.") // 17 | .isTrue(); 18 | return this; 19 | } 20 | 21 | public SurfaceAssert isNotValid() { 22 | isNotNull(); 23 | assertThat(actual.isValid()) // 24 | .overridingErrorMessage("Expected to not be valid but was valid.") // 25 | .isFalse(); 26 | return this; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/SurfaceRotation.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.Surface; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Surface.ROTATION_0, 11 | Surface.ROTATION_90, 12 | Surface.ROTATION_180, 13 | Surface.ROTATION_270 14 | }) 15 | @Retention(SOURCE) 16 | @interface SurfaceRotation { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/TextureViewAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.annotation.TargetApi; 4 | import android.view.TextureView; 5 | 6 | import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH; 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link TextureView} instances. */ 10 | @TargetApi(ICE_CREAM_SANDWICH) 11 | public class TextureViewAssert extends AbstractViewAssert { 12 | public TextureViewAssert(TextureView actual) { 13 | super(actual, TextureViewAssert.class); 14 | } 15 | 16 | public TextureViewAssert isAvailable() { 17 | isNotNull(); 18 | assertThat(actual.isAvailable()) // 19 | .overridingErrorMessage("Expected to be available but was not available.") // 20 | .isTrue(); 21 | return this; 22 | } 23 | 24 | public TextureViewAssert isNotAvailable() { 25 | isNotNull(); 26 | assertThat(actual.isAvailable()) // 27 | .overridingErrorMessage("Expected to not be available but was available.") // 28 | .isFalse(); 29 | return this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.View; 4 | 5 | /** 6 | * Assertions for {@link View} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractViewAssert}. 9 | */ 10 | public final class ViewAssert extends AbstractViewAssert { 11 | public ViewAssert(View actual) { 12 | super(actual, ViewAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewGroupAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.ViewGroup; 4 | /** 5 | * Assertions for {@link ViewGroup} instances. 6 | *

7 | * This class is final. To extend use {@link AbstractViewGroupAssert}. 8 | */ 9 | public final class ViewGroupAssert extends AbstractViewGroupAssert { 10 | public ViewGroupAssert(ViewGroup actual) { 11 | super(actual, ViewGroupAssert.class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewGroupDescendantFocusability.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.ViewGroup; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ViewGroup.FOCUS_AFTER_DESCENDANTS, 11 | ViewGroup.FOCUS_BEFORE_DESCENDANTS, 12 | ViewGroup.FOCUS_BLOCK_DESCENDANTS 13 | }) 14 | @Retention(SOURCE) 15 | @interface ViewGroupDescendantFocusability { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewGroupLayoutMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.ViewGroup; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ViewGroup.LAYOUT_MODE_CLIP_BOUNDS, 11 | ViewGroup.LAYOUT_MODE_OPTICAL_BOUNDS 12 | }) 13 | @Retention(SOURCE) 14 | @interface ViewGroupLayoutMode { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewGroupLayoutParamsAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.ViewGroup; 4 | 5 | /** 6 | * Assertions for {@link ViewGroup.LayoutParams} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractViewGroupLayoutParamsAssert}. 9 | */ 10 | public final class ViewGroupLayoutParamsAssert extends 11 | AbstractViewGroupLayoutParamsAssert { 12 | public ViewGroupLayoutParamsAssert(ViewGroup.LayoutParams actual) { 13 | super(actual, ViewGroupLayoutParamsAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewGroupMarginLayoutParamsAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.ViewGroup; 4 | 5 | /** 6 | * Assertions for {@link ViewGroup.MarginLayoutParams} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractViewGroupLayoutParamsAssert}. 9 | */ 10 | public final class ViewGroupMarginLayoutParamsAssert extends 11 | AbstractViewGroupMarginLayoutParamsAssert { 12 | public ViewGroupMarginLayoutParamsAssert(ViewGroup.MarginLayoutParams actual) { 13 | super(actual, ViewGroupMarginLayoutParamsAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewGroupPersistentDrawingCache.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.ViewGroup; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ViewGroup.PERSISTENT_ALL_CACHES, 11 | ViewGroup.PERSISTENT_ANIMATION_CACHE, 12 | ViewGroup.PERSISTENT_NO_CACHE, 13 | ViewGroup.PERSISTENT_SCROLLING_CACHE 14 | }) 15 | @Retention(SOURCE) 16 | @interface ViewGroupPersistentDrawingCache { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewLayerType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | View.LAYER_TYPE_NONE, 11 | View.LAYER_TYPE_SOFTWARE, 12 | View.LAYER_TYPE_HARDWARE 13 | }) 14 | @Retention(SOURCE) 15 | @interface ViewLayerType { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewLayoutDirection.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | View.LAYOUT_DIRECTION_RTL, 11 | View.LAYOUT_DIRECTION_LTR, 12 | View.LAYOUT_DIRECTION_INHERIT, 13 | View.LAYOUT_DIRECTION_LOCALE 14 | }) 15 | @Retention(SOURCE) 16 | public @interface ViewLayoutDirection { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewOverscrollMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | View.OVER_SCROLL_ALWAYS, 11 | View.OVER_SCROLL_IF_CONTENT_SCROLLS, 12 | View.OVER_SCROLL_NEVER 13 | }) 14 | @Retention(SOURCE) 15 | @interface ViewOverscrollMode { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewScrollBarPosition.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | View.SCROLLBAR_POSITION_DEFAULT, 11 | View.SCROLLBAR_POSITION_LEFT, 12 | View.SCROLLBAR_POSITION_RIGHT 13 | }) 14 | @Retention(SOURCE) 15 | @interface ViewScrollBarPosition { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewScrollBarStyle.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | View.SCROLLBARS_INSIDE_INSET, 11 | View.SCROLLBARS_INSIDE_OVERLAY, 12 | View.SCROLLBARS_OUTSIDE_INSET, 13 | View.SCROLLBARS_OUTSIDE_OVERLAY 14 | }) 15 | @Retention(SOURCE) 16 | @interface ViewScrollBarStyle { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewStubAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.ViewStub; 4 | 5 | import static org.assertj.core.api.Assertions.assertThat; 6 | 7 | /** Assertions for {@link ViewStub} instances. */ 8 | public class ViewStubAssert extends AbstractViewAssert { 9 | public ViewStubAssert(ViewStub actual) { 10 | super(actual, ViewStubAssert.class); 11 | } 12 | 13 | public ViewStubAssert hasInflatedId(int id) { 14 | isNotNull(); 15 | int actualId = actual.getInflatedId(); 16 | assertThat(actualId) // 17 | .overridingErrorMessage("Expected view stub inflated ID <%s> but was <%s>", id, actualId) // 18 | .isEqualTo(id); 19 | return this; 20 | } 21 | 22 | public ViewStubAssert hasLayoutResource(int resId) { 23 | isNotNull(); 24 | int actualResId = actual.getLayoutResource(); 25 | assertThat(actualResId) // 26 | .overridingErrorMessage("Expected view stub layout resource <%s> but was <%s>", resId, 27 | actualResId) // 28 | .isEqualTo(resId); 29 | return this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewTextAlignment.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | View.TEXT_ALIGNMENT_INHERIT, 11 | View.TEXT_ALIGNMENT_GRAVITY, 12 | View.TEXT_ALIGNMENT_TEXT_START, 13 | View.TEXT_ALIGNMENT_TEXT_END, 14 | View.TEXT_ALIGNMENT_CENTER, 15 | View.TEXT_ALIGNMENT_VIEW_START, 16 | View.TEXT_ALIGNMENT_VIEW_END 17 | }) 18 | @Retention(SOURCE) 19 | @interface ViewTextAlignment { 20 | } 21 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewTextDirection.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | View.TEXT_DIRECTION_INHERIT, 11 | View.TEXT_DIRECTION_FIRST_STRONG, 12 | View.TEXT_DIRECTION_ANY_RTL, 13 | View.TEXT_DIRECTION_LTR, 14 | View.TEXT_DIRECTION_RTL, 15 | View.TEXT_DIRECTION_LOCALE 16 | }) 17 | @Retention(SOURCE) 18 | @interface ViewTextDirection { 19 | } 20 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewTreeObserverAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.view.ViewTreeObserver; 4 | import org.assertj.core.api.Assertions; 5 | import org.assertj.core.api.AbstractAssert; 6 | 7 | /** Assertions for {@link ViewTreeObserver} instances. */ 8 | public class ViewTreeObserverAssert 9 | extends AbstractAssert { 10 | public ViewTreeObserverAssert(ViewTreeObserver actual) { 11 | super(actual, ViewTreeObserverAssert.class); 12 | } 13 | 14 | public ViewTreeObserverAssert isAlive() { 15 | isNotNull(); 16 | Assertions.assertThat(actual.isAlive()) // 17 | .overridingErrorMessage("Expected to be alive but was not alive.") // 18 | .isTrue(); 19 | return this; 20 | } 21 | 22 | public ViewTreeObserverAssert isNotAlive() { 23 | isNotNull(); 24 | Assertions.assertThat(actual.isAlive()) // 25 | .overridingErrorMessage("Expected to not be alive but was alive.") // 26 | .isFalse(); 27 | return this; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/ViewVisibility.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.View; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | View.VISIBLE, 11 | View.INVISIBLE, 12 | View.GONE 13 | }) 14 | @Retention(SOURCE) 15 | @interface ViewVisibility { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/WindowFeature.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.Window; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | Window.FEATURE_ACTION_BAR, 13 | Window.FEATURE_ACTION_BAR_OVERLAY, 14 | Window.FEATURE_ACTION_MODE_OVERLAY, 15 | Window.FEATURE_CONTEXT_MENU, 16 | Window.FEATURE_CUSTOM_TITLE, 17 | Window.FEATURE_INDETERMINATE_PROGRESS, 18 | Window.FEATURE_LEFT_ICON, 19 | Window.FEATURE_NO_TITLE, 20 | Window.FEATURE_OPTIONS_PANEL, 21 | Window.FEATURE_PROGRESS, 22 | Window.FEATURE_RIGHT_ICON, 23 | Window.FEATURE_SWIPE_TO_DISMISS 24 | }) 25 | @Retention(SOURCE) 26 | @interface WindowFeature { 27 | } 28 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/accessibility/AccessibilityRecordAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.view.accessibility; 3 | 4 | import android.view.accessibility.AccessibilityRecord; 5 | 6 | /** 7 | * Assertions for {@link AccessibilityRecord} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractAccessibilityRecordAssert}. 10 | */ 11 | public final class AccessibilityRecordAssert 12 | extends AbstractAccessibilityRecordAssert { 13 | public AccessibilityRecordAssert(AccessibilityRecord actual) { 14 | super(actual, AccessibilityRecordAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/animation/AnimationAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.view.animation; 3 | 4 | import android.view.animation.Animation; 5 | 6 | /** 7 | * Assertions for {@link Animation} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractAnimationAssert}. 10 | */ 11 | public final class AnimationAssert extends AbstractAnimationAssert { 12 | public AnimationAssert(Animation actual) { 13 | super(actual, AnimationAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/animation/AnimationRepeatMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view.animation; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.animation.Animation; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Animation.RESTART, 11 | Animation.REVERSE 12 | }) 13 | @Retention(SOURCE) 14 | @interface AnimationRepeatMode { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/animation/AnimationSetAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.view.animation; 3 | 4 | import android.view.animation.AnimationSet; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link AnimationSet} instances. */ 9 | public class AnimationSetAssert extends AbstractAnimationAssert { 10 | public AnimationSetAssert(AnimationSet actual) { 11 | super(actual, AnimationSetAssert.class); 12 | } 13 | 14 | public AnimationSetAssert hasDurationHint(long duration) { 15 | isNotNull(); 16 | long actualDuration = actual.computeDurationHint(); 17 | assertThat(actualDuration) // 18 | .overridingErrorMessage("Expected duration hint <%s> but was <%s>.", duration, 19 | actualDuration) // 20 | .isEqualTo(duration); 21 | return this; 22 | } 23 | 24 | public AnimationSetAssert hasAnimationCount(int count) { 25 | isNotNull(); 26 | int actualCount = actual.getAnimations().size(); 27 | assertThat(actualCount) // 28 | .overridingErrorMessage("Expected animation count <%s> but was <%s>.", count, 29 | actualCount) // 30 | .isEqualTo(count); 31 | return this; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/animation/GridLayoutAnimationControllerDirection.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view.animation; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.animation.GridLayoutAnimationController; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GridLayoutAnimationController.DIRECTION_TOP_TO_BOTTOM, 11 | GridLayoutAnimationController.DIRECTION_BOTTOM_TO_TOP, 12 | GridLayoutAnimationController.DIRECTION_LEFT_TO_RIGHT, 13 | GridLayoutAnimationController.DIRECTION_RIGHT_TO_LEFT 14 | }) 15 | @Retention(SOURCE) 16 | @interface GridLayoutAnimationControllerDirection { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/animation/GridLayoutAnimationControllerDirectionPriority.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view.animation; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.animation.GridLayoutAnimationController; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GridLayoutAnimationController.PRIORITY_NONE, 11 | GridLayoutAnimationController.PRIORITY_COLUMN, 12 | GridLayoutAnimationController.PRIORITY_ROW 13 | }) 14 | @Retention(SOURCE) 15 | @interface GridLayoutAnimationControllerDirectionPriority { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/animation/LayoutAnimationControllerAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.view.animation; 3 | 4 | import android.view.animation.LayoutAnimationController; 5 | 6 | /** 7 | * Assertions for {@link LayoutAnimationController} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractLayoutAnimationControllerAssert}. 10 | */ 11 | public final class LayoutAnimationControllerAssert extends 12 | AbstractLayoutAnimationControllerAssert { 13 | public LayoutAnimationControllerAssert(LayoutAnimationController actual) { 14 | super(actual, LayoutAnimationControllerAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/view/animation/TransformationType.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.view.animation; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.animation.Transformation; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Transformation.TYPE_ALPHA, 11 | Transformation.TYPE_BOTH, 12 | Transformation.TYPE_IDENTITY, 13 | Transformation.TYPE_MATRIX 14 | }) 15 | @Retention(SOURCE) 16 | @interface TransformationType { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbsListViewAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.widget.AbsListView; 4 | 5 | /** 6 | * Assertions for {@link AbsListView} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractAbsListViewAssert}. 9 | */ 10 | public final class AbsListViewAssert 11 | extends AbstractAbsListViewAssert { 12 | public AbsListViewAssert(AbsListView actual) { 13 | super(actual, AbsListViewAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbsSeekBarAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.AbsSeekBar; 5 | 6 | /** 7 | * Assertions for {@link AbsSeekBar} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractAbsSeekBarAssert}. 10 | */ 11 | public final class AbsSeekBarAssert extends AbstractAbsSeekBarAssert { 12 | public AbsSeekBarAssert(AbsSeekBar actual) { 13 | super(actual, AbsSeekBarAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbsSpinnerAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.AbsSpinner; 5 | 6 | /** 7 | * Assertions for {@link AbsSpinner} instances. 8 | *

9 | * This class if final. To extend use {@link AbstractAbsSpinnerAssert}. 10 | */ 11 | public final class AbsSpinnerAssert extends AbstractAbsSpinnerAssert { 12 | public AbsSpinnerAssert(AbsSpinner actual) { 13 | super(actual, AbsSpinnerAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbsoluteLayoutAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.widget.AbsoluteLayout; 4 | 5 | /** 6 | * Assertions for {@link AbsoluteLayout} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractAbsoluteLayoutAssert}. 9 | */ 10 | public final class AbsoluteLayoutAssert 11 | extends AbstractAbsoluteLayoutAssert { 12 | public AbsoluteLayoutAssert(AbsoluteLayout actual) { 13 | super(actual, AbsoluteLayoutAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbstractAbsSpinnerAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.AbsSpinner; 5 | import android.widget.SpinnerAdapter; 6 | import org.assertj.core.api.Assertions; 7 | 8 | public abstract class AbstractAbsSpinnerAssert, A extends AbsSpinner> 9 | extends AbstractAdapterViewAssert { 10 | protected AbstractAbsSpinnerAssert(A actual, Class selfType) { 11 | super(actual, selfType); 12 | } 13 | 14 | public S hasAdapter(SpinnerAdapter adapter) { 15 | isNotNull(); 16 | SpinnerAdapter actualAdapter = actual.getAdapter(); 17 | Assertions.assertThat(actualAdapter) // 18 | .overridingErrorMessage("Expected adapter <%s> but was <%s>.", adapter, actualAdapter) // 19 | .isSameAs(adapter); 20 | return myself; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbstractAbsoluteLayoutAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.widget.AbsoluteLayout; 5 | import org.assertj.android.api.view.AbstractViewGroupAssert; 6 | 7 | import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | public abstract class AbstractAbsoluteLayoutAssert, A extends AbsoluteLayout> 11 | extends AbstractViewGroupAssert { 12 | protected AbstractAbsoluteLayoutAssert(A actual, Class selfType) { 13 | super(actual, selfType); 14 | } 15 | 16 | @TargetApi(ICE_CREAM_SANDWICH) 17 | public S isDelayingChildPressedState() { 18 | isNotNull(); 19 | assertThat(actual.shouldDelayChildPressedState()) // 20 | .overridingErrorMessage("Epxected to be delaying child pressed state but was not.") // 21 | .isTrue(); 22 | return myself; 23 | } 24 | 25 | @TargetApi(ICE_CREAM_SANDWICH) 26 | public S isNotDelayingChildPressedState() { 27 | isNotNull(); 28 | assertThat(actual.shouldDelayChildPressedState()) // 29 | .overridingErrorMessage("Expected to not be delaying child pressed state but was.") // 30 | .isFalse(); 31 | return myself; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbstractCompoundButtonAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.CompoundButton; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public abstract class AbstractCompoundButtonAssert, A extends CompoundButton> 9 | extends AbstractTextViewAssert { 10 | public AbstractCompoundButtonAssert(A actual, Class selfType) { 11 | super(actual, selfType); 12 | } 13 | 14 | public S isChecked() { 15 | isNotNull(); 16 | assertThat(actual.isChecked()) // 17 | .overridingErrorMessage("Expected checked but was not checked.") // 18 | .isTrue(); 19 | return myself; 20 | } 21 | 22 | public S isNotChecked() { 23 | isNotNull(); 24 | assertThat(actual.isChecked()) // 25 | .overridingErrorMessage("Expected not checked but was checked.") // 26 | .isFalse(); 27 | return myself; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbstractCursorAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.database.Cursor; 5 | import android.widget.CursorAdapter; 6 | import android.widget.Filter; 7 | 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | public abstract class AbstractCursorAdapterAssert, A extends CursorAdapter> 11 | extends AbstractListAdapterAssert { 12 | protected AbstractCursorAdapterAssert(A actual, Class selfType) { 13 | super(actual, selfType); 14 | } 15 | 16 | public S hasCursor(Cursor cursor) { 17 | isNotNull(); 18 | Cursor actualCursor = actual.getCursor(); 19 | assertThat(actualCursor) // 20 | .overridingErrorMessage("Expected cursor <%s> but was <%s>.", cursor, actualCursor) // 21 | .isSameAs(cursor); 22 | return myself; 23 | } 24 | 25 | public S hasFilter(Filter filter) { 26 | isNotNull(); 27 | Filter actualFilter = actual.getFilter(); 28 | assertThat(actualFilter) // 29 | .overridingErrorMessage("Expected filter <%s> but was <%s>.", filter, actualFilter) // 30 | .isSameAs(filter); 31 | return myself; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbstractListAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.ListAdapter; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public abstract class AbstractListAdapterAssert, A extends ListAdapter> 9 | extends AbstractAdapterAssert { 10 | protected AbstractListAdapterAssert(A actual, Class selfType) { 11 | super(actual, selfType); 12 | } 13 | 14 | public S hasAllItemsEnabled() { 15 | isNotNull(); 16 | assertThat(actual.areAllItemsEnabled()) // 17 | .overridingErrorMessage("Expected all items to be enabled but was all were not.") // 18 | .isTrue(); 19 | return myself; 20 | } 21 | 22 | public S hasAllItemsNotEnabled() { 23 | isNotNull(); 24 | assertThat(actual.areAllItemsEnabled()) // 25 | .overridingErrorMessage("Expected all items to not be enabled but all were.") // 26 | .isFalse(); 27 | return myself; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbstractRelativeLayoutAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.annotation.TargetApi; 4 | import android.widget.RelativeLayout; 5 | import org.assertj.android.api.view.AbstractViewGroupAssert; 6 | 7 | import static android.os.Build.VERSION_CODES.JELLY_BEAN; 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | public abstract class AbstractRelativeLayoutAssert, A extends RelativeLayout> 11 | extends AbstractViewGroupAssert { 12 | protected AbstractRelativeLayoutAssert(A actual, Class selfType) { 13 | super(actual, selfType); 14 | } 15 | 16 | @TargetApi(JELLY_BEAN) 17 | public S hasGravity(int gravity) { 18 | isNotNull(); 19 | int actualGravity = actual.getGravity(); 20 | assertThat(actualGravity) // 21 | .overridingErrorMessage("Expected gravity <%s> but was <%s>.", gravity, actualGravity) // 22 | .isEqualTo(gravity); 23 | return myself; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AbstractWrapperListAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.ListAdapter; 5 | import android.widget.WrapperListAdapter; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | public abstract class AbstractWrapperListAdapterAssert, A extends WrapperListAdapter> 10 | extends AbstractListAdapterAssert { 11 | protected AbstractWrapperListAdapterAssert(A actual, Class selfType) { 12 | super(actual, selfType); 13 | } 14 | 15 | public S hasWrappedAdapter(ListAdapter adapter) { 16 | isNotNull(); 17 | ListAdapter actualAdapter = actual.getWrappedAdapter(); 18 | assertThat(actualAdapter) // 19 | .overridingErrorMessage("Expected wrapped adapter <%s> but was <%s>.", adapter, 20 | actualAdapter) // 21 | .isSameAs(adapter); 22 | return myself; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.Adapter; 5 | 6 | /** 7 | * Assertions for {@link Adapter} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractAdapterAssert}. 10 | */ 11 | public final class AdapterAssert extends AbstractAdapterAssert { 12 | public AdapterAssert(Adapter actual) { 13 | super(actual, AdapterAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/AdapterViewAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.widget.AdapterView; 4 | 5 | /** 6 | * Assertions for {@link AdapterView} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractAdapterViewAssert}. 9 | */ 10 | public final class AdapterViewAssert 11 | extends AbstractAdapterViewAssert { 12 | public AdapterViewAssert(AdapterView actual) { 13 | super(actual, AdapterViewAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/ArrayAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.content.Context; 5 | import android.widget.ArrayAdapter; 6 | import android.widget.Filter; 7 | 8 | import static org.assertj.core.api.Assertions.assertThat; 9 | 10 | /** Assertions for {@link ArrayAdapter} instances. */ 11 | public class ArrayAdapterAssert 12 | extends AbstractListAdapterAssert { 13 | public ArrayAdapterAssert(ArrayAdapter actual) { 14 | super(actual, ArrayAdapterAssert.class); 15 | } 16 | 17 | public ArrayAdapterAssert hasContext(Context context) { 18 | isNotNull(); 19 | Context actualContext = actual.getContext(); 20 | assertThat(actualContext) // 21 | .overridingErrorMessage("Expected context <%s> but was <%s>.", context, actualContext) // 22 | .isSameAs(context); 23 | return this; 24 | } 25 | 26 | public ArrayAdapterAssert hasFilter(Filter filter) { 27 | isNotNull(); 28 | Filter actualFilter = actual.getFilter(); 29 | assertThat(actualFilter) // 30 | .overridingErrorMessage("Expected filter <%s> but was <%s>.", filter, actualFilter) // 31 | .isSameAs(filter); 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/ChronometerAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.Chronometer; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public class ChronometerAssert extends AbstractTextViewAssert { 9 | public ChronometerAssert(Chronometer actual) { 10 | super(actual, ChronometerAssert.class); 11 | } 12 | 13 | public ChronometerAssert hasBase(long base) { 14 | isNotNull(); 15 | long actualBase = actual.getBase(); 16 | assertThat(actualBase) // 17 | .overridingErrorMessage("Expected base time <%s> but was <%s>.", base, actualBase) // 18 | .isEqualTo(base); 19 | return this; 20 | } 21 | 22 | public ChronometerAssert hasFormat(String format) { 23 | isNotNull(); 24 | String actualFormat = actual.getFormat(); 25 | assertThat(actualFormat) // 26 | .overridingErrorMessage("Expected format <%s> but was <%s>.", format, actualFormat) // 27 | .isEqualTo(format); 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/CompoundButtonAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.CompoundButton; 5 | 6 | /** 7 | * Assertions for {@link CompoundButton} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractCompoundButtonAssert}. 10 | */ 11 | public final class CompoundButtonAssert 12 | extends AbstractCompoundButtonAssert { 13 | public CompoundButtonAssert(CompoundButton actual) { 14 | super(actual, CompoundButtonAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/CursorAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.CursorAdapter; 5 | 6 | /** 7 | * Assertions for {@link CursorAdapter} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractCursorAdapterAssert}. 10 | */ 11 | public final class CursorAdapterAssert 12 | extends AbstractCursorAdapterAssert { 13 | public CursorAdapterAssert(CursorAdapter actual) { 14 | super(actual, CursorAdapterAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/FrameLayoutAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.widget.FrameLayout; 4 | 5 | /** 6 | * Assertions for {@link FrameLayout} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractFrameLayoutAssert}. 9 | */ 10 | public class FrameLayoutAssert extends AbstractFrameLayoutAssert { 11 | public FrameLayoutAssert(FrameLayout actual) { 12 | super(actual, FrameLayoutAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/GridLayoutAlignmentMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.widget.GridLayout; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GridLayout.ALIGN_BOUNDS, 11 | GridLayout.ALIGN_MARGINS 12 | }) 13 | @Retention(SOURCE) 14 | @interface GridLayoutAlignmentMode { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/GridLayoutOrientation.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.widget.GridLayout; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GridLayout.HORIZONTAL, 11 | GridLayout.VERTICAL 12 | }) 13 | @Retention(SOURCE) 14 | @interface GridLayoutOrientation { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/GridViewStretchMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.widget.GridView; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | GridView.NO_STRETCH, 11 | GridView.STRETCH_SPACING, 12 | GridView.STRETCH_SPACING_UNIFORM, 13 | GridView.STRETCH_COLUMN_WIDTH 14 | }) 15 | @Retention(SOURCE) 16 | @interface GridViewStretchMode { 17 | } 18 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/HorizontalScrollViewAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.HorizontalScrollView; 5 | 6 | /** 7 | * Assertions for {@link HorizontalScrollView} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractHorizontalScrollViewAssert}. 10 | */ 11 | public final class HorizontalScrollViewAssert 12 | extends AbstractHorizontalScrollViewAssert { 13 | public HorizontalScrollViewAssert(HorizontalScrollView actual) { 14 | super(actual, HorizontalScrollViewAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/LinearLayoutAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.widget.LinearLayout; 4 | 5 | /** 6 | * Assertions for {@link LinearLayout} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractLinearLayoutAssert}. 9 | */ 10 | public final class LinearLayoutAssert extends AbstractLinearLayoutAssert { 11 | public LinearLayoutAssert(LinearLayout actual) { 12 | super(actual, LinearLayoutAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/LinearLayoutOrientation.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.widget.LinearLayout; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | LinearLayout.HORIZONTAL, 11 | LinearLayout.VERTICAL 12 | }) 13 | @Retention(SOURCE) 14 | public @interface LinearLayoutOrientation { 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/LinearLayoutShowDividers.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.widget.LinearLayout; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef( 10 | flag = true, 11 | value = { 12 | LinearLayout.SHOW_DIVIDER_BEGINNING, 13 | LinearLayout.SHOW_DIVIDER_MIDDLE, 14 | LinearLayout.SHOW_DIVIDER_END 15 | } 16 | ) 17 | @Retention(SOURCE) 18 | public @interface LinearLayoutShowDividers { 19 | } 20 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/ListAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.ListAdapter; 5 | 6 | /** 7 | * Assertions for {@link ListAdapter} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractListAdapterAssert}. 10 | */ 11 | public final class ListAdapterAssert 12 | extends AbstractListAdapterAssert { 13 | public ListAdapterAssert(ListAdapter actual) { 14 | super(actual, ListAdapterAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/ListPopupWindowInputMethodMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.widget.ListPopupWindow; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | ListPopupWindow.INPUT_METHOD_FROM_FOCUSABLE, 11 | ListPopupWindow.INPUT_METHOD_NEEDED, 12 | ListPopupWindow.INPUT_METHOD_NOT_NEEDED 13 | }) 14 | @Retention(SOURCE) 15 | @interface ListPopupWindowInputMethodMode { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/ListViewAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.ListView; 5 | 6 | /** 7 | * Assertions for {@link ListView} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractListViewAssert}. 10 | */ 11 | public final class ListViewAssert extends AbstractListViewAssert { 12 | public ListViewAssert(ListView actual) { 13 | super(actual, ListViewAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/MediaControllerAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.MediaController; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link MediaController} instances. */ 9 | public class MediaControllerAssert 10 | extends AbstractFrameLayoutAssert { 11 | public MediaControllerAssert(MediaController actual) { 12 | super(actual, MediaControllerAssert.class); 13 | } 14 | 15 | public MediaControllerAssert isShowing() { 16 | isNotNull(); 17 | assertThat(actual.isShowing()) // 18 | .overridingErrorMessage("Expected to be showing but was not.") // 19 | .isTrue(); 20 | return this; 21 | } 22 | 23 | public MediaControllerAssert isNotShowing() { 24 | isNotNull(); 25 | assertThat(actual.isShowing()) // 26 | .overridingErrorMessage("Expected to not be showing but was.") // 27 | .isFalse(); 28 | return this; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/PopupWindowInputMethodMode.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.widget.PopupWindow; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | PopupWindow.INPUT_METHOD_FROM_FOCUSABLE, 11 | PopupWindow.INPUT_METHOD_NEEDED, 12 | PopupWindow.INPUT_METHOD_NOT_NEEDED 13 | }) 14 | @Retention(SOURCE) 15 | @interface PopupWindowInputMethodMode { 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/ProgressBarAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.ProgressBar; 5 | 6 | /** 7 | * Assertions for {@link ProgressBar} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractProgressBarAssert}. 10 | */ 11 | public final class ProgressBarAssert 12 | extends AbstractProgressBarAssert { 13 | public ProgressBarAssert(ProgressBar actual) { 14 | super(actual, ProgressBarAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/RadioGroupAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.RadioGroup; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link RadioGroup} instances. */ 9 | public class RadioGroupAssert extends AbstractLinearLayoutAssert { 10 | public RadioGroupAssert(RadioGroup actual) { 11 | super(actual, RadioGroupAssert.class); 12 | } 13 | 14 | public RadioGroupAssert hasCheckedRadioButtonId(int id) { 15 | isNotNull(); 16 | int actualId = actual.getCheckedRadioButtonId(); 17 | assertThat(actualId) // 18 | .overridingErrorMessage("Expected checked radio button ID <%s> but was <%s>.", id, 19 | actualId) // 20 | .isEqualTo(id); 21 | return this; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/RelativeLayoutAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.widget.RelativeLayout; 4 | 5 | /** 6 | * Assertions for {@link RelativeLayout} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractRelativeLayoutAssert}. 9 | */ 10 | public final class RelativeLayoutAssert 11 | extends AbstractRelativeLayoutAssert { 12 | public RelativeLayoutAssert(RelativeLayout actual) { 13 | super(actual, RelativeLayoutAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/SimpleAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.Filter; 5 | import android.widget.SimpleAdapter; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link SimpleAdapter} instances. */ 10 | public class SimpleAdapterAssert 11 | extends AbstractListAdapterAssert { 12 | public SimpleAdapterAssert(SimpleAdapter actual) { 13 | super(actual, SimpleAdapterAssert.class); 14 | } 15 | 16 | public SimpleAdapterAssert hasFilter(Filter filter) { 17 | isNotNull(); 18 | Filter actualFilter = actual.getFilter(); 19 | assertThat(actualFilter) // 20 | .overridingErrorMessage("Expected filter <%s> but was <%s>.", filter, actualFilter) // 21 | .isSameAs(filter); 22 | return this; 23 | } 24 | 25 | public SimpleAdapterAssert hasViewBinder(SimpleAdapter.ViewBinder binder) { 26 | isNotNull(); 27 | SimpleAdapter.ViewBinder actualBinder = actual.getViewBinder(); 28 | assertThat(actualBinder) // 29 | .overridingErrorMessage("Expected view binder <%s> but was <%s>.", binder, actualBinder) // 30 | .isSameAs(binder); 31 | return this; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/TableRowAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.TableRow; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | /** Assertions for {@link TableRow} instances. */ 9 | public class TableRowAssert extends AbstractLinearLayoutAssert { 10 | public TableRowAssert(TableRow actual) { 11 | super(actual, TableRowAssert.class); 12 | } 13 | 14 | public TableRowAssert hasVirtualChildCount(int count) { 15 | isNotNull(); 16 | int actualCount = actual.getVirtualChildCount(); 17 | assertThat(actualCount) // 18 | .overridingErrorMessage("Expected virtual child count <%s> but was <%s>.", count, 19 | actualCount) // 20 | .isEqualTo(count); 21 | return this; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/TextViewAssert.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.widget.TextView; 4 | 5 | /** 6 | * Assertions for {@link TextView} instances. 7 | *

8 | * This class is final. To extend use {@link AbstractTextViewAssert}. 9 | */ 10 | public final class TextViewAssert extends AbstractTextViewAssert { 11 | public TextViewAssert(TextView actual) { 12 | super(actual, TextViewAssert.class); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/TextViewGravity.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.Gravity; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | Gravity.NO_GRAVITY, 11 | Gravity.TOP, 12 | Gravity.BOTTOM, 13 | Gravity.LEFT, 14 | Gravity.RIGHT, 15 | Gravity.CENTER_VERTICAL, 16 | Gravity.FILL_VERTICAL, 17 | Gravity.CENTER_HORIZONTAL, 18 | Gravity.FILL_HORIZONTAL, 19 | Gravity.CENTER, 20 | Gravity.FILL, 21 | Gravity.CLIP_VERTICAL, 22 | Gravity.CLIP_HORIZONTAL, 23 | Gravity.START, 24 | Gravity.END 25 | }) 26 | @Retention(SOURCE) 27 | @interface TextViewGravity { 28 | } 29 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/TextViewImeOptions.java: -------------------------------------------------------------------------------- 1 | package org.assertj.android.api.widget; 2 | 3 | import android.support.annotation.IntDef; 4 | import android.view.inputmethod.EditorInfo; 5 | import java.lang.annotation.Retention; 6 | 7 | import static java.lang.annotation.RetentionPolicy.SOURCE; 8 | 9 | @IntDef({ 10 | EditorInfo.IME_ACTION_UNSPECIFIED, 11 | EditorInfo.IME_ACTION_NONE, 12 | EditorInfo.IME_ACTION_GO, 13 | EditorInfo.IME_ACTION_SEARCH, 14 | EditorInfo.IME_ACTION_SEND, 15 | EditorInfo.IME_ACTION_NEXT, 16 | EditorInfo.IME_ACTION_DONE, 17 | EditorInfo.IME_ACTION_PREVIOUS, 18 | EditorInfo.IME_FLAG_NO_FULLSCREEN, 19 | EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS, 20 | EditorInfo.IME_FLAG_NAVIGATE_NEXT, 21 | EditorInfo.IME_FLAG_NO_EXTRACT_UI, 22 | EditorInfo.IME_FLAG_NO_ACCESSORY_ACTION, 23 | EditorInfo.IME_FLAG_NO_ENTER_ACTION, 24 | EditorInfo.IME_FLAG_FORCE_ASCII, 25 | EditorInfo.IME_NULL 26 | }) 27 | @Retention(SOURCE) 28 | @interface TextViewImeOptions { 29 | } 30 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/ViewAnimatorAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.ViewAnimator; 5 | 6 | /** 7 | * Assertions for {@link ViewAnimator} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractViewAnimatorAssert}. 10 | */ 11 | public final class ViewAnimatorAssert extends AbstractViewAnimatorAssert { 12 | public ViewAnimatorAssert(ViewAnimator actual) { 13 | super(actual, ViewAnimatorAssert.class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/ViewSwitcherAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.view.View; 5 | import android.widget.ViewSwitcher; 6 | 7 | import static org.assertj.core.api.Assertions.assertThat; 8 | 9 | /** Assertions for {@link ViewSwitcher} instances. */ 10 | public class ViewSwitcherAssert 11 | extends AbstractViewAnimatorAssert { 12 | public ViewSwitcherAssert(ViewSwitcher actual) { 13 | super(actual, ViewSwitcherAssert.class); 14 | } 15 | 16 | public ViewSwitcherAssert hasNextView(View view) { 17 | isNotNull(); 18 | View actualView = actual.getNextView(); 19 | assertThat(actualView) // 20 | .overridingErrorMessage("Expected next view <%s> but was <%s>.", view, actualView) // 21 | .isSameAs(view); 22 | return this; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /assertj-android/src/main/java/org/assertj/android/api/widget/WrapperListAdapterAssert.java: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Square, Inc. 2 | package org.assertj.android.api.widget; 3 | 4 | import android.widget.WrapperListAdapter; 5 | 6 | /** 7 | * Assertions for {@link WrapperListAdapter} instances. 8 | *

9 | * This class is final. To extend use {@link AbstractWrapperListAdapterAssert}. 10 | */ 11 | public final class WrapperListAdapterAssert 12 | extends AbstractWrapperListAdapterAssert { 13 | public WrapperListAdapterAssert(WrapperListAdapter actual) { 14 | super(actual, WrapperListAdapterAssert.class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /check-missing-assertions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | MISSING=0 4 | 5 | for project in $(\find . -type d -name 'assertj-android*' -maxdepth 1 | \sed 's|./||g'); do 6 | echo "Checking ${project}..." 7 | ASSERTIONS=$(\find ${project} -name 'Assertions.java') 8 | CLASSES=$(\find ${project} -type f -name '*Assert.java' | \cut -d'/' -f 5- | \grep -v '/Abstract' | \sed 's|.java||' | \sed 's|/|.|g') 9 | for class in ${CLASSES}; do 10 | \grep "$class" ${ASSERTIONS} > /dev/null 11 | if [ $? -ne 0 ]; then 12 | echo "MISSING: $class" 13 | MISSING=1 14 | fi 15 | done 16 | done 17 | 18 | if [ ${MISSING} -ne 0 ]; then 19 | echo "Failed :(" 20 | exit 1 21 | fi 22 | echo "Success!" 23 | -------------------------------------------------------------------------------- /deploy_website.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | REPO="git@github.com:square/assertj-android.git" 6 | GROUP_ID="com.squareup.assertj" 7 | ARTIFACT_ID="assertj-android" 8 | 9 | DIR=temp-clone 10 | 11 | # Delete any existing temporary website clone 12 | rm -rf $DIR 13 | 14 | # Clone the current repo into temp folder 15 | git clone $REPO $DIR 16 | 17 | # Move working directory into temp folder 18 | cd $DIR 19 | 20 | # Checkout and track the gh-pages branch 21 | git checkout -t origin/gh-pages 22 | 23 | # Delete everything 24 | rm -rf * 25 | 26 | # Copy website files from real repo 27 | cp -R ../website/* . 28 | 29 | # Download the latest javadoc 30 | #curl -L "http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=$GROUP_ID&a=$ARTIFACT_ID&v=LATEST&c=javadoc" > javadoc.zip 31 | #mkdir javadoc 32 | #unzip javadoc.zip -d javadoc 33 | #rm javadoc.zip 34 | # TODO get all javadocs? 35 | 36 | # Stage all files in git and create a commit 37 | git add . 38 | git add -u 39 | git commit -m "Website at $(date)" 40 | 41 | # Push the new files up to GitHub 42 | git push origin gh-pages 43 | 44 | # Delete our temp folder 45 | cd .. 46 | rm -rf $DIR 47 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | GROUP=com.squareup.assertj 2 | VERSION_NAME=1.2.1-SNAPSHOT 3 | 4 | POM_DESCRIPTION=A set of AssertJ assertion helpers geared toward testing Android. 5 | 6 | POM_URL=http://github.com/square/assertj-android/ 7 | POM_SCM_URL=http://github.com/square/assertj-android/ 8 | POM_SCM_CONNECTION=scm:git:git://github.com/square/assertj-android.git 9 | POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/square/assertj-android.git 10 | 11 | POM_LICENCE_NAME=The Apache Software License, Version 2.0 12 | POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt 13 | POM_LICENCE_DIST=repo 14 | 15 | POM_DEVELOPER_ID=square 16 | POM_DEVELOPER_NAME=Square, Inc. 17 | -------------------------------------------------------------------------------- /gradle/checkstyle.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'checkstyle' 2 | 3 | checkstyle { 4 | configFile rootProject.file('checkstyle.xml') 5 | showViolations true 6 | } 7 | 8 | android.libraryVariants.all { variant -> 9 | def name = variant.buildType.name 10 | 11 | def checkstyle = project.tasks.create "checkstyle${name.capitalize()}", Checkstyle 12 | checkstyle.dependsOn variant.javaCompile 13 | checkstyle.source variant.javaCompile.source 14 | checkstyle.classpath = project.fileTree(variant.javaCompile.destinationDir) 15 | checkstyle.exclude('**/BuildConfig.java') 16 | checkstyle.exclude('**/R.java') 17 | project.tasks.getByName("check").dependsOn checkstyle 18 | } 19 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/square/assertj-android/7d4da5c468bce780e43c243853d5b8f1e7b93135/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'assertj-android-root' 2 | 3 | include ':assertj-android' 4 | include ':assertj-android-appcompat-v7' 5 | include ':assertj-android-cardview-v7' 6 | include ':assertj-android-design' 7 | include ':assertj-android-gridlayout-v7' 8 | include ':assertj-android-mediarouter-v7' 9 | include ':assertj-android-palette-v7' 10 | include ':assertj-android-play-services' 11 | include ':assertj-android-recyclerview-v7' 12 | include ':assertj-android-support-v4' 13 | -------------------------------------------------------------------------------- /website/static/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #195F91; } 6 | .kwd, .linenums, .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | -------------------------------------------------------------------------------- /website/static/ribbon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/square/assertj-android/7d4da5c468bce780e43c243853d5b8f1e7b93135/website/static/ribbon.png -------------------------------------------------------------------------------- /website/static/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/square/assertj-android/7d4da5c468bce780e43c243853d5b8f1e7b93135/website/static/square.png -------------------------------------------------------------------------------- /website/static/waves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/square/assertj-android/7d4da5c468bce780e43c243853d5b8f1e7b93135/website/static/waves.png --------------------------------------------------------------------------------