@Override public void onCreate() { super.onCreate(); objectGraph = ObjectGraph.create(new AppModule(this)); objectGraph.inject(this); GoroService.setup(this, goro); }
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.goro); GoroService.setup(this, GORO); if (savedInstanceState != null) { counter = savedInstanceState.getInt("counter"); } GoroView goroView = (GoroView) findViewById(R.id.goro); observer = new GoroStateObserver(goroView, savedInstanceState); View restButton = findViewById(R.id.button_post_rest); restButton.setOnClickListener(new Clicker(QUEUE_REST)); View dbButton = findViewById(R.id.button_post_db); dbButton.setOnClickListener(new Clicker(QUEUE_DB)); }
@Override public void run() { GoroService.setup(getContext(), Goro.createWithDelegate(executor)); Log.i("GoroTest", "BINDING..."); goro = Goro.from(bindService(new Intent())); assertThat(goro).isNotNull(); bindSyc.countDown(); } });
@Override public void run() { GoroService.setup(getContext(), Goro.createWithDelegate(AsyncTask.THREAD_POOL_EXECUTOR)); } });
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GoroService.setup(this, Goro.create()); Scheduler scheduler = new RxGoro(goro).scheduler("test-queue"); Observable.just("ok") .subscribeOn(scheduler) .subscribe(new Action1<String>() { @Override public void call(String s) { result = "ok"; resultSync.countDown(); } }); Observable.error(new RuntimeException("test error")) .subscribeOn(scheduler) .subscribe(Actions.empty(), new Action1<Throwable>() { @Override public void call(Throwable throwable) { error = throwable; errorSync.countDown(); } }); }
@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; }