@Before public void init() { context = Robolectric.setupActivity(Activity.class); shadowContext = Shadows.shadowOf(context); testingQueues = new TestingQueues(); serviceInstance = spy(new Goro.GoroImpl(testingQueues)); serviceCompName = new ComponentName(context, GoroService.class); GoroService service = new GoroService(); binder = new GoroService.GoroBinderImpl(serviceInstance, service.new GoroTasksListener()); ShadowApplication.getInstance() .setComponentNameAndServiceForBindService( serviceCompName, binder ); reset(serviceInstance); }
public static GoroImpl createGoroWith(TestingQueues queues) { return new GoroImpl(queues); }
@Before public void init() { queues = new TestingQueues(); GoroService.setup(application, new Goro.GoroImpl(queues)); service = new GoroService(); service.onCreate(); task = new Task(new Callable<String>() { @Override public String call() throws Exception { executed = true; return "ok"; } }); executed = false; }
/** * Creates a new Goro instance which uses the specified executor to delegate tasks. * @param delegateExecutor executor Goro delegates tasks to * @return instance of Goro */ public static Goro createWithDelegate(final Executor delegateExecutor) { GoroImpl goro = new GoroImpl(); goro.queues.setDelegateExecutor(delegateExecutor); return goro; }
/** * Creates a new Goro instance which uses the specified executor to delegate tasks. * @param delegateExecutor executor Goro delegates tasks to * @return instance of Goro */ public static Goro createWithDelegate(final Executor delegateExecutor) { GoroImpl goro = new GoroImpl(); goro.queues.setDelegateExecutor(delegateExecutor); return goro; }
/** * Creates a new Goro instance which uses {@link android.os.AsyncTask#THREAD_POOL_EXECUTOR} * to delegate tasks on Post-Honeycomb devices or create a separate thread pool on earlier * Android versions. * @return instance of Goro */ public static Goro create() { return new GoroImpl(); }
/** * Creates a new Goro instance which uses {@link android.os.AsyncTask#THREAD_POOL_EXECUTOR} * to delegate tasks on Post-Honeycomb devices or create a separate thread pool on earlier * Android versions. * @return instance of Goro */ public static Goro create() { return new GoroImpl(); }