Android - Unable to test Chart with CandlestickSeries with Roboelectric


#1

Hello,

I am creating unit tests for our charting package (per our development process).  We use Roboelectric to speed up test runs.  I have been able to successfully create tests for LineSeries charts, but once I tried to create a test for our CandlestickSeries chart, I started getting this exception.

java.lang.NoClassDefFoundError: com/shinobicontrols/charts/r (wrong name: com/shinobicontrols/charts/R)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
	at org.robolectric.bytecode.AsmInstrumentingClassLoader.findClass(AsmInstrumentingClassLoader.java:153)
	at org.robolectric.bytecode.AsmInstrumentingClassLoader.loadClass(AsmInstrumentingClassLoader.java:95)
	at com.shinobicontrols.charts.CandlestickSeries.<init>(SourceFile:25)

I believe this issue is because CandlestickSeries uses an obfuscated class called ‘r’, which is conflicting with the standard resource class ‘R’.  I am developing on a Mac, which could be causing some of the issue as it is not case sensitive.  I believe if you rebuilt the jar with obfuscation, but disallowing ‘r’ as a valid name, then my tests would work.

Thanks


#2

Hi aderington,

We’ll take a look into this and get back to you in due course. Can you remind me what version and what flavor (Premium or Trial) you are using please?

Kind regards,

Patrick


#3

I am using version 1.5.0 Premium.

Thanks


#4

Hello aderington,

Thank you for this extra information. We are investigating this and we will reply to this post soon.

Thanks,

Kai.


#5

Hello aderington,

Thanks for getting back in touch and providing the extra information.

We’ve been looking into this and we think we may have come up with a solution. Could you please email info@shinobicontrols.com with your support key and we should be able to help you further.

We look forward to hearing from you.

Thanks and kind regards,

Kai.


#6

Just a note to anyone reading this post - we’ve now released v1.6.0 of ShinobiCharts for Android which includes a fix for this bug. It’s available in the Customer Portal and as a trial download from http://www.shinobicontrols.com/android.

Patrick