[AC-614] : Unit test are now working#637
Conversation
|
Also, please suggest any suitable alternative in case you have in mind. The reason behind this problem has been stated in description @f4ww4z |
|
@f4ww4z sir, one more file needs to be customized in this way which I'll do tomorrow to pass travis CI, do you think this would be correct fix or something else needs to be done too ? |
|
@rishabh-997 Yes you need to fix the failing test at https://travis-ci.org/openmrs/openmrs-contrib-android-client/builds/626888550#L867 . Make sure the test works locally first before committing. |
|
Also @rishabh-997 , please claim this task in GCI dashboard first. |
sir actually mobile internet has been taken down for some days because of riots going on here, can be little late, sorry for the delay.... will try to finish it up as soon as mobile networks are restored permanently |
|
@f4ww4z here is one thing, I had no idea regarding this GCI thing, so I worked on it and resolved the issue, but I am not in GCI. I have worked hard to resolve this issue so can you review it, ill take care next time... |
f4ww4z
left a comment
There was a problem hiding this comment.
Appreciated the effort @rishabh-997 ! See my comments below.
Do we really need to implement all of the serializers? e.g. BigDecimalSerializer, CalendarSerializer, etc.
Make sure your format your changes using AS's default formatter.
...client/src/main/java/org/openmrs/mobile/utilities/ActiveAndroid/content/ContentProvider.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/openmrs/mobile/utilities/ActiveAndroid/serializer/BigDecimalSerializer.java
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,29 @@ | |||
| package org.openmrs.mobile.utilities.ActiveAndroid.serializer; | |||
There was a problem hiding this comment.
Add the OpenMRS license header. Do we need this serializer?
There was a problem hiding this comment.
actually, there were few files of active android which need not be created, but in order to remove the dependency completely from gradle, i copied all of them so there might not be any duplicates and app size wont increase... ill check , if these serializers are going unused, ill remove the file
...mrs-client/src/main/java/org/openmrs/mobile/utilities/ActiveAndroid/widget/ModelAdapter.java
Outdated
Show resolved
Hide resolved
|
@f4ww4z I have made the changes you requested, if there is no problem with the PR, then ill squash the commits |
| @Override | ||
| public void onCreate() { | ||
| super.onCreate(); | ||
| ActiveAndroid.initialize(this); |
There was a problem hiding this comment.
| @Override | ||
| public void onTerminate() { | ||
| super.onTerminate(); | ||
| ActiveAndroid.dispose(); |
| } | ||
|
|
||
| ////////////////////////////////////////////////////////////////////////////////////// | ||
| // PUBLIC METHODS |
There was a problem hiding this comment.
This divider was already declared before.
| @@ -0,0 +1,29 @@ | |||
| package org.openmrs.mobile.utilities.ActiveAndroid.serializer; | |||
f4ww4z
left a comment
There was a problem hiding this comment.
Looks good @rishabh-997 !

Description of what I changed
The main problem arose because of the migration of android to androidx, to which ActiveAndroid class was not up to date. It had a non-editable caches.java file which was importing LruCache.java from the android.support.v4.util package but originally, this file is found in android.util package.
I started creating custom classes for the ActiveAndroid package recursively but I almost had to re-copy the entire ActiveAndroid library, so I removed the dependency and added code for the entire ActiveAndroid library. The size of the app will have no effect as new java files are compensated by removed dependency
Issue I worked on
JIRA Issue: https://issues.openmrs.org/browse/AC-614
Checklist: I completed these to help reviewers :)
(the number above, next to the 'Commits' tab is 1).
existing code that was well tested you do not have to add tests)