IronBeast { public static IronBeast getInstance() {return sInstance;} IronBeast(Context context); static IronBeast getInstance(); static IronBeast getInstance(Context context); IronBeastTracker newTracker(String token); void enableErrorReporting(); void setAllowedOverRoaming(boolean allowed); void setAllowedNetworkTypes(int flags); void setLogType(IBConfig.LOG_TYPE logType); void setBulkSize(int size); void setMaximumRequestLimit(long bytes); void setFlushInterval(int ms); static final int NETWORK_MOBILE; static final int NETWORK_WIFI; }
@Test public void testGetInstance() { MockContext context = mock(MockContext.class); IronBeast ironBeast = IronBeast.getInstance(context); IronBeastTracker tracker1 = ironBeast.newTracker("token1"); IronBeastTracker tracker2 = ironBeast.newTracker("token1"); assertTrue("should not initialized new tracker with the same token", tracker1 == tracker2); IronBeastTracker tracker3 = ironBeast.newTracker("token2"); assertTrue("should initialized new tracker", tracker1 != tracker3 || tracker2 != tracker3); }