@situm/cordova 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/CHANGELOG_UNRELEASED.md +28 -0
- package/Jenkinsfile +84 -0
- package/LICENSE +21 -0
- package/README.md +472 -0
- package/azure/common-steps.yaml +5 -0
- package/azure-pipelines.yml +336 -0
- package/docs/JSDoc/MapView.html +300 -0
- package/docs/JSDoc/MapViewControllerImpl.html +299 -0
- package/docs/JSDoc/Situm.html +5257 -0
- package/docs/JSDoc/android_Interfaces.js.html +825 -0
- package/docs/JSDoc/android_situm.js.html +380 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.eot +0 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.svg +288 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.woff +0 -0
- package/docs/JSDoc/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/docs/JSDoc/global.html +7538 -0
- package/docs/JSDoc/img/toast-ui.png +0 -0
- package/docs/JSDoc/index.html +90 -0
- package/docs/JSDoc/map-view-controller.js.html +307 -0
- package/docs/JSDoc/map-view.js.html +172 -0
- package/docs/JSDoc/scripts/jquery.min.js +2 -0
- package/docs/JSDoc/scripts/linenumber.js +30 -0
- package/docs/JSDoc/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/JSDoc/scripts/prettify/lang-css.js +2 -0
- package/docs/JSDoc/scripts/prettify/prettify.js +28 -0
- package/docs/JSDoc/scripts/tui-doc.js +200 -0
- package/docs/JSDoc/styles/bootstrap.min.css +6 -0
- package/docs/JSDoc/styles/custom.css +23 -0
- package/docs/JSDoc/styles/prettify-jsdoc.css +111 -0
- package/docs/JSDoc/styles/prettify-tomorrow.css +132 -0
- package/docs/JSDoc/styles/tui-doc.css +485 -0
- package/docs/conf.json +28 -0
- package/docs/getting-started.md +298 -0
- package/docs/imagotype-SITUM-transparent-90.png +0 -0
- package/docs/static/styles/custom.css +23 -0
- package/package.json +60 -0
- package/plugin.xml +102 -0
- package/scripts/update_changelog.sh +22 -0
- package/src/android/app/build.gradle +51 -0
- package/src/android/app/proguard-rules.pro +21 -0
- package/src/android/app/src/main/AndroidManifest.xml +11 -0
- package/src/android/app/src/main/java/es/situm/plugin/DateUtils.java +15 -0
- package/src/android/app/src/main/java/es/situm/plugin/PluginHelper.java +919 -0
- package/src/android/app/src/main/java/es/situm/plugin/SitumMapper.java +968 -0
- package/src/android/app/src/main/java/es/situm/plugin/SitumPlugin.java +109 -0
- package/src/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/src/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
- package/src/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/src/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/src/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/src/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/src/android/app/src/main/res/values/colors.xml +6 -0
- package/src/android/app/src/main/res/values/strings.xml +3 -0
- package/src/android/app/src/main/res/values/styles.xml +11 -0
- package/src/android/app/src/test/java/es/situm/plugin/PluginHelperTest.java +27 -0
- package/src/android/app/src/test/java/es/situm/plugin/SitumMapperTest.java +1485 -0
- package/src/android/app/src/test/java/es/situm/plugin/angle/AngleCreator.java +46 -0
- package/src/android/app/src/test/java/es/situm/plugin/bounds/BoundsCreator.java +50 -0
- package/src/android/app/src/test/java/es/situm/plugin/building/BuildingCreator.java +76 -0
- package/src/android/app/src/test/java/es/situm/plugin/cartesianCoordinate/CartesianCoordinateCreator.java +31 -0
- package/src/android/app/src/test/java/es/situm/plugin/circle/CircleCreator.java +41 -0
- package/src/android/app/src/test/java/es/situm/plugin/coordinate/CoordinateCreator.java +32 -0
- package/src/android/app/src/test/java/es/situm/plugin/dimensions/DimensionsCreator.java +31 -0
- package/src/android/app/src/test/java/es/situm/plugin/directionsRequest/DirectionsRequestCreator.java +105 -0
- package/src/android/app/src/test/java/es/situm/plugin/event/EventCreator.java +108 -0
- package/src/android/app/src/test/java/es/situm/plugin/floor/FloorCreator.java +58 -0
- package/src/android/app/src/test/java/es/situm/plugin/indication/IndicationCreator.java +40 -0
- package/src/android/app/src/test/java/es/situm/plugin/location/LocationCreator.java +197 -0
- package/src/android/app/src/test/java/es/situm/plugin/locationRequest/LocationRequestCreator.java +45 -0
- package/src/android/app/src/test/java/es/situm/plugin/locationStatus/LocationStatusCreator.java +211 -0
- package/src/android/app/src/test/java/es/situm/plugin/navigationProgress/NavigationProgressCreator.java +154 -0
- package/src/android/app/src/test/java/es/situm/plugin/poi/PoiCreator.java +126 -0
- package/src/android/app/src/test/java/es/situm/plugin/poiCategory/PoiCategoryCreator.java +38 -0
- package/src/android/app/src/test/java/es/situm/plugin/point/PointCreator.java +200 -0
- package/src/android/app/src/test/java/es/situm/plugin/route/RouteCreator.java +142 -0
- package/src/android/app/src/test/java/es/situm/plugin/routeStep/RouteStepCreator.java +173 -0
- package/src/android/app/src/test/java/es/situm/plugin/situmConversionArea/SitumConversionAreaCreator.java +35 -0
- package/src/android/build.gradle +31 -0
- package/src/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/src/android/gradle.properties +16 -0
- package/src/android/gradlew +172 -0
- package/src/android/gradlew.bat +84 -0
- package/src/android/settings.gradle +3 -0
- package/src/android/situm.gradle +19 -0
- package/src/ios/Classes/Private/CDVDebug.h +25 -0
- package/src/ios/Classes/Private/CDVJSON_private.h +31 -0
- package/src/ios/Classes/Private/CDVJSON_private.m +99 -0
- package/src/ios/Classes/Private/CDVPlugin+Private.h +24 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVGestureHandler/CDVGestureHandler.h +26 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVGestureHandler/CDVGestureHandler.m +70 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVHandleOpenURL/CDVHandleOpenURL.h +27 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVHandleOpenURL/CDVHandleOpenURL.m +86 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h +34 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m +153 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVLocalStorage/CDVLocalStorage.h +50 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVLocalStorage/CDVLocalStorage.m +487 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVLogger/CDVLogger.h +26 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVLogger/CDVLogger.m +37 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h +41 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m +399 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h +27 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m +202 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h +29 -0
- package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m +153 -0
- package/src/ios/Classes/Public/CDV.h +32 -0
- package/src/ios/Classes/Public/CDVAppDelegate.h +28 -0
- package/src/ios/Classes/Public/CDVAppDelegate.m +118 -0
- package/src/ios/Classes/Public/CDVAvailability.h +111 -0
- package/src/ios/Classes/Public/CDVAvailabilityDeprecated.h +26 -0
- package/src/ios/Classes/Public/CDVCommandDelegate.h +51 -0
- package/src/ios/Classes/Public/CDVCommandDelegateImpl.h +36 -0
- package/src/ios/Classes/Public/CDVCommandDelegateImpl.m +186 -0
- package/src/ios/Classes/Public/CDVCommandQueue.h +39 -0
- package/src/ios/Classes/Public/CDVCommandQueue.m +194 -0
- package/src/ios/Classes/Public/CDVConfigParser.h +30 -0
- package/src/ios/Classes/Public/CDVConfigParser.m +81 -0
- package/src/ios/Classes/Public/CDVInvokedUrlCommand.h +52 -0
- package/src/ios/Classes/Public/CDVInvokedUrlCommand.m +116 -0
- package/src/ios/Classes/Public/CDVPlugin+Resources.h +39 -0
- package/src/ios/Classes/Public/CDVPlugin+Resources.m +38 -0
- package/src/ios/Classes/Public/CDVPlugin.h +85 -0
- package/src/ios/Classes/Public/CDVPlugin.m +202 -0
- package/src/ios/Classes/Public/CDVPluginResult.h +66 -0
- package/src/ios/Classes/Public/CDVPluginResult.m +186 -0
- package/src/ios/Classes/Public/CDVScreenOrientationDelegate.h +33 -0
- package/src/ios/Classes/Public/CDVTimer.h +27 -0
- package/src/ios/Classes/Public/CDVTimer.m +123 -0
- package/src/ios/Classes/Public/CDVURLProtocol.h +27 -0
- package/src/ios/Classes/Public/CDVURLProtocol.m +113 -0
- package/src/ios/Classes/Public/CDVUserAgentUtil.h +27 -0
- package/src/ios/Classes/Public/CDVUserAgentUtil.m +124 -0
- package/src/ios/Classes/Public/CDVViewController.h +92 -0
- package/src/ios/Classes/Public/CDVViewController.m +821 -0
- package/src/ios/Classes/Public/CDVWebViewEngineProtocol.h +42 -0
- package/src/ios/Classes/Public/CDVWhitelist.h +34 -0
- package/src/ios/Classes/Public/CDVWhitelist.m +285 -0
- package/src/ios/Classes/Public/NSDictionary+CordovaPreferences.h +35 -0
- package/src/ios/Classes/Public/NSDictionary+CordovaPreferences.m +63 -0
- package/src/ios/Classes/Public/NSMutableArray+QueueAdditions.h +29 -0
- package/src/ios/Classes/Public/NSMutableArray+QueueAdditions.m +58 -0
- package/src/ios/Cordova/Cordova.h +51 -0
- package/src/ios/Cordova/Info.plist +24 -0
- package/src/ios/Podfile +5 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/project.pbxproj +1324 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/src/ios/SitumCordovaPlugin.xcodeproj/xcshareddata/xcschemes/CordovaLib.xcscheme +100 -0
- package/src/ios/SitumCordovaPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/src/ios/SitumCordovaPlugin_Prefix.pch +22 -0
- package/src/ios/VERSION +1 -0
- package/src/ios/cordova.js +2432 -0
- package/src/ios/situmcordovaplugin/AppDelegate.h +22 -0
- package/src/ios/situmcordovaplugin/AppDelegate.m +98 -0
- package/src/ios/situmcordovaplugin/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
- package/src/ios/situmcordovaplugin/Base.lproj/LaunchScreen.storyboard +25 -0
- package/src/ios/situmcordovaplugin/Base.lproj/Main.storyboard +24 -0
- package/src/ios/situmcordovaplugin/Constants.h +14 -0
- package/src/ios/situmcordovaplugin/Constants.m +14 -0
- package/src/ios/situmcordovaplugin/Info.plist +45 -0
- package/src/ios/situmcordovaplugin/SITUtils.h +7 -0
- package/src/ios/situmcordovaplugin/SITUtils.m +13 -0
- package/src/ios/situmcordovaplugin/SitumLocationWrapper.h +109 -0
- package/src/ios/situmcordovaplugin/SitumLocationWrapper.m +983 -0
- package/src/ios/situmcordovaplugin/SitumPlugin.h +41 -0
- package/src/ios/situmcordovaplugin/SitumPlugin.m +752 -0
- package/src/ios/situmcordovaplugin/ViewController.h +15 -0
- package/src/ios/situmcordovaplugin/ViewController.m +29 -0
- package/src/ios/situmcordovaplugin/main.m +16 -0
- package/src/ios/situmcordovaplugin/situmcordovaplugin.xcdatamodeld/.xccurrentversion +8 -0
- package/src/ios/situmcordovaplugin/situmcordovaplugin.xcdatamodeld/situmcordovaplugin.xcdatamodel/contents +4 -0
- package/src/ios/situmcordovaplugintests/AngleTests.m +53 -0
- package/src/ios/situmcordovaplugintests/BoundTests.m +51 -0
- package/src/ios/situmcordovaplugintests/BuildingTests.m +41 -0
- package/src/ios/situmcordovaplugintests/CartesianCoordinateTests.m +42 -0
- package/src/ios/situmcordovaplugintests/ConversionAreaTests.m +43 -0
- package/src/ios/situmcordovaplugintests/CoordinateTests.m +42 -0
- package/src/ios/situmcordovaplugintests/DimensionTests.m +43 -0
- package/src/ios/situmcordovaplugintests/EventTests.m +42 -0
- package/src/ios/situmcordovaplugintests/FloorTests.m +52 -0
- package/src/ios/situmcordovaplugintests/Info.plist +38 -0
- package/src/ios/situmcordovaplugintests/InputTests/DirectionsRequestTest.m +108 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputCartesianCoordinateTests.m +45 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputCoordinateTests.m +45 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputFloorTests.m +59 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputIndicationTests.m +45 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputLocationTests.m +163 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputPoiCategoryTests.m +46 -0
- package/src/ios/situmcordovaplugintests/InputTests/InputPointTests.m +137 -0
- package/src/ios/situmcordovaplugintests/InputTests/LocationRequestTest.m +79 -0
- package/src/ios/situmcordovaplugintests/LocationStatusTests.m +60 -0
- package/src/ios/situmcordovaplugintests/LocationTests.m +114 -0
- package/src/ios/situmcordovaplugintests/NavigationProgressTests.m +50 -0
- package/src/ios/situmcordovaplugintests/PoiCategoryIconTests.m +43 -0
- package/src/ios/situmcordovaplugintests/PoiCategoryTests.m +42 -0
- package/src/ios/situmcordovaplugintests/PoiTests.m +83 -0
- package/src/ios/situmcordovaplugintests/PointTests.m +107 -0
- package/src/ios/situmcordovaplugintests/RouteStepTests.m +78 -0
- package/src/ios/situmcordovaplugintests/RouteTests.m +42 -0
- package/src/ios/situmcordovaplugintests/SitumCreatorTests.h +91 -0
- package/src/ios/situmcordovaplugintests/SitumCreatorTests.m +928 -0
- package/src/ios/situmcordovaplugintests/TestingHelper.h +48 -0
- package/src/ios/situmcordovaplugintests/TestingHelper.m +342 -0
- package/src/ios/situmcordovaplugintests/indicationTests.m +43 -0
- package/tests/common-resources/angle/angle1.json +6 -0
- package/tests/common-resources/angle/angle2.json +6 -0
- package/tests/common-resources/bounds/bounds1.json +18 -0
- package/tests/common-resources/bounds/bounds2.json +18 -0
- package/tests/common-resources/building/building1.json +64 -0
- package/tests/common-resources/cartesianCoordinate/cartesianCoordinate1.json +4 -0
- package/tests/common-resources/circle/circle1.json +17 -0
- package/tests/common-resources/coordinate/coordinate1.json +4 -0
- package/tests/common-resources/dimensions/dimensions1.json +4 -0
- package/tests/common-resources/directionsRequest/directionsRequest1.json +166 -0
- package/tests/common-resources/directionsRequest/directionsRequest2.json +167 -0
- package/tests/common-resources/directionsRequest/directionsRequest3.json +166 -0
- package/tests/common-resources/directionsRequest/directionsRequest4.json +166 -0
- package/tests/common-resources/directionsRequest/directionsRequest5.json +167 -0
- package/tests/common-resources/directionsRequest/directionsRequest6.json +153 -0
- package/tests/common-resources/events/event1.json +66 -0
- package/tests/common-resources/floor/floor1.json +13 -0
- package/tests/common-resources/floor/floor2.json +13 -0
- package/tests/common-resources/indication/indication1.json +10 -0
- package/tests/common-resources/location/location1.json +48 -0
- package/tests/common-resources/location/location10.json +48 -0
- package/tests/common-resources/location/location2.json +48 -0
- package/tests/common-resources/location/location3.json +48 -0
- package/tests/common-resources/location/location4.json +48 -0
- package/tests/common-resources/location/location5.json +48 -0
- package/tests/common-resources/location/location6.json +48 -0
- package/tests/common-resources/location/location7.json +48 -0
- package/tests/common-resources/location/location8.json +48 -0
- package/tests/common-resources/location/location9.json +48 -0
- package/tests/common-resources/locationRequest/locationRequest1.json +6 -0
- package/tests/common-resources/locationRequest/locationRequest2.json +32 -0
- package/tests/common-resources/locationRequest/locationRequest3.json +33 -0
- package/tests/common-resources/locationRequest/locationRequest4.json +31 -0
- package/tests/common-resources/locationStatus/locationStatus1.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus10.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus11.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus12.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus13.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus2.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus3.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus4.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus5.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus6.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus7.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus8.json +4 -0
- package/tests/common-resources/locationStatus/locationStatus9.json +4 -0
- package/tests/common-resources/navigationProgress/navigationProgress1.json +77 -0
- package/tests/common-resources/navigationProgress/navigationProgress2.json +77 -0
- package/tests/common-resources/poi/poi1.json +35 -0
- package/tests/common-resources/poi/poi2.json +35 -0
- package/tests/common-resources/poi/poi3.json +35 -0
- package/tests/common-resources/poi/poi4.json +38 -0
- package/tests/common-resources/poi/poi5.json +35 -0
- package/tests/common-resources/poiCategory/poiCategory1.json +7 -0
- package/tests/common-resources/poiCategoryIcon/poiCategoryIcon1.json +1 -0
- package/tests/common-resources/poiCategoryIcon/poiCategoryIcon1.png +0 -0
- package/tests/common-resources/point/point1.json +14 -0
- package/tests/common-resources/point/point2.json +14 -0
- package/tests/common-resources/point/point3.json +14 -0
- package/tests/common-resources/point/point4.json +14 -0
- package/tests/common-resources/point/point5.json +14 -0
- package/tests/common-resources/point/point6.json +14 -0
- package/tests/common-resources/point/point7.json +14 -0
- package/tests/common-resources/point/point8.json +14 -0
- package/tests/common-resources/route/route1.json +530 -0
- package/tests/common-resources/routeStep/routeStep1.json +35 -0
- package/tests/common-resources/routeStep/routeStep2.json +35 -0
- package/tests/common-resources/routeStep/routeStep3.json +35 -0
- package/tests/common-resources/routeStep/routeStep4.json +35 -0
- package/tests/common-resources/routeStep/routeStep5.json +35 -0
- package/tests/common-resources/situmConversionArea/situmConversionArea1.json +19 -0
- package/tests/js/resources/fetchBuildings.json +176 -0
- package/tests/js/resources/fetchEventsFromBuilding.json +201 -0
- package/tests/js/resources/fetchFloorsFromBuilding.json +34 -0
- package/tests/js/resources/fetchIndoorPOIsFromBuilding.json +574 -0
- package/tests/js/resources/fetchMapFromFloor.json +3 -0
- package/tests/js/resources/fetchOutdoorPOIsFromBuilding.json +68 -0
- package/tests/js/resources/fetchPoiCategories.json +72 -0
- package/tests/js/resources/fetchPoiCategoryIconNormal.json +3 -0
- package/tests/js/resources/fetchPoiCategoryIconSelected.json +3 -0
- package/tests/js/resources/requestDirections.json +1167 -0
- package/tests/js/resources/startPositioning/0_starting.json +4 -0
- package/tests/js/resources/startPositioning/1_preparingPositioningModel.json +4 -0
- package/tests/js/resources/startPositioning/2_startingPositioning.json +4 -0
- package/tests/js/resources/startPositioning/3_calculating.json +4 -0
- package/tests/js/resources/startPositioning/4_position.json +48 -0
- package/tests/js/resources/startPositioning/5_position.json +48 -0
- package/tests/js/test.js +416 -0
- package/tests/scripts/clean_android_resources.sh +3 -0
- package/tests/scripts/clean_ios_resources.sh +3 -0
- package/tests/scripts/copy_android_resources.sh +3 -0
- package/tests/scripts/copy_ios_resources.sh +3 -0
- package/tests/scripts/self-destruct.sh +1 -0
- package/www/android/Interfaces.js +742 -0
- package/www/android/situm.js +296 -0
- package/www/ios/situm.js +99 -0
- package/www/map-view-controller.js +223 -0
- package/www/map-view.js +88 -0
|
@@ -0,0 +1,1485 @@
|
|
|
1
|
+
package es.situm.plugin;
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import com.google.common.truth.Truth;
|
|
5
|
+
|
|
6
|
+
import org.json.JSONArray;
|
|
7
|
+
import org.json.JSONException;
|
|
8
|
+
import org.json.JSONObject;
|
|
9
|
+
import org.junit.Assert;
|
|
10
|
+
import org.junit.Test;
|
|
11
|
+
import org.junit.runner.RunWith;
|
|
12
|
+
import org.junit.runners.JUnit4;
|
|
13
|
+
|
|
14
|
+
import java.text.DateFormat;
|
|
15
|
+
import java.text.ParsePosition;
|
|
16
|
+
|
|
17
|
+
import es.situm.plugin.angle.AngleCreator;
|
|
18
|
+
import es.situm.plugin.bounds.BoundsCreator;
|
|
19
|
+
import es.situm.plugin.building.BuildingCreator;
|
|
20
|
+
import es.situm.plugin.cartesianCoordinate.CartesianCoordinateCreator;
|
|
21
|
+
import es.situm.plugin.circle.CircleCreator;
|
|
22
|
+
import es.situm.plugin.coordinate.CoordinateCreator;
|
|
23
|
+
import es.situm.plugin.dimensions.DimensionsCreator;
|
|
24
|
+
import es.situm.plugin.directionsRequest.DirectionsRequestCreator;
|
|
25
|
+
import es.situm.plugin.event.EventCreator;
|
|
26
|
+
import es.situm.plugin.floor.FloorCreator;
|
|
27
|
+
import es.situm.plugin.indication.IndicationCreator;
|
|
28
|
+
import es.situm.plugin.location.LocationCreator;
|
|
29
|
+
import es.situm.plugin.locationRequest.LocationRequestCreator;
|
|
30
|
+
import es.situm.plugin.locationStatus.LocationStatusCreator;
|
|
31
|
+
import es.situm.plugin.navigationProgress.NavigationProgressCreator;
|
|
32
|
+
import es.situm.plugin.poi.PoiCreator;
|
|
33
|
+
import es.situm.plugin.poiCategory.PoiCategoryCreator;
|
|
34
|
+
import es.situm.plugin.point.PointCreator;
|
|
35
|
+
import es.situm.plugin.route.RouteCreator;
|
|
36
|
+
import es.situm.plugin.routeStep.RouteStepCreator;
|
|
37
|
+
import es.situm.plugin.situmConversionArea.SitumConversionAreaCreator;
|
|
38
|
+
import es.situm.sdk.directions.DirectionsRequest;
|
|
39
|
+
import es.situm.sdk.location.LocationRequest;
|
|
40
|
+
import es.situm.sdk.location.LocationStatus;
|
|
41
|
+
import es.situm.sdk.model.cartography.Building;
|
|
42
|
+
import es.situm.sdk.model.cartography.Circle;
|
|
43
|
+
import es.situm.sdk.model.cartography.Floor;
|
|
44
|
+
import es.situm.sdk.model.cartography.Poi;
|
|
45
|
+
import es.situm.sdk.model.cartography.PoiCategory;
|
|
46
|
+
import es.situm.sdk.model.cartography.Point;
|
|
47
|
+
import es.situm.sdk.model.directions.Indication;
|
|
48
|
+
import es.situm.sdk.model.directions.Route;
|
|
49
|
+
import es.situm.sdk.model.directions.RouteStep;
|
|
50
|
+
import es.situm.sdk.model.location.Angle;
|
|
51
|
+
import es.situm.sdk.model.location.Bounds;
|
|
52
|
+
import es.situm.sdk.model.location.CartesianCoordinate;
|
|
53
|
+
import es.situm.sdk.model.location.Coordinate;
|
|
54
|
+
import es.situm.sdk.model.location.Dimensions;
|
|
55
|
+
import es.situm.sdk.model.location.Location;
|
|
56
|
+
import es.situm.sdk.model.navigation.NavigationProgress;
|
|
57
|
+
import es.situm.sdk.v1.SitumConversionArea;
|
|
58
|
+
import es.situm.sdk.v1.SitumEvent;
|
|
59
|
+
|
|
60
|
+
import static com.google.common.truth.Truth.assertThat;
|
|
61
|
+
import static es.situm.plugin.SitumMapper.ADDRESS;
|
|
62
|
+
import static es.situm.plugin.SitumMapper.BOUNDS;
|
|
63
|
+
import static es.situm.plugin.SitumMapper.BOUNDS_ROTATED;
|
|
64
|
+
import static es.situm.plugin.SitumMapper.CENTER;
|
|
65
|
+
import static es.situm.plugin.SitumMapper.DIMENSIONS;
|
|
66
|
+
import static es.situm.plugin.SitumMapper.PICTURE_THUMB_URL;
|
|
67
|
+
import static es.situm.plugin.SitumMapper.PICTURE_URL;
|
|
68
|
+
import static es.situm.plugin.SitumMapper.POI_NAME;
|
|
69
|
+
import static es.situm.plugin.SitumMapper.ROTATION;
|
|
70
|
+
import static es.situm.plugin.SitumMapper.SEGMENTS;
|
|
71
|
+
import static es.situm.plugin.SitumMapper.USER_IDENTIFIER;
|
|
72
|
+
import static es.situm.plugin.SitumMapper.circleToJsonObject;
|
|
73
|
+
import static es.situm.plugin.SitumMapper.conversionAreaToJsonObject;
|
|
74
|
+
|
|
75
|
+
import android.util.Log;
|
|
76
|
+
|
|
77
|
+
@RunWith(JUnit4.class)
|
|
78
|
+
public class SitumMapperTest {
|
|
79
|
+
|
|
80
|
+
private DateFormat dateFormat = DateUtils.dateFormat;
|
|
81
|
+
|
|
82
|
+
// Properties names
|
|
83
|
+
private static final String RADIANS_MINUS_PI_PI = "radiansMinusPiPi";
|
|
84
|
+
private static final String RADIANS = "radians";
|
|
85
|
+
private static final String DEGREES_CLOCKWISE = "degreesClockwise";
|
|
86
|
+
private static final String DEGREES = "degrees";
|
|
87
|
+
private static final String NORTH_WEST = "northWest";
|
|
88
|
+
private static final String SOUTH_WEST = "southWest";
|
|
89
|
+
private static final String NORTH_EAST = "northEast";
|
|
90
|
+
private static final String SOUTH_EAST = "southEast";
|
|
91
|
+
private static final String LATITUDE = "latitude";
|
|
92
|
+
private static final String LONGITUDE = "longitude";
|
|
93
|
+
private static final String X = "x";
|
|
94
|
+
private static final String Y = "y";
|
|
95
|
+
private static final String WIDTH = "width";
|
|
96
|
+
private static final String HEIGHT = "height";
|
|
97
|
+
private static final String ALTITUDE = "altitude";
|
|
98
|
+
private static final String CREATED_AT = "createdAt";
|
|
99
|
+
private static final String FLOOR_IDENTIFIER = "floorIdentifier";
|
|
100
|
+
private static final String LEVEL = "level";
|
|
101
|
+
private static final String CUSTOM_FIELDS = "customFields";
|
|
102
|
+
private static final String MAP_URL = "mapUrl";
|
|
103
|
+
private static final String SCALE = "scale";
|
|
104
|
+
private static final String BUILDING_IDENTIFIER = "buildingIdentifier";
|
|
105
|
+
private static final String UPDATED_AT = "updatedAt";
|
|
106
|
+
private static final String ORIENTATION_TYPE = "orientationType";
|
|
107
|
+
private static final String ORIENTATION = "orientation";
|
|
108
|
+
private static final String STEP_IDX_DESTINTATION = "stepIdxDestination";
|
|
109
|
+
private static final String DISTANCE = "distance";
|
|
110
|
+
private static final String STEP_IDX_ORIGIN = "stepIdxOrigin";
|
|
111
|
+
private static final String INDICATION_TYPE = "indicationType";
|
|
112
|
+
private static final String DISTANCE_TO_NEXT_LEVEL = "distanceToNextLevel";
|
|
113
|
+
private static final String NEEDED_LEVEL_CHANGE = "neededLevelChange";
|
|
114
|
+
private static final String HAS_CARTESIAN_BEARING = "hasCartesianBearing";
|
|
115
|
+
private static final String COORDINATE = "coordinate";
|
|
116
|
+
private static final String BEARING = "bearing";
|
|
117
|
+
private static final String ACCURACY = "accuracy";
|
|
118
|
+
private static final String IS_INDOOR = "isIndoor";
|
|
119
|
+
private static final String DEVICE_ID = "deviceId";
|
|
120
|
+
private static final String QUALITY = "quality";
|
|
121
|
+
private static final String IS_OUTDOOR = "isOutdoor";
|
|
122
|
+
private static final String PROVIDER = "provider";
|
|
123
|
+
private static final String CARTESIAN_BEARING = "cartesianBearing";
|
|
124
|
+
private static final String BEARING_QUALITY = "bearingQuality";
|
|
125
|
+
private static final String HAS_BEARING = "hasBearing";
|
|
126
|
+
private static final String CARTESIAN_COORDINATE = "cartesianCoordinate";
|
|
127
|
+
private static final String POSITION = "position";
|
|
128
|
+
private static final String TIMESTAMP = "timestamp";
|
|
129
|
+
private static final String STATUS_ORDINAL = "statusOrdinal";
|
|
130
|
+
private static final String STATUS_NAME = "statusName";
|
|
131
|
+
private static final String ICON_SELECTED = "icon_selected";
|
|
132
|
+
private static final String ICON_UNSELECTED = "icon_unselected";
|
|
133
|
+
private static final String PUBLIC = "public";
|
|
134
|
+
private static final String POI_CATEGORY_NAME = "poiCategoryName";
|
|
135
|
+
private static final String POI_CATEGORY_CODE = "poiCategoryCode";
|
|
136
|
+
private static final String BOTTOM_LEFT = "bottomLeft";
|
|
137
|
+
private static final String BOTTOM_RIGHT = "bottomRight";
|
|
138
|
+
private static final String TOP_LEFT = "topLeft";
|
|
139
|
+
private static final String TOP_RIGHT = "topRight";
|
|
140
|
+
private static final String CURRENT_INDICATION = "currentIndication";
|
|
141
|
+
private static final String NEXT_INDICATION = "nextIndication";
|
|
142
|
+
private static final String DISTANCE_TO_END_STEP = "distanceToEndStep";
|
|
143
|
+
private static final String CLOSEST_POINT_IN_ROUTE = "closestPointInRoute";
|
|
144
|
+
private static final String DISTANCE_TO_CLOSEST_POINT_IN_ROUTE = "distanceToClosestPointInRoute";
|
|
145
|
+
private static final String TIME_TO_END_STEP = "timeToEndStep";
|
|
146
|
+
private static final String ROUTE_STEP = "routeStep";
|
|
147
|
+
private static final String TIME_TO_GOAL = "timeToGoal";
|
|
148
|
+
private static final String CURRENT_STEP_INDEX = "currentStepIndex";
|
|
149
|
+
private static final String DISTANCE_TO_GOAL = "distanceToGoal";
|
|
150
|
+
private static final String IS_FIRST = "isFirst";
|
|
151
|
+
private static final String IS_LAST = "isLast";
|
|
152
|
+
private static final String FROM = "from";
|
|
153
|
+
private static final String TO = "TO";
|
|
154
|
+
private static final String ID = "id";
|
|
155
|
+
private static final String LAST_STEP = "lastStep";
|
|
156
|
+
private static final String FIRST_STEP = "firstStep";
|
|
157
|
+
private static final String INDICATIONS = "indications";
|
|
158
|
+
private static final String NODES = "nodes";
|
|
159
|
+
private static final String EDGES = "edges";
|
|
160
|
+
private static final String STEPS = "steps";
|
|
161
|
+
private static final String POINTS = "points";
|
|
162
|
+
public static final String IDENTIFIER = "identifier";
|
|
163
|
+
public static final String INFO_HTML = "infoHtml";
|
|
164
|
+
public static final String CONVERSION_AREA = "conversionArea";
|
|
165
|
+
public static final String RADIUS = "radius";
|
|
166
|
+
public static final String NAME = "name";
|
|
167
|
+
public static final String CATEGORY = "category";
|
|
168
|
+
|
|
169
|
+
// Creators
|
|
170
|
+
private AngleCreator angleCreator = new AngleCreator();
|
|
171
|
+
private BoundsCreator boundsCreator = new BoundsCreator();
|
|
172
|
+
private CartesianCoordinateCreator cartesianCoordinateCreator = new CartesianCoordinateCreator();
|
|
173
|
+
private CoordinateCreator coordinateCreator = new CoordinateCreator();
|
|
174
|
+
private DimensionsCreator dimensionsCreator = new DimensionsCreator();
|
|
175
|
+
private FloorCreator floorCreator = new FloorCreator();
|
|
176
|
+
private IndicationCreator indicationCreator = new IndicationCreator();
|
|
177
|
+
private LocationCreator locationCreator = new LocationCreator();
|
|
178
|
+
private LocationStatusCreator locationStatusCreator = new LocationStatusCreator();
|
|
179
|
+
private PoiCategoryCreator poiCategoryCreator = new PoiCategoryCreator();
|
|
180
|
+
private SitumConversionAreaCreator situmConversionAreaCreator = new SitumConversionAreaCreator();
|
|
181
|
+
private NavigationProgressCreator navigationProgressCreator = new NavigationProgressCreator();
|
|
182
|
+
private RouteStepCreator routeStepCreator = new RouteStepCreator();
|
|
183
|
+
private PointCreator pointCreator = new PointCreator();
|
|
184
|
+
private RouteCreator routeCreator = new RouteCreator();
|
|
185
|
+
private EventCreator eventCreator = new EventCreator();
|
|
186
|
+
private CircleCreator circleCreator = new CircleCreator();
|
|
187
|
+
private PoiCreator poiCreator = new PoiCreator();
|
|
188
|
+
private BuildingCreator buildingCreator = new BuildingCreator();
|
|
189
|
+
private DirectionsRequestCreator directionsRequestCreator = new DirectionsRequestCreator();
|
|
190
|
+
private LocationRequestCreator locationRequestCreator = new LocationRequestCreator();
|
|
191
|
+
|
|
192
|
+
@Test
|
|
193
|
+
public void angleTest1() {
|
|
194
|
+
try {
|
|
195
|
+
JSONObject jo = angleCreator.getAngle1();
|
|
196
|
+
Angle angle = SitumMapper.angleJSONObjectToAngle(jo);
|
|
197
|
+
Angle angle1 = angleCreator.createAngleFromDegrees();
|
|
198
|
+
testAngle(angle, angle1);
|
|
199
|
+
} catch (JSONException e) {
|
|
200
|
+
System.err.println(e.getMessage());
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@Test
|
|
205
|
+
public void angleTest2() {
|
|
206
|
+
try {
|
|
207
|
+
JSONObject jo = angleCreator.getAngle2();
|
|
208
|
+
Angle angle = SitumMapper.angleJSONObjectToAngle(jo);
|
|
209
|
+
Angle angle1 = angleCreator.createAngleFromRadians();
|
|
210
|
+
testAngle(angle, angle1);
|
|
211
|
+
} catch (JSONException e) {
|
|
212
|
+
System.err.println(e.getMessage());
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@Test
|
|
217
|
+
public void angleJSONObjectTest() {
|
|
218
|
+
try {
|
|
219
|
+
Angle angleFromDegrees = angleCreator.createAngleFromDegrees();
|
|
220
|
+
Angle angleFromRadians = angleCreator.createAngleFromRadians();
|
|
221
|
+
JSONObject angleFromDegreesJSONObject = SitumMapper.angleToJsonObject(angleFromDegrees);
|
|
222
|
+
JSONObject angleFromRadiansJSONObject = SitumMapper.angleToJsonObject(angleFromRadians);
|
|
223
|
+
JSONObject angle1 = angleCreator.getAngle1();
|
|
224
|
+
JSONObject angle2 = angleCreator.getAngle2();
|
|
225
|
+
testAngle(angleFromDegreesJSONObject, angle1);
|
|
226
|
+
testAngle(angleFromRadiansJSONObject, angle2);
|
|
227
|
+
} catch (JSONException e) {
|
|
228
|
+
System.err.println(e.getMessage());
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@Test
|
|
233
|
+
public void boundsJSONObjectTest() {
|
|
234
|
+
try {
|
|
235
|
+
Bounds bounds = boundsCreator.createBounds();
|
|
236
|
+
Bounds boundsWithArray = boundsCreator.createBoundsWithArray();
|
|
237
|
+
JSONObject boundsJSONObject = SitumMapper.boundsToJsonObject(bounds);
|
|
238
|
+
JSONObject boundsWithArrayJSONObject = SitumMapper.boundsToJsonObject(boundsWithArray);
|
|
239
|
+
JSONObject bounds1 = boundsCreator.getBounds1();
|
|
240
|
+
JSONObject bounds2 = boundsCreator.getBounds2();
|
|
241
|
+
testBounds(boundsJSONObject, bounds1);
|
|
242
|
+
testBounds(boundsWithArrayJSONObject, bounds2);
|
|
243
|
+
} catch (JSONException e) {
|
|
244
|
+
System.err.println(e.getMessage());
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
@Test
|
|
249
|
+
public void buildingTest() {
|
|
250
|
+
try{
|
|
251
|
+
JSONObject jo = buildingCreator.getBuilding1();
|
|
252
|
+
Building building = SitumMapper.buildingJsonObjectToBuilding(jo);
|
|
253
|
+
Building building1 = buildingCreator.createBuilding1();
|
|
254
|
+
testBuilding(building, building1);
|
|
255
|
+
} catch (Exception e) {
|
|
256
|
+
System.err.println(e.getMessage());
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@Test
|
|
261
|
+
public void buildingJSONObjectTest() {
|
|
262
|
+
try {
|
|
263
|
+
Building building = buildingCreator.createBuilding1();
|
|
264
|
+
JSONObject buildingJSONObject = SitumMapper.buildingToJsonObject(building);
|
|
265
|
+
JSONObject building1 = buildingCreator.getBuilding1();
|
|
266
|
+
testBuilding(buildingJSONObject,building1);
|
|
267
|
+
} catch (JSONException e) {
|
|
268
|
+
System.err.println(e.getMessage());
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@Test
|
|
273
|
+
public void cartesianCoordinateTest() {
|
|
274
|
+
try {
|
|
275
|
+
JSONObject jo = cartesianCoordinateCreator.getCartesianCoordinate1();
|
|
276
|
+
CartesianCoordinate cartesianCoordinate = SitumMapper.cartesianCoordinateJsonObjectToCartesianCoordinate(jo);
|
|
277
|
+
CartesianCoordinate cartesianCoordinate1 = cartesianCoordinateCreator.createCartesianCoordinate();
|
|
278
|
+
testCartesianCoordinate(cartesianCoordinate,cartesianCoordinate1);
|
|
279
|
+
} catch (JSONException e) {
|
|
280
|
+
System.err.println(e.getMessage());
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@Test
|
|
285
|
+
public void cartesianCoordinateJSONObjectTest() {
|
|
286
|
+
try {
|
|
287
|
+
CartesianCoordinate cartesianCoordinate = cartesianCoordinateCreator.createCartesianCoordinate();
|
|
288
|
+
JSONObject cartesianCoordinateJSONObject = SitumMapper.cartesianCoordinateToJsonObject(cartesianCoordinate);
|
|
289
|
+
JSONObject cartesianCoordinate1 = cartesianCoordinateCreator.getCartesianCoordinate1();
|
|
290
|
+
testCartesianCoordinate(cartesianCoordinateJSONObject, cartesianCoordinate1);
|
|
291
|
+
} catch (JSONException e) {
|
|
292
|
+
System.err.println(e.getMessage());
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
@Test
|
|
297
|
+
public void coordinateTest() {
|
|
298
|
+
try {
|
|
299
|
+
JSONObject jo = coordinateCreator.getCoordinate1();
|
|
300
|
+
Coordinate coordinate = SitumMapper.coordinateJsonObjectToCoordinate(jo);
|
|
301
|
+
Coordinate coordinate1 = coordinateCreator.createCoordinate();
|
|
302
|
+
testCoordinate(coordinate, coordinate1);
|
|
303
|
+
} catch (JSONException e) {
|
|
304
|
+
System.err.println(e.getMessage());
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@Test
|
|
309
|
+
public void coordinateJSONObjectTest() {
|
|
310
|
+
try {
|
|
311
|
+
Coordinate coordinate = coordinateCreator.createCoordinate();
|
|
312
|
+
JSONObject coordinateJSONObject = SitumMapper.coordinateToJsonObject(coordinate);
|
|
313
|
+
JSONObject coordinate1 = coordinateCreator.getCoordinate1();
|
|
314
|
+
testCoordinate(coordinateJSONObject, coordinate1);
|
|
315
|
+
} catch (JSONException e) {
|
|
316
|
+
System.err.println(e.getMessage());
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@Test
|
|
321
|
+
public void dimensionJSONObjectTest() {
|
|
322
|
+
try {
|
|
323
|
+
Dimensions dimensions = dimensionsCreator.createDimensions();
|
|
324
|
+
JSONObject dimessionsJSONObject = SitumMapper.dimensionsToJsonObject(dimensions);
|
|
325
|
+
JSONObject dimensions1 = dimensionsCreator.getDimensions1();
|
|
326
|
+
testDimensions(dimessionsJSONObject, dimensions1);
|
|
327
|
+
} catch (JSONException e) {
|
|
328
|
+
System.err.println(e.getMessage());
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@Test
|
|
333
|
+
public void directionsRequestTest1() {
|
|
334
|
+
try {
|
|
335
|
+
JSONArray jo = directionsRequestCreator.getDirectionsRequest1();
|
|
336
|
+
DirectionsRequest directionsRequest = SitumMapper.jsonObjectToDirectionsRequest(
|
|
337
|
+
buildingCreator.getBuilding1(), pointCreator.getPoint1(), pointCreator.getPoint2(), jo.getJSONObject(3));
|
|
338
|
+
DirectionsRequest directionsRequest1 = directionsRequestCreator.createDirectionsRequest1();
|
|
339
|
+
testDirectionsRequest(directionsRequest, directionsRequest1);
|
|
340
|
+
} catch (Exception e) {
|
|
341
|
+
e.printStackTrace();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
@Test
|
|
346
|
+
public void directionsRequestTest2() {
|
|
347
|
+
try {
|
|
348
|
+
JSONArray jo = directionsRequestCreator.getDirectionsRequest2();
|
|
349
|
+
DirectionsRequest directionsRequest = SitumMapper.jsonObjectToDirectionsRequest(
|
|
350
|
+
buildingCreator.getBuilding1(), pointCreator.getPoint1(), pointCreator.getPoint2(), jo.getJSONObject(3));
|
|
351
|
+
DirectionsRequest directionsRequest1 = directionsRequestCreator.createDirectionsRequest2();
|
|
352
|
+
testDirectionsRequest(directionsRequest, directionsRequest1);
|
|
353
|
+
} catch (Exception e) {
|
|
354
|
+
e.printStackTrace();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
@Test
|
|
359
|
+
public void directionsRequestTest3() {
|
|
360
|
+
try {
|
|
361
|
+
JSONArray jo = directionsRequestCreator.getDirectionsRequest3();
|
|
362
|
+
DirectionsRequest directionsRequest = SitumMapper.jsonObjectToDirectionsRequest(
|
|
363
|
+
buildingCreator.getBuilding1(), pointCreator.getPoint1(), pointCreator.getPoint2(), jo.getJSONObject(3));
|
|
364
|
+
DirectionsRequest directionsRequest1 = directionsRequestCreator.createDirectionsRequest3();
|
|
365
|
+
testDirectionsRequest(directionsRequest, directionsRequest1);
|
|
366
|
+
} catch (Exception e) {
|
|
367
|
+
e.printStackTrace();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
@Test
|
|
372
|
+
public void directionsRequestTest4() {
|
|
373
|
+
try {
|
|
374
|
+
JSONArray jo = directionsRequestCreator.getDirectionsRequest4();
|
|
375
|
+
DirectionsRequest directionsRequest = SitumMapper.jsonObjectToDirectionsRequest(
|
|
376
|
+
buildingCreator.getBuilding1(), pointCreator.getPoint1(), pointCreator.getPoint2(), jo.getJSONObject(3));
|
|
377
|
+
DirectionsRequest directionsRequest1 = directionsRequestCreator.createDirectionsRequest4();
|
|
378
|
+
testDirectionsRequest(directionsRequest, directionsRequest1);
|
|
379
|
+
} catch (Exception e) {
|
|
380
|
+
e.printStackTrace();
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
@Test
|
|
385
|
+
public void directionsRequestTest5() {
|
|
386
|
+
try {
|
|
387
|
+
JSONArray jo = directionsRequestCreator.getDirectionsRequest5();
|
|
388
|
+
DirectionsRequest directionsRequest = SitumMapper.jsonObjectToDirectionsRequest(
|
|
389
|
+
buildingCreator.getBuilding1(), pointCreator.getPoint1(), pointCreator.getPoint2(), jo.getJSONObject(3));
|
|
390
|
+
DirectionsRequest directionsRequest1 = directionsRequestCreator.createDirectionsRequest5();
|
|
391
|
+
testDirectionsRequest(directionsRequest, directionsRequest1);
|
|
392
|
+
} catch (Exception e) {
|
|
393
|
+
e.printStackTrace();
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
@Test
|
|
398
|
+
public void directionsRequestTest6() {
|
|
399
|
+
try {
|
|
400
|
+
JSONArray jo = directionsRequestCreator.getDirectionsRequest6();
|
|
401
|
+
DirectionsRequest directionsRequest = SitumMapper.jsonObjectToDirectionsRequest(
|
|
402
|
+
buildingCreator.getBuilding1(), pointCreator.getPoint1(), pointCreator.getPoint2(), jo.getJSONObject(3));
|
|
403
|
+
DirectionsRequest directionsRequest1 = directionsRequestCreator.createDirectionsRequest6();
|
|
404
|
+
testDirectionsRequest(directionsRequest, directionsRequest1);
|
|
405
|
+
} catch (Exception e) {
|
|
406
|
+
e.printStackTrace();
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
@Test
|
|
411
|
+
public void locationRequestTest1() {
|
|
412
|
+
try {
|
|
413
|
+
JSONArray jo = locationRequestCreator.getLocationRequest1();
|
|
414
|
+
LocationRequest locationRequest = SitumMapper.locationRequestJSONObjectToLocationRequest(jo);
|
|
415
|
+
LocationRequest locationRequest1 = locationRequestCreator.createLocationRequest1();
|
|
416
|
+
testLocationRequest(locationRequest, locationRequest1);
|
|
417
|
+
} catch (JSONException e) {
|
|
418
|
+
e.printStackTrace();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
@Test
|
|
423
|
+
public void locationRequestTest2() {
|
|
424
|
+
try {
|
|
425
|
+
JSONArray jo = locationRequestCreator.getLocationRequest2();
|
|
426
|
+
LocationRequest locationRequest = SitumMapper.locationRequestJSONObjectToLocationRequest(jo);
|
|
427
|
+
LocationRequest locationRequest2 = locationRequestCreator.createLocationRequest2();
|
|
428
|
+
testLocationRequest(locationRequest, locationRequest2);
|
|
429
|
+
} catch (JSONException e) {
|
|
430
|
+
e.printStackTrace();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
@Test
|
|
435
|
+
public void floorTest1() {
|
|
436
|
+
try {
|
|
437
|
+
JSONObject jo = floorCreator.getFloor1();
|
|
438
|
+
Floor floor = SitumMapper.floorJsonObjectToFloor(jo);
|
|
439
|
+
Floor floor1 = floorCreator.createFloorWithAltitude();
|
|
440
|
+
testFloor(floor, floor1);
|
|
441
|
+
} catch (JSONException e) {
|
|
442
|
+
e.printStackTrace();
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
@Test
|
|
447
|
+
public void floorTest2() {
|
|
448
|
+
try {
|
|
449
|
+
JSONObject jo = floorCreator.getFloor2();
|
|
450
|
+
Floor floor = SitumMapper.floorJsonObjectToFloor(jo);
|
|
451
|
+
Floor floor1 = floorCreator.createFloorWithoutAltitude();
|
|
452
|
+
testFloor(floor, floor1);
|
|
453
|
+
} catch (JSONException e) {
|
|
454
|
+
e.printStackTrace();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
@Test
|
|
459
|
+
public void floorJSONObjectTest() {
|
|
460
|
+
try {
|
|
461
|
+
Floor floor = floorCreator.createFloorWithAltitude();
|
|
462
|
+
JSONObject floorJSONObject = SitumMapper.floorToJsonObject(floor);
|
|
463
|
+
JSONObject floor1 = floorCreator.getFloor1();
|
|
464
|
+
testFloor(floorJSONObject, floor1);
|
|
465
|
+
Floor floorWithoutAltitude = floorCreator.createFloorWithoutAltitude();
|
|
466
|
+
JSONObject floorWithoutAltitudeJSONObject = SitumMapper.floorToJsonObject(floorWithoutAltitude);
|
|
467
|
+
JSONObject floor2 = floorCreator.getFloor2();
|
|
468
|
+
testFloor(floorWithoutAltitudeJSONObject, floor2);
|
|
469
|
+
} catch (JSONException e) {
|
|
470
|
+
System.err.println(e.getMessage());
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
@Test
|
|
475
|
+
public void indicationJSONObjectTest() {
|
|
476
|
+
try {
|
|
477
|
+
Indication indication = indicationCreator.createIndication();
|
|
478
|
+
JSONObject indicationJSONObject = SitumMapper.indicationToJsonObject(indication);
|
|
479
|
+
JSONObject indication1 = indicationCreator.getIndication1();
|
|
480
|
+
testIndication(indicationJSONObject, indication1);
|
|
481
|
+
} catch (JSONException e) {
|
|
482
|
+
System.err.println(e.getMessage());
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
@Test
|
|
487
|
+
public void locationTest1() {
|
|
488
|
+
try {
|
|
489
|
+
JSONObject jo = locationCreator.getLocation1();
|
|
490
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
491
|
+
Location location1 = locationCreator.createLocationWithBuildingFloorAndCartesianCoordinates();
|
|
492
|
+
testLocation(location, location1);
|
|
493
|
+
} catch (JSONException e) {
|
|
494
|
+
System.err.println(e.getMessage());
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
@Test
|
|
499
|
+
public void locationTest2() {
|
|
500
|
+
try {
|
|
501
|
+
JSONObject jo = locationCreator.getLocation2();
|
|
502
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
503
|
+
Location location1 = locationCreator.createLocationWithCoordinate();
|
|
504
|
+
testLocation(location, location1);
|
|
505
|
+
} catch (JSONException e) {
|
|
506
|
+
System.err.println(e.getMessage());
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
@Test
|
|
511
|
+
public void locationTest3() {
|
|
512
|
+
try {
|
|
513
|
+
JSONObject jo = locationCreator.getLocation3();
|
|
514
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
515
|
+
Location location1 = locationCreator.createLocationWithBuildingAndCoordinate();
|
|
516
|
+
testLocation(location, location1);
|
|
517
|
+
} catch (JSONException e) {
|
|
518
|
+
System.err.println(e.getMessage());
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
@Test
|
|
523
|
+
public void locationTest4() {
|
|
524
|
+
try {
|
|
525
|
+
JSONObject jo = locationCreator.getLocation4();
|
|
526
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
527
|
+
Location location1 = locationCreator.locationWithCartesianBearing();
|
|
528
|
+
testLocation(location, location1);
|
|
529
|
+
} catch (JSONException e) {
|
|
530
|
+
System.err.println(e.getMessage());
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
@Test
|
|
535
|
+
public void locationTest5() {
|
|
536
|
+
try {
|
|
537
|
+
JSONObject jo = locationCreator.getLocation5();
|
|
538
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
539
|
+
Location location1 = locationCreator.locationWithoutCartesianBearing();
|
|
540
|
+
testLocation(location, location1);
|
|
541
|
+
} catch (JSONException e) {
|
|
542
|
+
System.err.println(e.getMessage());
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
@Test
|
|
547
|
+
public void locationTest6() {
|
|
548
|
+
try {
|
|
549
|
+
JSONObject jo = locationCreator.getLocation6();
|
|
550
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
551
|
+
Location location1 = locationCreator.locationWithBearing();
|
|
552
|
+
testLocation(location, location1);
|
|
553
|
+
} catch (JSONException e) {
|
|
554
|
+
System.err.println(e.getMessage());
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
@Test
|
|
559
|
+
public void locationTest7() {
|
|
560
|
+
try {
|
|
561
|
+
JSONObject jo = locationCreator.getLocation7();
|
|
562
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
563
|
+
Location location1 = locationCreator.locationWithoutBearing();
|
|
564
|
+
testLocation(location, location1);
|
|
565
|
+
} catch (JSONException e) {
|
|
566
|
+
System.err.println(e.getMessage());
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
@Test
|
|
571
|
+
public void locationTest8() {
|
|
572
|
+
try {
|
|
573
|
+
JSONObject jo = locationCreator.getLocation8();
|
|
574
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
575
|
+
Location location1 = locationCreator.indoorLocationWithIndoorBearingQualityLow();
|
|
576
|
+
testLocation(location, location1);
|
|
577
|
+
} catch (JSONException e) {
|
|
578
|
+
System.err.println(e.getMessage());
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
@Test
|
|
583
|
+
public void locationTest9() {
|
|
584
|
+
try {
|
|
585
|
+
JSONObject jo = locationCreator.getLocation9();
|
|
586
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
587
|
+
Location location1 = locationCreator.indoorLocationWithIndoorBearingQualityHigh();
|
|
588
|
+
testLocation(location, location1);
|
|
589
|
+
} catch (JSONException e) {
|
|
590
|
+
System.err.println(e.getMessage());
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
@Test
|
|
595
|
+
public void locationTest10() {
|
|
596
|
+
try {
|
|
597
|
+
JSONObject jo = locationCreator.getLocation10();
|
|
598
|
+
Location location = SitumMapper.jsonLocationObjectToLocation(jo);
|
|
599
|
+
Location location1 = locationCreator.outdoorLocation();
|
|
600
|
+
testLocation(location, location1);
|
|
601
|
+
} catch (JSONException e) {
|
|
602
|
+
System.err.println(e.getMessage());
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
@Test
|
|
607
|
+
public void locationJSONObjectTest() {
|
|
608
|
+
try {
|
|
609
|
+
Location locationWithBuildingFloorAndCartesianCoordinates = locationCreator.createLocationWithBuildingFloorAndCartesianCoordinates();
|
|
610
|
+
JSONObject locationWithBuildingFloorAndCartesianCoordinatesJSONObject = SitumMapper.locationToJsonObject(locationWithBuildingFloorAndCartesianCoordinates);
|
|
611
|
+
JSONObject location1 = locationCreator.getLocation1();
|
|
612
|
+
testLocation(locationWithBuildingFloorAndCartesianCoordinatesJSONObject, location1);
|
|
613
|
+
Location locationWithCoordinate = locationCreator.createLocationWithCoordinate();
|
|
614
|
+
JSONObject locationWithCoordinateJSONObject = SitumMapper.locationToJsonObject(locationWithCoordinate);
|
|
615
|
+
JSONObject location2 = locationCreator.getLocation2();
|
|
616
|
+
testLocation(locationWithCoordinateJSONObject, location2);
|
|
617
|
+
Location locationWithBuildingAndCoordinate = locationCreator.createLocationWithBuildingAndCoordinate();
|
|
618
|
+
JSONObject locationWithBuildingAndCoordinateJSONObject = SitumMapper.locationToJsonObject(locationWithBuildingAndCoordinate);
|
|
619
|
+
JSONObject location3 = locationCreator.getLocation3();
|
|
620
|
+
testLocation(locationWithBuildingAndCoordinateJSONObject, location3);
|
|
621
|
+
Location locationWithCartesianBearing = locationCreator.locationWithCartesianBearing();
|
|
622
|
+
JSONObject locationWithCartesianBearingJSONObject = SitumMapper.locationToJsonObject(locationWithCartesianBearing);
|
|
623
|
+
JSONObject location4 = locationCreator.getLocation4();
|
|
624
|
+
testLocation(locationWithCartesianBearingJSONObject, location4);
|
|
625
|
+
Location locationWithoutCartesianBearing = locationCreator.locationWithoutCartesianBearing();
|
|
626
|
+
JSONObject locationWithoutCartesianBearingJSONObject = SitumMapper.locationToJsonObject(locationWithoutCartesianBearing);
|
|
627
|
+
JSONObject location5 = locationCreator.getLocation5();
|
|
628
|
+
testLocation(locationWithoutCartesianBearingJSONObject, location5);
|
|
629
|
+
Location locationWithBearing = locationCreator.locationWithBearing();
|
|
630
|
+
JSONObject locationWithBearingJSONObject = SitumMapper.locationToJsonObject(locationWithBearing);
|
|
631
|
+
JSONObject location6 = locationCreator.getLocation6();
|
|
632
|
+
testLocation(locationWithBearingJSONObject, location6);
|
|
633
|
+
Location locationWithoutBearing = locationCreator.locationWithoutBearing();
|
|
634
|
+
JSONObject locationWithoutBearingJSONObject = SitumMapper.locationToJsonObject(locationWithoutBearing);
|
|
635
|
+
JSONObject location7 = locationCreator.getLocation7();
|
|
636
|
+
testLocation(locationWithoutBearingJSONObject, location7);
|
|
637
|
+
Location indoorLocationWithIndoorBearingQualityLow = locationCreator.indoorLocationWithIndoorBearingQualityLow();
|
|
638
|
+
JSONObject indoorLocationWithIndoorBearingQualityLowJSONObject = SitumMapper.locationToJsonObject(indoorLocationWithIndoorBearingQualityLow);
|
|
639
|
+
JSONObject location8 = locationCreator.getLocation8();
|
|
640
|
+
testLocation(indoorLocationWithIndoorBearingQualityLowJSONObject, location8);
|
|
641
|
+
Location indoorLocationWithIndoorBearingQualityHigh = locationCreator.indoorLocationWithIndoorBearingQualityHigh();
|
|
642
|
+
JSONObject indoorLocationWithIndoorBearingQualityHighJSONObject = SitumMapper.locationToJsonObject(indoorLocationWithIndoorBearingQualityHigh);
|
|
643
|
+
JSONObject location9 = locationCreator.getLocation9();
|
|
644
|
+
testLocation(indoorLocationWithIndoorBearingQualityHighJSONObject, location9);
|
|
645
|
+
Location outdoorLocation = locationCreator.outdoorLocation();
|
|
646
|
+
JSONObject outdoorLocationJSONObject = SitumMapper.locationToJsonObject(outdoorLocation);
|
|
647
|
+
JSONObject location10 = locationCreator.getLocation10();
|
|
648
|
+
testLocation(outdoorLocationJSONObject, location10);
|
|
649
|
+
} catch (JSONException e) {
|
|
650
|
+
System.err.println(e.getMessage());
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
@Test
|
|
655
|
+
public void locationStatusJSONObjectTest() {
|
|
656
|
+
try {
|
|
657
|
+
LocationStatus locationStatusStarting = locationStatusCreator.createLocationStatusStarting();
|
|
658
|
+
JSONObject locationStatusStartingJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusStarting);
|
|
659
|
+
JSONObject locationStatus1 = locationStatusCreator.getLocationStatus1();
|
|
660
|
+
testLocationStatus(locationStatusStartingJSONObject, locationStatus1);
|
|
661
|
+
LocationStatus locationStatusBLENotAvailable = locationStatusCreator.createLocationStatusBLENotAvailable();
|
|
662
|
+
JSONObject locationStatusBLENotAvailableJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusBLENotAvailable);
|
|
663
|
+
JSONObject locationStatus2 = locationStatusCreator.getLocationStatus2();
|
|
664
|
+
testLocationStatus(locationStatusBLENotAvailableJSONObject, locationStatus2);
|
|
665
|
+
LocationStatus locationStatusCalculating = locationStatusCreator.createLocationStatusCalculating();
|
|
666
|
+
JSONObject locationStatusCalculatingJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusCalculating);
|
|
667
|
+
JSONObject locationStatus3 = locationStatusCreator.getLocationStatus3();
|
|
668
|
+
testLocationStatus(locationStatusCalculatingJSONObject, locationStatus3);
|
|
669
|
+
LocationStatus locationStatusCompassCalibrationNeeded = locationStatusCreator.createLocationStatusCompassCalibrationNeeded();
|
|
670
|
+
JSONObject locationStatusCompassCalibrationNeededJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusCompassCalibrationNeeded);
|
|
671
|
+
JSONObject locationStatus4 = locationStatusCreator.getLocationStatus4();
|
|
672
|
+
testLocationStatus(locationStatusCompassCalibrationNeededJSONObject, locationStatus4);
|
|
673
|
+
LocationStatus locationStatusCompassCalibrationNotNeeded = locationStatusCreator.createLocationStatusCompassCalibrationNotNeeded();
|
|
674
|
+
JSONObject locationStatusCompassCalibrationNotNeededJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusCompassCalibrationNotNeeded);
|
|
675
|
+
JSONObject locationStatus5 = locationStatusCreator.getLocationStatus5();
|
|
676
|
+
testLocationStatus(locationStatusCompassCalibrationNotNeededJSONObject, locationStatus5);
|
|
677
|
+
LocationStatus locationStatusNoConnection = locationStatusCreator.createLocationStatusNoConnection();
|
|
678
|
+
JSONObject locationStatusNoConnectionJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusNoConnection);
|
|
679
|
+
JSONObject locationStatus6 = locationStatusCreator.getLocationStatus6();
|
|
680
|
+
testLocationStatus(locationStatusNoConnectionJSONObject, locationStatus6);
|
|
681
|
+
LocationStatus locationStatusPreparingPositioningModel = locationStatusCreator.createLocationStatusPreparingPositioningModel();
|
|
682
|
+
JSONObject locationStatusPreparingPositioningModelJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusPreparingPositioningModel);
|
|
683
|
+
JSONObject locationStatus7 = locationStatusCreator.getLocationStatus7();
|
|
684
|
+
testLocationStatus(locationStatusPreparingPositioningModelJSONObject, locationStatus7);
|
|
685
|
+
LocationStatus locationStatusProcessingPositioningModel = locationStatusCreator.createLocationStatusProcessingPositioningModel();
|
|
686
|
+
JSONObject locationStatusProcessingPositioningModelJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusProcessingPositioningModel);
|
|
687
|
+
JSONObject locationStatus8 = locationStatusCreator.getLocationStatus8();
|
|
688
|
+
testLocationStatus(locationStatusProcessingPositioningModelJSONObject, locationStatus8);
|
|
689
|
+
LocationStatus locationStatusRetryDownloadPositioningModel = locationStatusCreator.createLocationStatusRetryDownloadPositioningModel();
|
|
690
|
+
JSONObject locationStatusRetryDownloadPositioningModelJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusRetryDownloadPositioningModel);
|
|
691
|
+
JSONObject locationStatus9 = locationStatusCreator.getLocationStatus9();
|
|
692
|
+
testLocationStatus(locationStatusRetryDownloadPositioningModelJSONObject, locationStatus9);
|
|
693
|
+
LocationStatus locationStatusStartDownloadPositioningModel = locationStatusCreator.createLocationStatusStartDownloadPositioningModel();
|
|
694
|
+
JSONObject locationStatusStartDownloadPositioningModelJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusStartDownloadPositioningModel);
|
|
695
|
+
JSONObject locationStatus10 = locationStatusCreator.getLocationStatus10();
|
|
696
|
+
testLocationStatus(locationStatusStartDownloadPositioningModelJSONObject, locationStatus10);
|
|
697
|
+
LocationStatus locationStatusStartingPositioning = locationStatusCreator.createLocationStatusStartingPositioning();
|
|
698
|
+
JSONObject locationStatusStartingPositioningJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusStartingPositioning);
|
|
699
|
+
JSONObject locationStatus11 = locationStatusCreator.getLocationStatus11();
|
|
700
|
+
testLocationStatus(locationStatusStartingPositioningJSONObject, locationStatus11);
|
|
701
|
+
LocationStatus locationStatusTimeSettingsManual = locationStatusCreator.createLocationStatusTimeSettingsManual();
|
|
702
|
+
JSONObject locationStatusTimeSettingsManualJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusTimeSettingsManual);
|
|
703
|
+
JSONObject locationStatus12 = locationStatusCreator.getLocationStatus12();
|
|
704
|
+
testLocationStatus(locationStatusTimeSettingsManualJSONObject, locationStatus12);
|
|
705
|
+
LocationStatus locationStatusUserNotInBuilding = locationStatusCreator.createLocationStatusUserNotInBuilding();
|
|
706
|
+
JSONObject locationStatusUserNotInBuildingJSONObject = SitumMapper.locationStatusToJsonObject(locationStatusUserNotInBuilding);
|
|
707
|
+
JSONObject locationStatus13 = locationStatusCreator.getLocationStatus13();
|
|
708
|
+
testLocationStatus(locationStatusUserNotInBuildingJSONObject, locationStatus13);
|
|
709
|
+
} catch (JSONException e) {
|
|
710
|
+
System.err.println(e.getMessage());
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
@Test
|
|
715
|
+
public void poiJSONObjectTest1() {
|
|
716
|
+
try{
|
|
717
|
+
Poi poiOutdoorWithCategory = poiCreator.createOutdoorPoiWithCategory();
|
|
718
|
+
JSONObject poiOutdoorWithCategoryJSONObject = SitumMapper.poiToJsonObject(poiOutdoorWithCategory);
|
|
719
|
+
testPoi(poiOutdoorWithCategoryJSONObject, poiCreator.getPoi1());
|
|
720
|
+
System.out.println(poiOutdoorWithCategoryJSONObject.toString());
|
|
721
|
+
}catch (JSONException e){
|
|
722
|
+
System.err.println(e.getMessage());
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
@Test
|
|
727
|
+
public void poiJSONObjectTest2() {
|
|
728
|
+
try{
|
|
729
|
+
Poi poi = poiCreator.createPoiWithBuildingFloorAndCoordinateWithCategory();
|
|
730
|
+
JSONObject poiJSONObject = SitumMapper.poiToJsonObject(poi);
|
|
731
|
+
testPoi(poiJSONObject,poiCreator.getPoi2());
|
|
732
|
+
System.out.println(poiJSONObject.toString());
|
|
733
|
+
}catch (JSONException e){
|
|
734
|
+
System.err.println(e.getMessage());
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
@Test
|
|
739
|
+
public void poiJSONObjectTest3() {
|
|
740
|
+
try{
|
|
741
|
+
Poi poi = poiCreator.createPoiWithCoordinateAndBuildingId();
|
|
742
|
+
JSONObject poiJSONObject = SitumMapper.poiToJsonObject(poi);
|
|
743
|
+
testPoi(poiJSONObject,poiCreator.getPoi3());
|
|
744
|
+
System.out.println(poiJSONObject.toString());
|
|
745
|
+
}catch (JSONException e){
|
|
746
|
+
System.err.println(e.getMessage());
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
@Test
|
|
751
|
+
public void poiJSONObjectTest4() {
|
|
752
|
+
try{
|
|
753
|
+
Poi poi = poiCreator.createPoiWithBuildingFloorCoordinateAndCartesian();
|
|
754
|
+
JSONObject poiJSONObject = SitumMapper.poiToJsonObject(poi);
|
|
755
|
+
testPoi(poiJSONObject,poiCreator.getPoi4());
|
|
756
|
+
System.out.println(poiJSONObject.toString());
|
|
757
|
+
}catch (JSONException e){
|
|
758
|
+
System.err.println(e.getMessage());
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
@Test
|
|
763
|
+
public void poiJSONObjectTest5() {
|
|
764
|
+
try{
|
|
765
|
+
Poi poi = poiCreator.createPoiWithBuildingFloorAndCoordinates();
|
|
766
|
+
JSONObject poiJSONObject = SitumMapper.poiToJsonObject(poi);
|
|
767
|
+
testPoi(poiJSONObject,poiCreator.getPoi5());
|
|
768
|
+
System.out.println(poiJSONObject.toString());
|
|
769
|
+
}catch (JSONException e){
|
|
770
|
+
System.err.println(e.getMessage());
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
@Test
|
|
775
|
+
public void poiCategoryTest() {
|
|
776
|
+
try{
|
|
777
|
+
JSONObject jo = poiCategoryCreator.getPoiCategory1();
|
|
778
|
+
PoiCategory poiCategory = SitumMapper.poiCategoryFromJsonObject(jo);
|
|
779
|
+
PoiCategory poiCategory1 = poiCategoryCreator.createPoiCategory();
|
|
780
|
+
testPoiCategory(poiCategory, poiCategory1);
|
|
781
|
+
}catch (JSONException e){
|
|
782
|
+
System.err.println(e.getMessage());
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
@Test
|
|
787
|
+
public void poiCategoryJSONObjectTest() {
|
|
788
|
+
try{
|
|
789
|
+
PoiCategory poiCategory = poiCategoryCreator.createPoiCategory();
|
|
790
|
+
JSONObject poiCategoryJSONObject = SitumMapper.poiCategoryToJsonObject(poiCategory);
|
|
791
|
+
JSONObject poiCategory1 = poiCategoryCreator.getPoiCategory1();
|
|
792
|
+
System.out.println(poiCategoryJSONObject.toString());
|
|
793
|
+
System.out.println(poiCategory1.toString());
|
|
794
|
+
testPoiCategory(poiCategoryJSONObject, poiCategory1);
|
|
795
|
+
}catch(JSONException e){
|
|
796
|
+
System.err.println(e.getMessage());
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
@Test
|
|
801
|
+
public void situmConversionAreaJSONObjectTest() {
|
|
802
|
+
try{
|
|
803
|
+
SitumConversionArea situmConversionArea = situmConversionAreaCreator.createSitumConversionArea();
|
|
804
|
+
JSONObject situmConversionAreaJSONObject = conversionAreaToJsonObject(situmConversionArea);
|
|
805
|
+
JSONObject situmConversionArea1 = situmConversionAreaCreator.getSitumConversionArea1();
|
|
806
|
+
testSitumConversionArea(situmConversionAreaJSONObject, situmConversionArea1);
|
|
807
|
+
}catch(JSONException e){
|
|
808
|
+
System.err.println(e.getMessage());
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
@Test
|
|
813
|
+
public void situmCircleJSONObjectTest() {
|
|
814
|
+
try{
|
|
815
|
+
Circle circle = circleCreator.createCircle();
|
|
816
|
+
JSONObject circleJSONObject = circleToJsonObject(circle);
|
|
817
|
+
JSONObject circle1 = circleCreator.getCircle1();
|
|
818
|
+
testCircle(circleJSONObject, circle1);
|
|
819
|
+
}catch(JSONException e){
|
|
820
|
+
System.err.println(e.getMessage());
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
@Test
|
|
825
|
+
public void navigationProgressJSONObjectTest() {
|
|
826
|
+
try{
|
|
827
|
+
NavigationProgress navigationProgressOutdoor = navigationProgressCreator.createNavigationProgressOutdoor();
|
|
828
|
+
JSONObject navigationProgressOutdoorJSONObject = SitumMapper.navigationProgressToJsonObject(navigationProgressOutdoor);
|
|
829
|
+
JSONObject navigationProgress1 = navigationProgressCreator.getNavigationProgress1();
|
|
830
|
+
testNavigationProgress(navigationProgressOutdoorJSONObject, navigationProgress1);
|
|
831
|
+
NavigationProgress navigationProgressIndoor = navigationProgressCreator.createNavigationProgressIndoor();
|
|
832
|
+
JSONObject navigationProgressIndoorJSONObject = SitumMapper.navigationProgressToJsonObject(navigationProgressIndoor);
|
|
833
|
+
JSONObject navigationProgress2 = navigationProgressCreator.getNavigationProgress2();
|
|
834
|
+
testNavigationProgress(navigationProgressIndoorJSONObject, navigationProgress2);
|
|
835
|
+
}catch(JSONException e){
|
|
836
|
+
System.err.println(e.getMessage());
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
@Test
|
|
841
|
+
public void routeStepJSONObjectTest(){
|
|
842
|
+
try{
|
|
843
|
+
RouteStep routeStepWithCoordinate = routeStepCreator.createRouteStepWithCoordinate();
|
|
844
|
+
JSONObject routeStepWithCoordinateJSONObject = SitumMapper.routeStepToJsonObject(routeStepWithCoordinate);
|
|
845
|
+
JSONObject routeStep1 = routeStepCreator.getRouteStep1();
|
|
846
|
+
testRouteStep(routeStepWithCoordinateJSONObject, routeStep1);
|
|
847
|
+
RouteStep routeStepWithCoordinateAndBuildingId = routeStepCreator.createRouteStepWithCoordinateAndBuildingId();
|
|
848
|
+
JSONObject routeStepWithCoordinateAndBuildingIdJSONObject = SitumMapper.routeStepToJsonObject(routeStepWithCoordinateAndBuildingId);
|
|
849
|
+
JSONObject routeStep2 = routeStepCreator.getRouteStep2();
|
|
850
|
+
testRouteStep(routeStepWithCoordinateAndBuildingIdJSONObject, routeStep2);
|
|
851
|
+
RouteStep routeStepWithCoordinateBuildingIdAndFloor = routeStepCreator.createRouteStepWithCoordinateBuildingIdAndFloor();
|
|
852
|
+
JSONObject routeStepWithCoordinateBuildingIdAndFloorJSONObject = SitumMapper.routeStepToJsonObject(routeStepWithCoordinateBuildingIdAndFloor);
|
|
853
|
+
JSONObject routeStep3 = routeStepCreator.getRouteStep3();
|
|
854
|
+
testRouteStep(routeStepWithCoordinateBuildingIdAndFloorJSONObject, routeStep3);
|
|
855
|
+
RouteStep routeStepWithBuildingWithAngleFromDegree = routeStepCreator.createRouteStepWithBuildingWithAngleFromDegree();
|
|
856
|
+
JSONObject routeStepWithBuildingWithAngleFromDegreeJSONObject = SitumMapper.routeStepToJsonObject(routeStepWithBuildingWithAngleFromDegree);
|
|
857
|
+
JSONObject routeStep4 = routeStepCreator.getRouteStep4();
|
|
858
|
+
testRouteStep(routeStepWithBuildingWithAngleFromDegreeJSONObject, routeStep4);
|
|
859
|
+
RouteStep routeStepWithBuildingWithAngleFromRadians = routeStepCreator.createRouteStepWithBuildingWithAngleFromRadians();
|
|
860
|
+
JSONObject routeStepWithBuildingWithAngleFromRadiansJSONObject = SitumMapper.routeStepToJsonObject(routeStepWithBuildingWithAngleFromRadians);
|
|
861
|
+
JSONObject routeStep5 = routeStepCreator.getRouteStep5();
|
|
862
|
+
testRouteStep(routeStepWithBuildingWithAngleFromRadiansJSONObject, routeStep5);
|
|
863
|
+
}catch(JSONException e){
|
|
864
|
+
System.err.println(e.getMessage());
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
@Test
|
|
869
|
+
public void pointTest1() {
|
|
870
|
+
try{
|
|
871
|
+
JSONObject jo = pointCreator.getPoint1();
|
|
872
|
+
Point point = SitumMapper.jsonPointToPoint(jo);
|
|
873
|
+
Point point1 = pointCreator.createPointWithCoordinate();
|
|
874
|
+
testPoint(point, point1);
|
|
875
|
+
} catch (JSONException e) {
|
|
876
|
+
System.err.println(e.getMessage());
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
@Test
|
|
881
|
+
public void pointTest2() {
|
|
882
|
+
try{
|
|
883
|
+
JSONObject jo = pointCreator.getPoint2();
|
|
884
|
+
Point point = SitumMapper.jsonPointToPoint(jo);
|
|
885
|
+
Point point1 = pointCreator.createPointWithCoordinateAndBuildingId();
|
|
886
|
+
testPoint(point, point1);
|
|
887
|
+
} catch (JSONException e) {
|
|
888
|
+
System.err.println(e.getMessage());
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
@Test
|
|
893
|
+
public void pointTest3() {
|
|
894
|
+
try{
|
|
895
|
+
JSONObject jo = pointCreator.getPoint3();
|
|
896
|
+
Point point = SitumMapper.jsonPointToPoint(jo);
|
|
897
|
+
Point point1 = pointCreator.createPointWithBuildingIdAndFloor();
|
|
898
|
+
testPoint(point, point1);
|
|
899
|
+
} catch (JSONException e) {
|
|
900
|
+
System.err.println(e.getMessage());
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
@Test
|
|
905
|
+
public void pointTest4() {
|
|
906
|
+
try{
|
|
907
|
+
JSONObject jo = pointCreator.getPoint4();
|
|
908
|
+
Point point = SitumMapper.pointJsonObjectToPoint(jo, buildingCreator.getBuilding1());
|
|
909
|
+
Point point1 = pointCreator.createPointWithBuildingWithAngleFromDegrees();
|
|
910
|
+
testPoint(point, point1);
|
|
911
|
+
} catch (Exception e) {
|
|
912
|
+
System.err.println(e.getMessage());
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
@Test
|
|
917
|
+
public void pointTest5() {
|
|
918
|
+
try{
|
|
919
|
+
JSONObject jo = pointCreator.getPoint5();
|
|
920
|
+
Point point = SitumMapper.pointJsonObjectToPoint(jo, buildingCreator.getBuilding1());
|
|
921
|
+
Point point1 = pointCreator.createPointWithBuildingWithAngleFromRadians();
|
|
922
|
+
testPoint(point, point1);
|
|
923
|
+
} catch (Exception e) {
|
|
924
|
+
System.err.println(e.getMessage());
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
@Test
|
|
929
|
+
public void pointTest6() {
|
|
930
|
+
try{
|
|
931
|
+
JSONObject jo = pointCreator.getPoint6();
|
|
932
|
+
Point point = SitumMapper.jsonPointToPoint(jo);
|
|
933
|
+
Point point1 = pointCreator.createPointWithBuildingWithAddress();
|
|
934
|
+
testPoint(point, point1);
|
|
935
|
+
} catch (JSONException e) {
|
|
936
|
+
System.err.println(e.getMessage());
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
@Test
|
|
941
|
+
public void pointTest7() {
|
|
942
|
+
try{
|
|
943
|
+
JSONObject jo = pointCreator.getPoint7();
|
|
944
|
+
Point point = SitumMapper.jsonPointToPoint(jo);
|
|
945
|
+
Point point1 = pointCreator.createPointWithBuildingWithInfo();
|
|
946
|
+
testPoint(point, point1);
|
|
947
|
+
} catch (JSONException e) {
|
|
948
|
+
System.err.println(e.getMessage());
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
@Test
|
|
953
|
+
public void pointTest8() {
|
|
954
|
+
try{
|
|
955
|
+
JSONObject jo = pointCreator.getPoint8();
|
|
956
|
+
Point point = SitumMapper.jsonPointToPoint(jo);
|
|
957
|
+
Point point1 = pointCreator.createPointWithBuildingWithPicture();
|
|
958
|
+
testPoint(point, point1);
|
|
959
|
+
} catch (JSONException e) {
|
|
960
|
+
System.err.println(e.getMessage());
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
@Test
|
|
965
|
+
public void pointJSONObjectTest() {
|
|
966
|
+
try{
|
|
967
|
+
Point pointWithCoordinate = pointCreator.createPointWithCoordinate();
|
|
968
|
+
JSONObject pointWithCoordinateJSONObject = SitumMapper.pointToJsonObject(pointWithCoordinate);
|
|
969
|
+
JSONObject point1 = pointCreator.getPoint1();
|
|
970
|
+
testPoint(pointWithCoordinateJSONObject, point1);
|
|
971
|
+
Point pointWithCoordinateAndBuildingId = pointCreator.createPointWithCoordinateAndBuildingId();
|
|
972
|
+
JSONObject pointWithCoordinateAndBuildingIdJSONObject = SitumMapper.pointToJsonObject(pointWithCoordinateAndBuildingId);
|
|
973
|
+
JSONObject point2 = pointCreator.getPoint2();
|
|
974
|
+
testPoint(pointWithCoordinateAndBuildingIdJSONObject, point2);
|
|
975
|
+
Point pointWithBuildingIdAndFloor = pointCreator.createPointWithBuildingIdAndFloor();
|
|
976
|
+
JSONObject pointWithBuildingIdAndFloorJSONObject = SitumMapper.pointToJsonObject(pointWithBuildingIdAndFloor);
|
|
977
|
+
JSONObject point3 = pointCreator.getPoint3();
|
|
978
|
+
testPoint(pointWithBuildingIdAndFloorJSONObject, point3);
|
|
979
|
+
Point pointWithBuildingWithAngleFromDegrees = pointCreator.createPointWithBuildingWithAngleFromDegrees();
|
|
980
|
+
JSONObject pointWithBuildingWithAngleFromDegreesJSONObject = SitumMapper.pointToJsonObject(pointWithBuildingWithAngleFromDegrees);
|
|
981
|
+
JSONObject point4 = pointCreator.getPoint4();
|
|
982
|
+
testPoint(pointWithBuildingWithAngleFromDegreesJSONObject, point4);
|
|
983
|
+
Point pointWithBuildingWithAngleFromRadians = pointCreator.createPointWithBuildingWithAngleFromRadians();
|
|
984
|
+
JSONObject pointWithBuildingWithAngleFromRadiansJSONObject = SitumMapper.pointToJsonObject(pointWithBuildingWithAngleFromRadians);
|
|
985
|
+
JSONObject point5 = pointCreator.getPoint5();
|
|
986
|
+
testPoint(pointWithBuildingWithAngleFromRadiansJSONObject, point5);
|
|
987
|
+
Point pointWithBuildingWithAddress = pointCreator.createPointWithBuildingWithAddress();
|
|
988
|
+
JSONObject pointWithBuildingWithAddressJSONObject = SitumMapper.pointToJsonObject(pointWithBuildingWithAddress);
|
|
989
|
+
JSONObject point6 = pointCreator.getPoint6();
|
|
990
|
+
testPoint(pointWithBuildingWithAddressJSONObject, point6);
|
|
991
|
+
Point pointWithBuildingWithInfo = pointCreator.createPointWithBuildingWithInfo();
|
|
992
|
+
JSONObject pointWithBuildingWithInfoJSONObject = SitumMapper.pointToJsonObject(pointWithBuildingWithInfo);
|
|
993
|
+
JSONObject point7 = pointCreator.getPoint7();
|
|
994
|
+
testPoint(pointWithBuildingWithInfoJSONObject, point7);
|
|
995
|
+
Point pointWithBuildingWithPicture = pointCreator.createPointWithBuildingWithPicture();
|
|
996
|
+
JSONObject pointWithBuildingWithPictureJSONObject = SitumMapper.pointToJsonObject(pointWithBuildingWithPicture);
|
|
997
|
+
JSONObject point8 = pointCreator.getPoint8();
|
|
998
|
+
testPoint(pointWithBuildingWithPictureJSONObject, point8);
|
|
999
|
+
}catch(JSONException e){
|
|
1000
|
+
System.err.println(e.getMessage());
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
@Test
|
|
1005
|
+
public void routeJSONObjectTest(){
|
|
1006
|
+
try{
|
|
1007
|
+
Route route = routeCreator.createRouteBuildingWithDegreesPointWithCoordinates();
|
|
1008
|
+
JSONObject routeJSONObject = SitumMapper.routeToJsonObject(route);
|
|
1009
|
+
JSONObject route1 = routeCreator.getRoute1();
|
|
1010
|
+
testRoute(routeJSONObject, route1);
|
|
1011
|
+
}catch(JSONException e){
|
|
1012
|
+
System.err.println(e.getMessage());
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
@Test
|
|
1017
|
+
public void eventJSONObjectTest() throws JSONException {
|
|
1018
|
+
SitumEvent event = eventCreator.createEvent1();
|
|
1019
|
+
JSONObject jsonObject = SitumMapper.situmEventToJsonObject(event);
|
|
1020
|
+
JSONObject event1 = eventCreator.getEvent1();
|
|
1021
|
+
assertThat(jsonObject.toString()).isEqualTo(event1.toString());
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
private void testRoute(JSONObject route, JSONObject defaultRoute) throws JSONException {
|
|
1025
|
+
Assert.assertEquals(JSONObject.class, route.get(LAST_STEP).getClass());
|
|
1026
|
+
testRouteStep(route.getJSONObject(LAST_STEP), defaultRoute.getJSONObject(LAST_STEP));
|
|
1027
|
+
Assert.assertEquals(JSONObject.class, route.get(FIRST_STEP).getClass());
|
|
1028
|
+
testRouteStep(route.getJSONObject(FIRST_STEP), defaultRoute.getJSONObject(FIRST_STEP));
|
|
1029
|
+
Assert.assertEquals(JSONArray.class, route.get(INDICATIONS).getClass());
|
|
1030
|
+
JSONArray indications = route.getJSONArray(INDICATIONS);
|
|
1031
|
+
JSONArray defaultIndications = defaultRoute.getJSONArray(INDICATIONS);
|
|
1032
|
+
Assert.assertEquals(defaultIndications.length(), indications.length());
|
|
1033
|
+
for(int i = 0; i < indications.length(); i++) {
|
|
1034
|
+
testIndication(indications.getJSONObject(i), defaultIndications.getJSONObject(i));
|
|
1035
|
+
}
|
|
1036
|
+
Assert.assertEquals(JSONArray.class, route.get(NODES).getClass());
|
|
1037
|
+
JSONArray nodes = route.getJSONArray(NODES);
|
|
1038
|
+
JSONArray defaultNodes = defaultRoute.getJSONArray(NODES);
|
|
1039
|
+
Assert.assertEquals(defaultNodes.length(), nodes.length());
|
|
1040
|
+
for(int i = 0; i < nodes.length(); i++){
|
|
1041
|
+
testPoint(nodes.getJSONObject(i), defaultNodes.getJSONObject(i));
|
|
1042
|
+
}
|
|
1043
|
+
Assert.assertEquals(JSONArray.class, route.get(EDGES).getClass());
|
|
1044
|
+
JSONArray edges = route.getJSONArray(EDGES);
|
|
1045
|
+
JSONArray defaultEdges = defaultRoute.getJSONArray(EDGES);
|
|
1046
|
+
Assert.assertEquals(defaultEdges.length(), edges.length());
|
|
1047
|
+
for(int i = 0; i < edges.length(); i++) {
|
|
1048
|
+
testRouteStep(edges.getJSONObject(i), defaultEdges.getJSONObject(i));
|
|
1049
|
+
}
|
|
1050
|
+
Assert.assertEquals(JSONObject.class, route.get(FROM).getClass());
|
|
1051
|
+
testPoint(route.getJSONObject(FROM), defaultRoute.getJSONObject(FROM));
|
|
1052
|
+
Assert.assertEquals(JSONObject.class, route.get(TO).getClass());
|
|
1053
|
+
testPoint(route.getJSONObject(TO),defaultRoute.getJSONObject(TO));
|
|
1054
|
+
Assert.assertEquals(JSONArray.class, route.get(STEPS).getClass());
|
|
1055
|
+
JSONArray steps = route.getJSONArray(STEPS);
|
|
1056
|
+
JSONArray defaultSteps = defaultRoute.getJSONArray(STEPS);
|
|
1057
|
+
Assert.assertEquals(defaultSteps.length(), steps.length());
|
|
1058
|
+
for(int i = 0; i < steps.length(); i++) {
|
|
1059
|
+
testRouteStep(steps.getJSONObject(i), defaultSteps.getJSONObject(i));
|
|
1060
|
+
}
|
|
1061
|
+
Assert.assertEquals(JSONArray.class, route.get(POINTS).getClass());
|
|
1062
|
+
JSONArray points = route.getJSONArray(POINTS);
|
|
1063
|
+
JSONArray defaultPoints = defaultRoute.getJSONArray(POINTS);
|
|
1064
|
+
Assert.assertEquals(defaultPoints.length(), points.length());
|
|
1065
|
+
for(int i = 0; i < points.length(); i++) {
|
|
1066
|
+
testPoint(points.getJSONObject(i), defaultPoints.getJSONObject(i));
|
|
1067
|
+
}
|
|
1068
|
+
Assert.assertEquals(JSONArray.class, route.get(SEGMENTS).getClass());
|
|
1069
|
+
JSONArray segments = route.getJSONArray(SEGMENTS);
|
|
1070
|
+
JSONArray defaultSegments = defaultRoute.getJSONArray(SEGMENTS);
|
|
1071
|
+
Assert.assertEquals(segments.length(), defaultSegments.length());
|
|
1072
|
+
for(int i = 0; i < segments.length(); i++) {
|
|
1073
|
+
testSegment(segments.getJSONObject(i), defaultSegments.getJSONObject(i));
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
private void testAngle(Angle angle, Angle defaultAngle) {
|
|
1078
|
+
Assert.assertEquals(defaultAngle.degrees(), angle.degrees(),0.0000001);
|
|
1079
|
+
Assert.assertEquals(defaultAngle.degreesClockwise(), angle.degreesClockwise(),0.0000001);
|
|
1080
|
+
Assert.assertEquals(defaultAngle.radians(), angle.radians(),0.0000001);
|
|
1081
|
+
Assert.assertEquals(defaultAngle.radiansMinusPiPi(), angle.radiansMinusPiPi(),0.0000001);
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
private void testAngle(JSONObject angle, JSONObject defaultAngle) throws JSONException {
|
|
1085
|
+
Assert.assertEquals(Double.class, angle.get(RADIANS_MINUS_PI_PI).getClass());
|
|
1086
|
+
Assert.assertEquals(defaultAngle.getDouble(RADIANS_MINUS_PI_PI), angle.getDouble(RADIANS_MINUS_PI_PI), 0);
|
|
1087
|
+
Assert.assertEquals(Double.class, angle.get(RADIANS).getClass());
|
|
1088
|
+
Assert.assertEquals(defaultAngle.getDouble(RADIANS), angle.getDouble(RADIANS),0);
|
|
1089
|
+
Assert.assertEquals(Double.class, angle.get(DEGREES_CLOCKWISE).getClass());
|
|
1090
|
+
Assert.assertEquals(defaultAngle.getDouble(DEGREES_CLOCKWISE), angle.getDouble(DEGREES_CLOCKWISE), 0);
|
|
1091
|
+
Assert.assertEquals(Double.class, angle.get(DEGREES).getClass());
|
|
1092
|
+
Assert.assertEquals(defaultAngle.getDouble(DEGREES), angle.getDouble(DEGREES),0);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
private void testBounds(Bounds bounds, Bounds defaultBounds) {
|
|
1096
|
+
testCoordinate(defaultBounds.getNorthEast(), bounds.getNorthEast());
|
|
1097
|
+
testCoordinate(defaultBounds.getNorthWest(), bounds.getNorthWest());
|
|
1098
|
+
testCoordinate(defaultBounds.getSouthEast(), bounds.getSouthEast());
|
|
1099
|
+
testCoordinate(defaultBounds.getSouthWest(), bounds.getSouthWest());
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
private void testBounds(JSONObject bounds, JSONObject defaultBounds) throws JSONException {
|
|
1103
|
+
Assert.assertEquals(JSONObject.class, bounds.get(NORTH_WEST).getClass());
|
|
1104
|
+
testCoordinate(bounds.getJSONObject(NORTH_WEST), defaultBounds.getJSONObject(NORTH_WEST));
|
|
1105
|
+
Assert.assertEquals(JSONObject.class, bounds.get(SOUTH_WEST).getClass());
|
|
1106
|
+
testCoordinate(bounds.getJSONObject(SOUTH_WEST), defaultBounds.getJSONObject(SOUTH_WEST));
|
|
1107
|
+
Assert.assertEquals(JSONObject.class, bounds.get(NORTH_EAST).getClass());
|
|
1108
|
+
testCoordinate(bounds.getJSONObject(NORTH_EAST), defaultBounds.getJSONObject(NORTH_EAST));
|
|
1109
|
+
Assert.assertEquals(JSONObject.class, bounds.get(SOUTH_EAST).getClass());
|
|
1110
|
+
testCoordinate(bounds.getJSONObject(SOUTH_EAST), defaultBounds.getJSONObject(SOUTH_EAST));
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
private void testBuilding(Building building, Building defaultBuilding) {
|
|
1114
|
+
Assert.assertEquals(defaultBuilding.getAddress(), building.getAddress());
|
|
1115
|
+
testBounds(defaultBuilding.getBounds(), building.getBounds());
|
|
1116
|
+
testBounds(defaultBuilding.getBoundsRotated(), building.getBoundsRotated());
|
|
1117
|
+
testCoordinate(defaultBuilding.getCenter(), building.getCenter());
|
|
1118
|
+
testDimensions(defaultBuilding.getDimensions(), building.getDimensions());
|
|
1119
|
+
Assert.assertEquals(defaultBuilding.getInfoHtml(), building.getInfoHtml());
|
|
1120
|
+
Assert.assertEquals(defaultBuilding.getName(), building.getName());
|
|
1121
|
+
Assert.assertEquals(defaultBuilding.getPictureThumbUrl(), building.getPictureThumbUrl());
|
|
1122
|
+
Assert.assertEquals(defaultBuilding.getPictureUrl(), building.getPictureUrl());
|
|
1123
|
+
testAngle(defaultBuilding.getRotation(), building.getRotation());
|
|
1124
|
+
Assert.assertEquals(defaultBuilding.getUserIdentifier(), building.getUserIdentifier());
|
|
1125
|
+
Assert.assertEquals(defaultBuilding.getIdentifier(), building.getIdentifier());
|
|
1126
|
+
Assert.assertEquals(defaultBuilding.getCustomFields(), building.getCustomFields());
|
|
1127
|
+
Assert.assertEquals(defaultBuilding.getUpdatedAt(), building.getUpdatedAt());
|
|
1128
|
+
Assert.assertEquals(defaultBuilding.getCreatedAt(), building.getCreatedAt());
|
|
1129
|
+
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
private void testBuilding(JSONObject building, JSONObject defaultBuilding) throws JSONException {
|
|
1133
|
+
Assert.assertEquals(String.class, building.get(ADDRESS).getClass());
|
|
1134
|
+
Assert.assertEquals(defaultBuilding.getString(ADDRESS),building.getString(ADDRESS));
|
|
1135
|
+
Assert.assertEquals(JSONObject.class, building.get(BOUNDS).getClass());
|
|
1136
|
+
testBounds(building.getJSONObject(BOUNDS), defaultBuilding.getJSONObject(BOUNDS));
|
|
1137
|
+
Assert.assertEquals(JSONObject.class, building.get(BOUNDS_ROTATED).getClass());
|
|
1138
|
+
// testBounds(building.getJSONObject(BOUNDS_ROTATED), defaultBuilding.getJSONObject(BOUNDS_ROTATED));
|
|
1139
|
+
Assert.assertEquals(JSONObject.class, building.get(CENTER).getClass());
|
|
1140
|
+
testCoordinate(building.getJSONObject(CENTER),defaultBuilding.getJSONObject(CENTER));
|
|
1141
|
+
Assert.assertEquals(JSONObject.class, building.get(DIMENSIONS).getClass());
|
|
1142
|
+
testDimensions(building.getJSONObject(DIMENSIONS), defaultBuilding.getJSONObject(DIMENSIONS));
|
|
1143
|
+
Assert.assertEquals(String.class, building.get(INFO_HTML).getClass());
|
|
1144
|
+
Assert.assertEquals(defaultBuilding.getString(INFO_HTML),building.getString(INFO_HTML));
|
|
1145
|
+
Assert.assertEquals(String.class, building.get(NAME).getClass());
|
|
1146
|
+
Assert.assertEquals(defaultBuilding.getString(NAME),building.getString(NAME));
|
|
1147
|
+
Assert.assertEquals(String.class, building.get(PICTURE_THUMB_URL).getClass());
|
|
1148
|
+
Assert.assertEquals(defaultBuilding.getString(PICTURE_THUMB_URL),building.getString(PICTURE_THUMB_URL));
|
|
1149
|
+
Assert.assertEquals(String.class, building.get(PICTURE_URL).getClass());
|
|
1150
|
+
Assert.assertEquals(defaultBuilding.getString(PICTURE_URL),building.getString(PICTURE_URL));
|
|
1151
|
+
Assert.assertEquals(Double.class, building.get(ROTATION).getClass());
|
|
1152
|
+
Assert.assertEquals(defaultBuilding.getLong(ROTATION),building.getLong(ROTATION));
|
|
1153
|
+
Assert.assertEquals(String.class, building.get(USER_IDENTIFIER).getClass());
|
|
1154
|
+
Assert.assertEquals(defaultBuilding.getString(USER_IDENTIFIER),building.getString(USER_IDENTIFIER));
|
|
1155
|
+
Assert.assertEquals(String.class, building.get(BUILDING_IDENTIFIER).getClass());
|
|
1156
|
+
Assert.assertEquals(defaultBuilding.getString(BUILDING_IDENTIFIER),building.getString(BUILDING_IDENTIFIER));
|
|
1157
|
+
testCustomFields(defaultBuilding.getJSONObject(CUSTOM_FIELDS).toString(),building.getJSONObject(CUSTOM_FIELDS).toString());
|
|
1158
|
+
Assert.assertEquals(String.class, building.get(UPDATED_AT).getClass());
|
|
1159
|
+
Assert.assertEquals(dateFormat.parseObject(defaultBuilding.get(UPDATED_AT).toString(),new ParsePosition(0)),dateFormat.parseObject(building.get(UPDATED_AT).toString(),new ParsePosition(0)));
|
|
1160
|
+
Assert.assertEquals(String.class, building.get(CREATED_AT).getClass());
|
|
1161
|
+
Assert.assertEquals(dateFormat.parseObject(defaultBuilding.get(CREATED_AT).toString(),new ParsePosition(0)),dateFormat.parseObject(building.get(CREATED_AT).toString(),new ParsePosition(0)));
|
|
1162
|
+
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
private void testCartesianCoordinate(CartesianCoordinate cartesianCoordinate, CartesianCoordinate defaultCartesianCoordinate) {
|
|
1166
|
+
Assert.assertEquals(defaultCartesianCoordinate.getX(), cartesianCoordinate.getX(), 0);
|
|
1167
|
+
Assert.assertEquals(defaultCartesianCoordinate.getY(), cartesianCoordinate.getY(), 0);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
private void testCartesianCoordinate(JSONObject cartesianCoordinate, JSONObject defaultCartesianCoordinate) throws JSONException {
|
|
1171
|
+
Assert.assertEquals(Double.class, cartesianCoordinate.get(X).getClass());
|
|
1172
|
+
Assert.assertEquals(defaultCartesianCoordinate.getDouble(X), cartesianCoordinate.getDouble(X), 0);
|
|
1173
|
+
Assert.assertEquals(Double.class, cartesianCoordinate.get(Y).getClass());
|
|
1174
|
+
Assert.assertEquals(defaultCartesianCoordinate.getDouble(Y), cartesianCoordinate.getDouble(Y), 0);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
private void testCoordinate(Coordinate coordinate, Coordinate defaultCoordinate) {
|
|
1178
|
+
Assert.assertEquals(defaultCoordinate.getLongitude(), coordinate.getLongitude(), 0);
|
|
1179
|
+
Assert.assertEquals(defaultCoordinate.getLatitude(), coordinate.getLatitude(), 0);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
private void testCoordinate(JSONObject coordinate, JSONObject defaultCoordinate) throws JSONException {
|
|
1183
|
+
Assert.assertEquals(Double.class, coordinate.get(LATITUDE).getClass());
|
|
1184
|
+
Assert.assertEquals(defaultCoordinate.getDouble(LATITUDE), coordinate.getDouble(LATITUDE), 0);
|
|
1185
|
+
Assert.assertEquals(Double.class, coordinate.get(LONGITUDE).getClass());
|
|
1186
|
+
Assert.assertEquals(defaultCoordinate.getDouble(LONGITUDE), coordinate.getDouble(LONGITUDE), 0);
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
private void testCustomFields(String customFields,String defaultCustomFields) {
|
|
1190
|
+
Assert.assertEquals(customFields,defaultCustomFields);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
private void testDimensions(Dimensions dimensions, Dimensions defaultDimensions) {
|
|
1194
|
+
Assert.assertEquals(defaultDimensions.getHeight(), dimensions.getHeight(), 0);
|
|
1195
|
+
Assert.assertEquals(defaultDimensions.getWidth(), dimensions.getWidth(),0);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
private void testDimensions(JSONObject dimensions, JSONObject defaultDimensions) throws JSONException {
|
|
1199
|
+
Assert.assertEquals(Double.class, dimensions.get(WIDTH).getClass());
|
|
1200
|
+
Assert.assertEquals(defaultDimensions.getDouble(WIDTH), dimensions.getDouble(WIDTH), 0);
|
|
1201
|
+
Assert.assertEquals(Double.class, dimensions.get(HEIGHT).getClass());
|
|
1202
|
+
Assert.assertEquals(defaultDimensions.getDouble(HEIGHT), dimensions.getDouble(HEIGHT), 0);
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
private void testDirectionsRequest(DirectionsRequest directionsRequest, DirectionsRequest defaultDirectionsRequest) {
|
|
1206
|
+
Assert.assertEquals(defaultDirectionsRequest.getAccessibilityMode(), directionsRequest.getAccessibilityMode());
|
|
1207
|
+
Assert.assertEquals(defaultDirectionsRequest.minimizeFloorChanges(), directionsRequest.minimizeFloorChanges());
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
private void testLocationRequest(LocationRequest locationRequest, LocationRequest defaultLocationRequest) {
|
|
1211
|
+
Assert.assertEquals(locationRequest.getBuildingIdentifier(), defaultLocationRequest.getBuildingIdentifier());
|
|
1212
|
+
Assert.assertEquals(locationRequest.getSmallestDisplacement(), defaultLocationRequest.getSmallestDisplacement());
|
|
1213
|
+
Assert.assertEquals(locationRequest.getInterval(), defaultLocationRequest.getInterval());
|
|
1214
|
+
Assert.assertEquals(locationRequest.autoEnableBleDuringPositioning(), defaultLocationRequest.autoEnableBleDuringPositioning());
|
|
1215
|
+
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
private void testFloor(Floor floor, Floor defaultFloor) {
|
|
1219
|
+
Assert.assertEquals(defaultFloor.getAltitude(), floor.getAltitude(), 0);
|
|
1220
|
+
Assert.assertEquals(defaultFloor.getCreatedAt(), floor.getCreatedAt());
|
|
1221
|
+
Assert.assertEquals(defaultFloor.getIdentifier(), floor.getIdentifier());
|
|
1222
|
+
Assert.assertEquals(defaultFloor.getLevel(), floor.getLevel());
|
|
1223
|
+
Assert.assertEquals(defaultFloor.getCustomFields(), floor.getCustomFields());
|
|
1224
|
+
Assert.assertEquals(defaultFloor.getMapUrl(), floor.getMapUrl());
|
|
1225
|
+
Assert.assertEquals(defaultFloor.getScale(), floor.getScale(), 0);
|
|
1226
|
+
Assert.assertEquals(defaultFloor.getBuildingIdentifier(), floor.getBuildingIdentifier());
|
|
1227
|
+
Assert.assertEquals(defaultFloor.getUpdatedAt(), floor.getUpdatedAt());
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
private void testFloor(JSONObject floor, JSONObject defaultFloor) throws JSONException {
|
|
1231
|
+
Assert.assertEquals(Double.class, floor.get(ALTITUDE).getClass());
|
|
1232
|
+
Assert.assertEquals(defaultFloor.getDouble(ALTITUDE), floor.getDouble(ALTITUDE), 0);
|
|
1233
|
+
Assert.assertEquals(String.class, floor.get(CREATED_AT).getClass());
|
|
1234
|
+
Assert.assertEquals(defaultFloor.getString(CREATED_AT), floor.getString(CREATED_AT));
|
|
1235
|
+
Assert.assertEquals(String.class, floor.get(FLOOR_IDENTIFIER).getClass());
|
|
1236
|
+
Assert.assertEquals(defaultFloor.getString(FLOOR_IDENTIFIER), floor.getString(FLOOR_IDENTIFIER));
|
|
1237
|
+
Assert.assertEquals(Integer.class, floor.get(LEVEL).getClass());
|
|
1238
|
+
Assert.assertEquals(defaultFloor.getInt(LEVEL), floor.getInt(LEVEL));
|
|
1239
|
+
Assert.assertEquals(JSONObject.class, floor.get(CUSTOM_FIELDS).getClass());
|
|
1240
|
+
Assert.assertEquals(defaultFloor.getJSONObject(CUSTOM_FIELDS).toString(), floor.getJSONObject(CUSTOM_FIELDS).toString());
|
|
1241
|
+
Assert.assertEquals(String.class, floor.get(MAP_URL).getClass());
|
|
1242
|
+
Assert.assertEquals(defaultFloor.getString(MAP_URL), floor.getString(MAP_URL));
|
|
1243
|
+
Assert.assertEquals(Double.class, floor.get(SCALE).getClass());
|
|
1244
|
+
Assert.assertEquals(defaultFloor.getDouble(SCALE), floor.getDouble(SCALE), 0);
|
|
1245
|
+
Assert.assertEquals(String.class, floor.get(BUILDING_IDENTIFIER).getClass());
|
|
1246
|
+
Assert.assertEquals(defaultFloor.getString(BUILDING_IDENTIFIER), floor.getString(BUILDING_IDENTIFIER));
|
|
1247
|
+
Assert.assertEquals(String.class, floor.get(UPDATED_AT).getClass());
|
|
1248
|
+
Assert.assertEquals(defaultFloor.getString(UPDATED_AT), floor.getString(UPDATED_AT));
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
private void testIndication(JSONObject indication, JSONObject defaultIndication) throws JSONException {
|
|
1252
|
+
Assert.assertEquals(Indication.Orientation.class, indication.get(ORIENTATION_TYPE).getClass());
|
|
1253
|
+
Assert.assertEquals(Indication.Orientation.valueOf(defaultIndication.get(ORIENTATION_TYPE).toString()), indication.get(ORIENTATION_TYPE));
|
|
1254
|
+
Assert.assertEquals(Double.class, indication.get(ORIENTATION).getClass());
|
|
1255
|
+
Assert.assertEquals(defaultIndication.getDouble(ORIENTATION), indication.getDouble(ORIENTATION), 0);
|
|
1256
|
+
Assert.assertEquals(Integer.class, indication.get(STEP_IDX_DESTINTATION).getClass());
|
|
1257
|
+
Assert.assertEquals(defaultIndication.getInt(STEP_IDX_DESTINTATION), indication.getInt(STEP_IDX_DESTINTATION));
|
|
1258
|
+
Assert.assertEquals(Double.class, indication.get(DISTANCE).getClass());
|
|
1259
|
+
Assert.assertEquals(defaultIndication.getDouble(DISTANCE), indication.getDouble(DISTANCE), 0);
|
|
1260
|
+
Assert.assertEquals(Integer.class, indication.get(STEP_IDX_ORIGIN).getClass());
|
|
1261
|
+
Assert.assertEquals(defaultIndication.getInt(STEP_IDX_ORIGIN), indication.getInt(STEP_IDX_ORIGIN));
|
|
1262
|
+
Assert.assertEquals(String.class, indication.get(INDICATION_TYPE).getClass());
|
|
1263
|
+
Assert.assertEquals(defaultIndication.getString(INDICATION_TYPE), indication.getString(INDICATION_TYPE));
|
|
1264
|
+
Assert.assertEquals(Integer.class, indication.get(DISTANCE_TO_NEXT_LEVEL).getClass());
|
|
1265
|
+
Assert.assertEquals(defaultIndication.getInt(DISTANCE_TO_NEXT_LEVEL), indication.getInt(DISTANCE_TO_NEXT_LEVEL));
|
|
1266
|
+
Assert.assertEquals(Boolean.class, indication.get(NEEDED_LEVEL_CHANGE).getClass());
|
|
1267
|
+
Assert.assertEquals(defaultIndication.getBoolean(NEEDED_LEVEL_CHANGE), indication.getBoolean(NEEDED_LEVEL_CHANGE));
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
private void testLocation(Location location,Location defaultLocation) {
|
|
1271
|
+
Assert.assertEquals(defaultLocation.hasCartesianBearing(), location.hasCartesianBearing());
|
|
1272
|
+
testCoordinate(defaultLocation.getCoordinate(), location.getCoordinate());
|
|
1273
|
+
testAngle(defaultLocation.getBearing(), location.getBearing());
|
|
1274
|
+
Assert.assertEquals(defaultLocation.getAccuracy(), location.getAccuracy(), 0);
|
|
1275
|
+
Assert.assertEquals(defaultLocation.isIndoor(), location.isIndoor());
|
|
1276
|
+
Assert.assertEquals(defaultLocation.getDeviceId(), location.getDeviceId());
|
|
1277
|
+
Assert.assertEquals(defaultLocation.getBuildingIdentifier(), location.getBuildingIdentifier());
|
|
1278
|
+
Assert.assertEquals(defaultLocation.getQuality(), location.getQuality());
|
|
1279
|
+
Assert.assertEquals(defaultLocation.isOutdoor(), location.isOutdoor());
|
|
1280
|
+
Assert.assertEquals(defaultLocation.getFloorIdentifier(), location.getFloorIdentifier());
|
|
1281
|
+
Assert.assertEquals(defaultLocation.getProvider(), location.getProvider());
|
|
1282
|
+
testAngle(defaultLocation.getCartesianBearing(), location.getCartesianBearing());
|
|
1283
|
+
Assert.assertEquals(defaultLocation.getBearingQuality(), location.getBearingQuality());
|
|
1284
|
+
Assert.assertEquals(defaultLocation.hasBearing(), location.hasBearing());
|
|
1285
|
+
testCartesianCoordinate(defaultLocation.getCartesianCoordinate(), location.getCartesianCoordinate());
|
|
1286
|
+
testPoint(defaultLocation.getPosition(), location.getPosition());
|
|
1287
|
+
Assert.assertEquals(defaultLocation.getTime(), location.getTime());
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
private void testLocation(JSONObject location, JSONObject defaultLocation) throws JSONException {
|
|
1291
|
+
Assert.assertEquals(Boolean.class, location.get(HAS_CARTESIAN_BEARING).getClass());
|
|
1292
|
+
Assert.assertEquals(defaultLocation.getBoolean(HAS_CARTESIAN_BEARING), location.getBoolean(HAS_CARTESIAN_BEARING));
|
|
1293
|
+
Assert.assertEquals(JSONObject.class, location.get(COORDINATE).getClass());
|
|
1294
|
+
testCoordinate(location.getJSONObject(COORDINATE), defaultLocation.getJSONObject(COORDINATE));
|
|
1295
|
+
Assert.assertEquals(JSONObject.class, location.get(BEARING).getClass());
|
|
1296
|
+
testAngle(location.getJSONObject(BEARING), defaultLocation.getJSONObject(BEARING));
|
|
1297
|
+
Assert.assertEquals(Double.class, location.get(ACCURACY).getClass());
|
|
1298
|
+
Assert.assertEquals(defaultLocation.getDouble(ACCURACY), location.getDouble(ACCURACY), 0);
|
|
1299
|
+
Assert.assertEquals(Boolean.class, location.get(IS_INDOOR).getClass());
|
|
1300
|
+
Assert.assertEquals(defaultLocation.getBoolean(IS_INDOOR), location.getBoolean(IS_INDOOR));
|
|
1301
|
+
Assert.assertEquals(String.class, location.get(DEVICE_ID).getClass());
|
|
1302
|
+
Assert.assertEquals(defaultLocation.getString(DEVICE_ID), location.getString(DEVICE_ID));
|
|
1303
|
+
Assert.assertEquals(String.class, location.get(BUILDING_IDENTIFIER).getClass());
|
|
1304
|
+
Assert.assertEquals(defaultLocation.getString(BUILDING_IDENTIFIER), location.getString(BUILDING_IDENTIFIER));
|
|
1305
|
+
Assert.assertEquals(String.class, location.get(QUALITY).getClass());
|
|
1306
|
+
Assert.assertEquals(defaultLocation.getString(QUALITY), location.getString(QUALITY));
|
|
1307
|
+
Assert.assertEquals(Boolean.class, location.get(IS_OUTDOOR).getClass());
|
|
1308
|
+
Assert.assertEquals(defaultLocation.getBoolean(IS_OUTDOOR), location.getBoolean(IS_OUTDOOR));
|
|
1309
|
+
Assert.assertEquals(String.class, location.get(FLOOR_IDENTIFIER).getClass());
|
|
1310
|
+
Assert.assertEquals(defaultLocation.getString(FLOOR_IDENTIFIER), location.getString(FLOOR_IDENTIFIER));
|
|
1311
|
+
Assert.assertEquals(String.class, location.get(PROVIDER).getClass());
|
|
1312
|
+
Assert.assertEquals(defaultLocation.getString(PROVIDER), location.getString(PROVIDER));
|
|
1313
|
+
Assert.assertEquals(JSONObject.class, location.get(CARTESIAN_BEARING).getClass());
|
|
1314
|
+
testAngle(location.getJSONObject(CARTESIAN_BEARING), defaultLocation.getJSONObject(CARTESIAN_BEARING));
|
|
1315
|
+
Assert.assertEquals(String.class, location.get(BEARING_QUALITY).getClass());
|
|
1316
|
+
Assert.assertEquals(defaultLocation.getString(BEARING_QUALITY), location.getString(BEARING_QUALITY));
|
|
1317
|
+
Assert.assertEquals(Boolean.class, location.get(HAS_BEARING).getClass());
|
|
1318
|
+
Assert.assertEquals(defaultLocation.getBoolean(HAS_BEARING), location.getBoolean(HAS_BEARING));
|
|
1319
|
+
Assert.assertEquals(JSONObject.class, location.get(CARTESIAN_COORDINATE).getClass());
|
|
1320
|
+
testCartesianCoordinate(location.getJSONObject(CARTESIAN_COORDINATE), location.getJSONObject(CARTESIAN_COORDINATE));
|
|
1321
|
+
Assert.assertEquals(JSONObject.class, location.get(POSITION).getClass());
|
|
1322
|
+
testPoint(location.getJSONObject(POSITION), defaultLocation.getJSONObject(POSITION));
|
|
1323
|
+
Assert.assertEquals(Long.class, location.get(TIMESTAMP).getClass());
|
|
1324
|
+
Assert.assertEquals(defaultLocation.getLong(TIMESTAMP), location.getLong(TIMESTAMP));
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
private void testPoint(Point point, Point defaultPoint) {
|
|
1328
|
+
testCoordinate(defaultPoint.getCoordinate(), point.getCoordinate());
|
|
1329
|
+
testCartesianCoordinate(defaultPoint.getCartesianCoordinate(), point.getCartesianCoordinate());
|
|
1330
|
+
Assert.assertEquals(defaultPoint.getFloorIdentifier(), point.getFloorIdentifier());
|
|
1331
|
+
Assert.assertEquals(defaultPoint.getBuildingIdentifier(), point.getBuildingIdentifier());
|
|
1332
|
+
Assert.assertEquals(defaultPoint.isIndoor(), point.isIndoor());
|
|
1333
|
+
Assert.assertEquals(defaultPoint.isOutdoor(), point.isOutdoor());
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
private void testQuality(Location.Quality quality, Location.Quality defaultQuality) {
|
|
1337
|
+
Assert.assertEquals(defaultQuality, quality);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
private void testPoint(JSONObject point, JSONObject defaultPoint) throws JSONException {
|
|
1341
|
+
Assert.assertEquals(JSONObject.class, point.get(COORDINATE).getClass());
|
|
1342
|
+
testCoordinate(point.getJSONObject(COORDINATE), defaultPoint.getJSONObject(COORDINATE));
|
|
1343
|
+
Assert.assertEquals(String.class, point.get(FLOOR_IDENTIFIER).getClass());
|
|
1344
|
+
Assert.assertEquals(defaultPoint.getString(FLOOR_IDENTIFIER), point.getString(FLOOR_IDENTIFIER));
|
|
1345
|
+
Assert.assertEquals(JSONObject.class, point.get(CARTESIAN_COORDINATE).getClass());
|
|
1346
|
+
testCartesianCoordinate(point.getJSONObject(CARTESIAN_COORDINATE), defaultPoint.getJSONObject(CARTESIAN_COORDINATE));
|
|
1347
|
+
Assert.assertEquals(Boolean.class, point.get(IS_INDOOR).getClass());
|
|
1348
|
+
Assert.assertEquals(defaultPoint.getBoolean(IS_INDOOR), point.getBoolean(IS_INDOOR));
|
|
1349
|
+
Assert.assertEquals(String.class, point.get(BUILDING_IDENTIFIER).getClass());
|
|
1350
|
+
Assert.assertEquals(defaultPoint.getString(BUILDING_IDENTIFIER), point.getString(BUILDING_IDENTIFIER));
|
|
1351
|
+
Assert.assertEquals(Boolean.class, point.get(IS_OUTDOOR).getClass());
|
|
1352
|
+
Assert.assertEquals(defaultPoint.getBoolean(IS_OUTDOOR), point.getBoolean(IS_OUTDOOR));
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
private void testSegment(JSONObject segment, JSONObject defaultSegment) throws JSONException {
|
|
1356
|
+
Assert.assertEquals(String.class, segment.get(FLOOR_IDENTIFIER).getClass());
|
|
1357
|
+
Assert.assertEquals(segment.getString(FLOOR_IDENTIFIER), defaultSegment.getString(FLOOR_IDENTIFIER));
|
|
1358
|
+
Assert.assertEquals(JSONArray.class, segment.get(POINTS).getClass());
|
|
1359
|
+
JSONArray points = segment.getJSONArray(POINTS);
|
|
1360
|
+
JSONArray defaultPoints = defaultSegment.getJSONArray(POINTS);
|
|
1361
|
+
Assert.assertEquals(points.length(), defaultPoints.length());
|
|
1362
|
+
for(int i = 0; i < points.length(); i++) {
|
|
1363
|
+
testPoint(points.getJSONObject(i), defaultPoints.getJSONObject(i));
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
private void testLocationStatus(JSONObject locationStatus, JSONObject defaultLocationStatus) throws JSONException{
|
|
1368
|
+
Assert.assertEquals(Integer.class, locationStatus.get(STATUS_ORDINAL).getClass());
|
|
1369
|
+
Assert.assertEquals(defaultLocationStatus.getInt(STATUS_ORDINAL), locationStatus.getInt(STATUS_ORDINAL));
|
|
1370
|
+
Assert.assertEquals(String.class, locationStatus.get(STATUS_NAME).getClass());
|
|
1371
|
+
Assert.assertEquals(defaultLocationStatus.getString(STATUS_NAME), locationStatus.getString(STATUS_NAME));
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
private void testPoi(JSONObject poi, JSONObject defaultPoi) throws JSONException {
|
|
1375
|
+
Assert.assertEquals(String.class, poi.get(IDENTIFIER).getClass());
|
|
1376
|
+
Assert.assertEquals(defaultPoi.getString(IDENTIFIER),poi.getString(IDENTIFIER));
|
|
1377
|
+
testCoordinate(poi.getJSONObject(COORDINATE),defaultPoi.getJSONObject(COORDINATE));
|
|
1378
|
+
Assert.assertEquals(String.class, poi.get(POI_NAME).getClass());
|
|
1379
|
+
Assert.assertEquals(defaultPoi.getString(POI_NAME),poi.getString(POI_NAME));
|
|
1380
|
+
testCustomFields(defaultPoi.getJSONObject(CUSTOM_FIELDS).toString(),poi.getJSONObject(CUSTOM_FIELDS).toString());
|
|
1381
|
+
Assert.assertEquals(Boolean.class, poi.get(IS_INDOOR).getClass());
|
|
1382
|
+
Assert.assertEquals(defaultPoi.getBoolean(IS_INDOOR),poi.getBoolean(IS_INDOOR));
|
|
1383
|
+
Assert.assertEquals(String.class, poi.get(INFO_HTML).getClass());
|
|
1384
|
+
Assert.assertEquals(defaultPoi.getString(INFO_HTML),poi.getString(INFO_HTML));
|
|
1385
|
+
Assert.assertEquals(String.class, poi.get(BUILDING_IDENTIFIER).getClass());
|
|
1386
|
+
Assert.assertEquals(defaultPoi.getString(BUILDING_IDENTIFIER),poi.getString(BUILDING_IDENTIFIER));
|
|
1387
|
+
Assert.assertEquals(Boolean.class, poi.get(IS_OUTDOOR).getClass());
|
|
1388
|
+
Assert.assertEquals(defaultPoi.getBoolean(IS_OUTDOOR),poi.getBoolean(IS_OUTDOOR));
|
|
1389
|
+
Assert.assertEquals(String.class, poi.get(CREATED_AT).getClass());
|
|
1390
|
+
Assert.assertEquals(defaultPoi.getString(CREATED_AT), poi.getString(CREATED_AT));
|
|
1391
|
+
Assert.assertEquals(String.class, poi.get(FLOOR_IDENTIFIER).getClass());
|
|
1392
|
+
Assert.assertEquals(defaultPoi.getString(FLOOR_IDENTIFIER),poi.getString(FLOOR_IDENTIFIER));
|
|
1393
|
+
testCartesianCoordinate(poi.getJSONObject(CARTESIAN_COORDINATE),defaultPoi.getJSONObject(CARTESIAN_COORDINATE));
|
|
1394
|
+
testPoint(poi.getJSONObject(POSITION), poi.getJSONObject(POSITION));
|
|
1395
|
+
Assert.assertEquals(String.class, poi.get(CATEGORY).getClass());
|
|
1396
|
+
Assert.assertEquals(defaultPoi.getString(CATEGORY),poi.getString(CATEGORY));
|
|
1397
|
+
Assert.assertEquals(String.class, poi.get(UPDATED_AT).getClass());
|
|
1398
|
+
Assert.assertEquals(defaultPoi.getString(UPDATED_AT), poi.getString(UPDATED_AT));
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
private void testPoiCategory(PoiCategory poiCategory, PoiCategory defaultPoiCategory) {
|
|
1402
|
+
Assert.assertEquals(defaultPoiCategory.getSelectedIconUrl(), poiCategory.getSelectedIconUrl());
|
|
1403
|
+
Assert.assertEquals(defaultPoiCategory.isPublic(), poiCategory.isPublic());
|
|
1404
|
+
Assert.assertEquals(defaultPoiCategory.getName(), poiCategory.getName());
|
|
1405
|
+
Assert.assertEquals(defaultPoiCategory.getCode(), poiCategory.getCode());
|
|
1406
|
+
Assert.assertEquals(defaultPoiCategory.getUnselectedIconUrl(), poiCategory.getUnselectedIconUrl());
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
private void testPoiCategory(JSONObject poiCategory, JSONObject defaultPoiCategory) throws JSONException {
|
|
1410
|
+
Assert.assertEquals(String.class, poiCategory.get(ICON_SELECTED).getClass());
|
|
1411
|
+
Assert.assertEquals(defaultPoiCategory.getString(ICON_SELECTED), poiCategory.getString(ICON_SELECTED));
|
|
1412
|
+
Assert.assertEquals(Boolean.class, poiCategory.get(PUBLIC).getClass());
|
|
1413
|
+
Assert.assertEquals(defaultPoiCategory.getBoolean(PUBLIC), poiCategory.getBoolean(PUBLIC));
|
|
1414
|
+
Assert.assertEquals(String.class, poiCategory.get(POI_CATEGORY_NAME).getClass());
|
|
1415
|
+
Assert.assertEquals(defaultPoiCategory.getString(POI_CATEGORY_NAME), poiCategory.getString(POI_CATEGORY_NAME));
|
|
1416
|
+
Assert.assertEquals(String.class, poiCategory.get(POI_CATEGORY_CODE).getClass());
|
|
1417
|
+
Assert.assertEquals(defaultPoiCategory.getString(POI_CATEGORY_CODE), poiCategory.getString(POI_CATEGORY_CODE));
|
|
1418
|
+
Assert.assertEquals(String.class, poiCategory.get(ICON_UNSELECTED).getClass());
|
|
1419
|
+
Assert.assertEquals(defaultPoiCategory.getString(ICON_UNSELECTED), poiCategory.getString(ICON_UNSELECTED));
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
private void testPoiCategoryIcon(JSONObject poiCategoryIcon, JSONObject defaultPoiCategoryIcon) throws JSONException {
|
|
1423
|
+
Assert.assertEquals(String.class, poiCategoryIcon.get("data").getClass());
|
|
1424
|
+
Assert.assertEquals(defaultPoiCategoryIcon.getString("data"), poiCategoryIcon.getString("data"));
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
private void testSitumConversionArea(JSONObject situmConversionArea, JSONObject defaultSitumConversionArea) throws JSONException {
|
|
1428
|
+
Assert.assertEquals(JSONObject.class, situmConversionArea.get(BOTTOM_LEFT).getClass());
|
|
1429
|
+
Assert.assertEquals(defaultSitumConversionArea.get(BOTTOM_LEFT).toString(), situmConversionArea.get(BOTTOM_LEFT).toString());
|
|
1430
|
+
Assert.assertEquals(Integer.class, situmConversionArea.get(FLOOR_IDENTIFIER).getClass());
|
|
1431
|
+
Assert.assertEquals(defaultSitumConversionArea.getInt(FLOOR_IDENTIFIER), situmConversionArea.getInt(FLOOR_IDENTIFIER));
|
|
1432
|
+
Assert.assertEquals(JSONObject.class, situmConversionArea.get(BOTTOM_RIGHT).getClass());
|
|
1433
|
+
Assert.assertEquals(defaultSitumConversionArea.get(BOTTOM_RIGHT).toString(), situmConversionArea.get(BOTTOM_RIGHT).toString());
|
|
1434
|
+
Assert.assertEquals(JSONObject.class, situmConversionArea.get(TOP_LEFT).getClass());
|
|
1435
|
+
Assert.assertEquals(defaultSitumConversionArea.get(TOP_LEFT).toString(), situmConversionArea.get(TOP_LEFT).toString());
|
|
1436
|
+
Assert.assertEquals(JSONObject.class, situmConversionArea.get(TOP_RIGHT).getClass());
|
|
1437
|
+
Assert.assertEquals(defaultSitumConversionArea.get(TOP_RIGHT).toString(), situmConversionArea.get(TOP_RIGHT).toString());
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
private void testCircle(JSONObject circle, JSONObject defaultCircle) throws JSONException {
|
|
1441
|
+
testPoint(circle.getJSONObject(CENTER), defaultCircle.getJSONObject(CENTER));
|
|
1442
|
+
Assert.assertEquals(Float.class, circle.get(RADIUS).getClass());
|
|
1443
|
+
Truth.assertThat(defaultCircle.getDouble(RADIUS)).isWithin(0.00001).of(circle.getDouble(RADIUS));
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
private void testNavigationProgress(JSONObject navigationProgress, JSONObject defaultNavigationProgress) throws JSONException {
|
|
1447
|
+
Assert.assertEquals(JSONObject.class, navigationProgress.get(CURRENT_INDICATION).getClass());
|
|
1448
|
+
testIndication(navigationProgress.getJSONObject(CURRENT_INDICATION), defaultNavigationProgress.getJSONObject(CURRENT_INDICATION));
|
|
1449
|
+
Assert.assertEquals(JSONObject.class, navigationProgress.get(NEXT_INDICATION).getClass());
|
|
1450
|
+
testIndication(navigationProgress.getJSONObject(NEXT_INDICATION), defaultNavigationProgress.getJSONObject(NEXT_INDICATION));
|
|
1451
|
+
Assert.assertEquals(Double.class, navigationProgress.get(DISTANCE_TO_END_STEP).getClass());
|
|
1452
|
+
Assert.assertEquals(defaultNavigationProgress.getDouble(DISTANCE_TO_END_STEP), navigationProgress.getDouble(DISTANCE_TO_END_STEP), 0);
|
|
1453
|
+
Assert.assertEquals(JSONObject.class, navigationProgress.get(CLOSEST_POINT_IN_ROUTE).getClass());
|
|
1454
|
+
testPoint(navigationProgress.getJSONObject(CLOSEST_POINT_IN_ROUTE), defaultNavigationProgress.getJSONObject(CLOSEST_POINT_IN_ROUTE));
|
|
1455
|
+
Assert.assertEquals(Double.class, navigationProgress.get(DISTANCE_TO_CLOSEST_POINT_IN_ROUTE).getClass());
|
|
1456
|
+
Assert.assertEquals(defaultNavigationProgress.getDouble(DISTANCE_TO_CLOSEST_POINT_IN_ROUTE), navigationProgress.getDouble(DISTANCE_TO_CLOSEST_POINT_IN_ROUTE), 0);
|
|
1457
|
+
Assert.assertEquals(Double.class, navigationProgress.get(TIME_TO_END_STEP).getClass());
|
|
1458
|
+
Assert.assertEquals(defaultNavigationProgress.getDouble(TIME_TO_END_STEP), navigationProgress.getDouble(TIME_TO_END_STEP), 0);
|
|
1459
|
+
Assert.assertEquals(JSONObject.class, navigationProgress.get(ROUTE_STEP).getClass());
|
|
1460
|
+
testRouteStep(navigationProgress.getJSONObject(ROUTE_STEP), defaultNavigationProgress.getJSONObject(ROUTE_STEP));
|
|
1461
|
+
Assert.assertEquals(Double.class, navigationProgress.get(TIME_TO_GOAL).getClass());
|
|
1462
|
+
Assert.assertEquals(defaultNavigationProgress.getDouble(TIME_TO_GOAL), navigationProgress.getDouble(TIME_TO_GOAL), 0);
|
|
1463
|
+
Assert.assertEquals(Integer.class, navigationProgress.get(CURRENT_STEP_INDEX).getClass());
|
|
1464
|
+
Assert.assertEquals(defaultNavigationProgress.getInt(CURRENT_STEP_INDEX), navigationProgress.getInt(CURRENT_STEP_INDEX));
|
|
1465
|
+
Assert.assertEquals(Double.class, navigationProgress.get(DISTANCE_TO_GOAL).getClass());
|
|
1466
|
+
Assert.assertEquals(defaultNavigationProgress.getDouble(DISTANCE_TO_GOAL), navigationProgress.getDouble(DISTANCE_TO_GOAL), 0);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
private void testRouteStep(JSONObject routeStep, JSONObject defaultRouteStep) throws JSONException {
|
|
1470
|
+
Assert.assertEquals(Boolean.class, routeStep.get(IS_FIRST).getClass());
|
|
1471
|
+
Assert.assertEquals(defaultRouteStep.getBoolean(IS_FIRST), routeStep.getBoolean(IS_FIRST));
|
|
1472
|
+
Assert.assertEquals(Double.class, routeStep.get(DISTANCE).getClass());
|
|
1473
|
+
Assert.assertEquals(defaultRouteStep.getDouble(DISTANCE), routeStep.getDouble(DISTANCE), 0);
|
|
1474
|
+
Assert.assertEquals(Boolean.class, routeStep.get(IS_LAST).getClass());
|
|
1475
|
+
Assert.assertEquals(defaultRouteStep.getBoolean(IS_LAST), routeStep.getBoolean(IS_LAST));
|
|
1476
|
+
Assert.assertEquals(Double.class, routeStep.get(DISTANCE_TO_GOAL).getClass());
|
|
1477
|
+
Assert.assertEquals(defaultRouteStep.getDouble(DISTANCE_TO_GOAL), routeStep.getDouble(DISTANCE_TO_GOAL), 0);
|
|
1478
|
+
Assert.assertEquals(JSONObject.class, routeStep.get(FROM).getClass());
|
|
1479
|
+
testPoint(routeStep.getJSONObject(FROM), defaultRouteStep.getJSONObject(FROM));
|
|
1480
|
+
Assert.assertEquals(Integer.class, routeStep.get(ID).getClass());
|
|
1481
|
+
Assert.assertEquals(defaultRouteStep.getInt(ID), routeStep.getInt(ID));
|
|
1482
|
+
Assert.assertEquals(JSONObject.class, routeStep.get(TO).getClass());
|
|
1483
|
+
testPoint(routeStep.getJSONObject(TO), defaultRouteStep.getJSONObject(TO));
|
|
1484
|
+
}
|
|
1485
|
+
}
|