Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7746223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:13:24+00:00 2026-06-01T10:13:24+00:00

OOTB, Robolectric does not support Locales that well. Therefore, if your app is dependent

  • 0

OOTB, Robolectric does not support Locales that well. Therefore, if your app is dependent on locales (which a lot of apps are if they are i18n’nd properly) this can be a royal pain. Long story short, I created my own ShadowFooGeocoder and ShadowFooAddress that allow me to simulate the locale I want. They’re basically re-implementations of the existing shadows.

However, when I bind my class as such: bindShadowClass(ShadowFooGeocoder.class), this works great. At runtime, the correct shadow is returned. The problem is that I want to set up the simulations on this object and I’m not sure how. shadowOf(instance) where instance is an injected GeoCoder returns ShadowGeoCoder. I’ve tried working directly with the ShadowWrangler, but that also returns a ShadowGeocoder.

How can I get at my shadowed class that I’ve bound through the bindShadowClass(…) call so I can set my expectations (simulations)?

Note: This is a repost of the same question on the Robolectric group here. I posted here because my success rate of getting anyone to answer questions on the group is fairly low. I’m hoping for a better result here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:13:25+00:00Added an answer on June 1, 2026 at 10:13 am

    What I’ve basically done here is extend ShadowGeocoder like this:

    @SuppressWarnings({"UnusedDeclaration"})
    @Implements(Geocoder.class)
    public class ShadowFooBarGeocoder extends ShadowGeocoder {
      // implementation stuff
    }
    

    Then I would bind it using the bindShadowClasss(…) and when I retreive the shadow via the static shadowOf(…) call I get back a “ShadowGeocoder” which is an instance of ShadowFooBarGeocoder. I then cast it to that type and perform whatever work I need to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I determine programmatically what master pages (custom and OOTB) that are available
Two-part question (parts are closely related): with the default OOTB ETag policy that IIS7
I am hearing about OOTB Workflow Tasks List, but I'm not being able to
I've created a custom SharePoint application which extends some of the OOTB functionality of
We have an intranet asp.net web application which uses the OOTB ASP.net membership and
I'm using MOSS OOTB WebServices wherein I in need a webservice method name which
I don't suppose there's a way to get at the SPFarm through the OOTB
Is there a way to detect end of Flash movie (OOTB, without using some
I am in the design stage of an application that must be both a
I have a custom web application that integrates with a SharePoint (MOSS 2007) solution.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.