Closed Bug 1019793 Opened 10 years ago Closed 10 years ago

java.lang.UnsupportedOperationException in TestHealthReportPruneService

Categories

(Android Background Services Graveyard :: Firefox Health Report Service, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 33

People

(Reporter: nalexander, Assigned: nalexander)

References

Details

Attachments

(1 file)

This got busted by Bug 965371.  The MockContext() that the test uses is not with the new HardwareUtils code.  I'm not sure what the correct fix is here -- delete the test?  Use the target context?

I TestRunner(8149) started: testIsIntentValid(org.mozilla.gecko.background.healthreport.prune.TestHealthReportPruneService)
W GeckoHealth(8149) fennec_nalexander :: HealthReportPruneService :: Got intent without profileName.
W GeckoHealth(8149) fennec_nalexander :: HealthReportPruneService :: Got intent without profilePath.
W GeckoHealth(8149) fennec_nalexander :: HealthReportPruneService :: Intent not valid - returning.
W GeckoHealth(8149) fennec_nalexander :: HealthReportPruneService :: Got intent without profilePath.
W GeckoHealth(8149) fennec_nalexander :: HealthReportPruneService :: Intent not valid - returning.
W GeckoHealth(8149) fennec_nalexander :: HealthReportPruneService :: Got intent without profileName.
W GeckoHealth(8149) fennec_nalexander :: HealthReportPruneService :: Intent not valid - returning.
W dalvikvm(8149) threadid=12: thread exiting with uncaught exception (group=0x4191c898)
D AndroidRuntime(8134) Shutting down VM
D jdwp(8134) Got wake-up signal, bailing out of select
D dalvikvm(8134) Debugger has detached; object registry had 1 entries
E AndroidRuntime(8149) FATAL EXCEPTION: IntentService[HealthReportPruneServiceWorker]
E AndroidRuntime(8149) java.lang.UnsupportedOperationException
E AndroidRuntime(8149) at android.test.mock.MockContext.getResources(MockContext.java:66)
E AndroidRuntime(8149) at org.mozilla.gecko.background.healthreport.AndroidConfigurationProvider.<init>(AndroidConfigurationProvider.java:23)
E AndroidRuntime(8149) at org.mozilla.gecko.background.healthreport.prune.PrunePolicyDatabaseStorage.<init>(PrunePolicyDatabaseStorage.java:39)
E AndroidRuntime(8149) at org.mozilla.gecko.background.healthreport.prune.TestHealthReportPruneService$MockHealthReportPruneService.getPrunePolicy(TestHealthReportPruneService.java:45)
E AndroidRuntime(8149) at org.mozilla.gecko.background.healthreport.prune.HealthReportPruneService.onHandleIntent(HealthReportPruneService.java:52)
E AndroidRuntime(8149) at org.mozilla.gecko.background.healthreport.prune.TestHealthReportPruneService$MockHealthReportPruneService.onHandleIntent(TestHealthReportPruneService.java:28)
E AndroidRuntime(8149) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E AndroidRuntime(8149) at android.os.Handler.dispatchMessage(Handler.java:99)
E AndroidRuntime(8149) at android.os.Looper.loop(Looper.java:137)
E AndroidRuntime(8149) at android.os.HandlerThread.run(HandlerThread.java:61)
Probably ought to rewire to use MockConfigurationProvider.
Assignee: nobody → nalexander
Again, one PR, multiple small tickets.
Attachment #8434463 - Flags: review?(michael.l.comella)
Comment on attachment 8434463 [details] [review]
Link to Github pull-request: https://github.com/mozilla-services/android-sync/pull/461

Looks like this solves the problem, but I'm not sure what the extra commit does, as I commented on in Github.
Attachment #8434463 - Flags: review?(michael.l.comella) → review+
https://hg.mozilla.org/mozilla-central/rev/857f771cf9ed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 33
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: