We are happy to announce that the latest version of Robolectric, 2.2, has been released. This release represents several months of work by the Robolectric team and includes some notable improvements. Most interesting is that we've moved one step closer to "Android Reality" by removing one of the main fake pieces of Robolectric — the RoboWindow. We now use the real implementation of Window from the AOSP sources. This has far-reaching consequences but the main one is that we now support the native ActionBar. Your code can now call getActionBar() without getting back a null, and you'll be able to interact with an ActionBar in your tests as well.
There are many other features and fixes added in 2.2. Here's a list of them. Please give Robolectric 2.2 a try and let us know how it goes by directing pull requests and bugfixes to our GitHub repository.
We are aware that Robolectric's documentation is a bit out of date, and we are working on it. Expect documentation updates in the next few days.
Thanks — now get back to testing!
There are many other features and fixes added in 2.2. Here's a list of them. Please give Robolectric 2.2 a try and let us know how it goes by directing pull requests and bugfixes to our GitHub repository.
We are aware that Robolectric's documentation is a bit out of date, and we are working on it. Expect documentation updates in the next few days.
Thanks — now get back to testing!
Features
- Robolectric now does not have a fake implementation of
Window
(RoboWindow
). It has been removed and we now use the internalPhoneWindow
class. This allows thegetActionBar()
method in Activity to return a realActionBar
implementation in tests. - To create and manage Activity instances, you must now use the ActivityController interface (see
Robolectric.buildActivity()
) - Added
visible()
method toActivityController
.visible()
must be called on an activity in order forView.isShown()
to report back anything but false, since it hooks up theActivity
's view hierarchy to theWindowManager
. - Some shadows were removed (
ShadowListActivity
)
Bug Fixes
Animation.hasEnded()
works as expectedAsyncTask
s no longer swallow exceptions that are thrown duringonPostExecute()
Context.startActivity()
calls can now optionally check if the specifiedActivity
is in thePackageManager
usingRobolectric.checkActivities(true)
- Many many issues fixed
- Better support for Windows development environments
- Documentation updates!
Hi,
ReplyDeleteI am trying to run your sample project using maven. But I am having some problems:
Caused by: java.lang.OutOfMemoryError: Java heap space
at
the Heap goes empty after
DEBUG: Loading resources for android from jar:%user_dir%\m2\repository\org\robolectric\android-res\4.1.2_r1_rc\android-res-4.1.2_r1_rc-real.jar!/res...
Please help me.
I have tried -Xms256m -Xmx512m
setting it to argline param in Pom
configuring java params..
I am not able to solve this issue.
Please help me out.
Hi, is there a detailed instructions for using robolectric on Eclipse? I have been researching it for many hours but couldn't get it to work. The M2Eclipse link on http://robolectric.org/eclipse-quick-start.html just leads me to a log-in page.
ReplyDeleteI am have been learning android development for a few months now using the ADT download from http://developer.android.com/sdk/index.html.
Thanks
Bài viết bạn rất hay:
ReplyDeleteChúng tôi là đơn vị cung cấp các sản phẩm chất lượng như:
Giảo cổ lam
giảo cổ lam giải độc gan
giảo cổ lam giảm béo
Bài viết bạn rất hay:
ReplyDeleteChúng tôi là đơn vị cung cấp các sản phẩm chất lượng như:
lều xông hơi
lều xông hơi sau sinh
lều xông hơi giá bao nhiêu
Bài viết rất hay: Chúng tôi chuyên cung cấp các sản phẩm chất lượng sau:
ReplyDeletebồn massage
bon ngam chan
máy massage chân
Cảm ơn các bạn!
I enjoyed your blog Thanks for sharing such an informative post. We are also providing the best services click on below links to visit our website.
ReplyDeletedigital marketing company in nagercoil
digital marketing services in nagercoil
digital marketing agency in nagercoil
best marketing services in nagercoil
SEO company in nagercoil
SEO services in nagercoil
social media marketing in nagercoil
social media company in nagercoil
PPC services in nagercoil
digital marketing company in velachery
digital marketing company in velachery
digital marketing services in velachery
digital marketing agency in velachery
SEO company in velachery
SEO services in velachery
social media marketing in velachery
social media company in velachery
PPC services in velachery
online advertisement services in velachery
online advertisement services in nagercoil
web design company in nagercoil
web development company in nagercoil
website design company in nagercoil
website development company in nagercoil
web designing company in nagercoil
website designing company in nagercoil
best web design company in nagercoil
web design company in velachery
web development company in velachery
website design company in velachery
website development company in velachery
web designing company in velachery
website designing company in velachery
best web design company in velachery
Thanks for Sharing - ( Groarz branding solutions )