本文整理匯總了Java中org.robolectric.shadows.ShadowLog.stream方法的典型用法代碼示例。如果您正苦於以下問題:Java ShadowLog.stream方法的具體用法?Java ShadowLog.stream怎麽用?Java ShadowLog.stream使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.robolectric.shadows.ShadowLog
的用法示例。
在下文中一共展示了ShadowLog.stream方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setup
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setup() {
Robolectric.getBackgroundThreadScheduler().reset();
Robolectric.getForegroundThreadScheduler().reset();
ShadowLog.stream = System.out;
activity = Robolectric.buildActivity(MockMainActivity.class).create().start().resume().visible().get();
shadowOf(activity).grantPermissions("android.permission.INTERNET");
server= new MockWebServer();
try {
server.start();
HttpUrl url= server.url("/");
UTConstants.REQUEST_BASE_URL_UT_V2 = url.toString();
System.out.println(UTConstants.REQUEST_BASE_URL_UT_V2);
ShadowSettings.setTestURL(url.toString());
TestResponsesUT.setTestURL(url.toString());
} catch (IOException e) {
System.out.print("IOException");
}
bgScheduler = Robolectric.getBackgroundThreadScheduler();
uiScheduler = Robolectric.getForegroundThreadScheduler();
Robolectric.flushBackgroundThreadScheduler();
Robolectric.flushForegroundThreadScheduler();
bgScheduler.pause();
uiScheduler.pause();
}
示例2: setupDagger
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setupDagger() {
DaggerApplicationComponentTest.builder()
.applicationContextModuleTest(new ApplicationContextModuleTest())
.repositoryModuleTest(new RepositoryModuleTest(false))
.build().inject(this);
//activity = Robolectric.setupActivity(MainActivity.class);
activity = Robolectric.buildActivity(MainActivity.class)
.create()
.start()
.resume()
.visible()
.get();
tradeAdapter = mock(TradeRecyclerViewAdapter.class);
fab = (FloatingActionButton) activity.findViewById(R.id.fab);
rvTrades = (RealmRecyclerView) activity.findViewById(R.id.list_trades);
//This is for printing log messages in console
ShadowLog.stream = System.out;
}
示例3: setUp
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp() throws Exception {
ShadowLog.stream = System.out;
mockWebServer = new MockWebServer();
mockWebServer.start(9999);
baseRetryHandler = BaseRetryHandler_.getInstance_(RuntimeEnvironment.application);
connectivityAwareUrlClient = ConnectivityAwareUrlClient_.getInstance_(RuntimeEnvironment.application);
connectivityAwareUrlClient.setWrappedClient(new OkClient(new OkHttpClient()));
connectivityAwareUrlClient.setRetryHandler(baseRetryHandler);
RestAdapter restAdapter = new RestAdapter.Builder()
.setClient(connectivityAwareUrlClient)
.setLogLevel(RestAdapter.LogLevel.FULL)
.setEndpoint(mockWebServer.getUrl("/").toString()).build();
sodaService = restAdapter.create(SodaService.class);
}
示例4: copyDataSet
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
public static void copyDataSet(String filename) throws IllegalArgumentException{ // /test/resources/databses/<filename>
String targetPath = TestHelper.getDatabasePath();
ShadowLog.stream = System.out;
File dbFile = new File(TestHelper.getTestResourcePath().concat("databases/" + filename));
if (!dbFile.exists()) {
System.out.print("File does not exist");
}
File targetDir = new File(targetPath);
if(!targetDir.exists()) {
targetDir.mkdirs();
}
File targetFile = new File(targetPath + "AluShareDataBase.db");
if (targetFile.exists()) {
targetFile.delete();
}
try {
TestHelper.copyFileUsingStream(dbFile,targetFile);
} catch (IOException e) {
System.out.println("File copy failed");
}
}
示例5: setup
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setup() throws IOException {
ShadowLog.stream = System.out;
System.out.println();
System.out
.println("*******************************************************");
System.out.println("***** TEST: " + name.getMethodName()
+ " *****");
System.out
.println("*******************************************************");
System.out.println();
parser = new VASTProcessor(new myMediaPicker());
}
示例6: setup
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setup() {
// Print out everything from logcat to the console instead
ShadowLog.stream = System.out;
// Setup variables
mContext = RuntimeEnvironment.application;
mEditText = new ContactEditText(mContext);
// Update the owner's contact in TextManager
ShadowTextManager shadowTextManager = (ShadowTextManager) ShadowExtractor.extract(TextManager.getInstance(mContext));
shadowTextManager.setSelf(ME);
shadowTextManager.addContact(NAMELESS);
shadowTextManager.addContact(ALICE);
shadowTextManager.addContact(BOB);
shadowTextManager.addContact(CHARLIE);
shadowTextManager.addContact(DEBRA);
}
示例7: setup
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setup() {
Robolectric.getBackgroundThreadScheduler().reset();
Robolectric.getForegroundThreadScheduler().reset();
ShadowLog.stream = System.out;
activity = Robolectric.buildActivity(MockMainActivity.class).create().start().resume().visible().get();
shadowOf(activity).grantPermissions("android.permission.INTERNET");
server= new MockWebServer();
try {
server.start();
HttpUrl url= server.url("/");
UTConstants.REQUEST_BASE_URL_UT_V2 = url.toString();
System.out.println(UTConstants.REQUEST_BASE_URL_UT_V2);
ShadowSettings.setTestURL(url.toString());
} catch (IOException e) {
System.out.print("IOException");
}
bgScheduler = Robolectric.getBackgroundThreadScheduler();
uiScheduler = Robolectric.getForegroundThreadScheduler();
Robolectric.flushBackgroundThreadScheduler();
Robolectric.flushForegroundThreadScheduler();
bgScheduler.pause();
uiScheduler.pause();
}
示例8: setUp
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp() throws MessagingException {
ShadowLog.stream = System.out;
MockitoAnnotations.initMocks(this);
appContext = ShadowApplication.getInstance().getApplicationContext();
controller = new MessagingController(appContext, notificationController, contacts, transportProvider);
configureAccount();
configureLocalStore();
}
示例9: setUp
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp()
{
// Output logs emitted during tests so they may be accessed
ShadowLog.stream = System.out;
db = new DBHelper(RuntimeEnvironment.application);
}
示例10: setup
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setup() {
ShadowLog.stream = System.out;
mActivity = Robolectric.buildActivity(Activity.class).create().get();
mRecyclerView = new RecyclerView(mActivity);
mLayoutManager = new VirtualLayoutManager(mActivity);
}
示例11: setUp
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp()
{
// Output logs emitted during tests so they may be accessed
ShadowLog.stream = System.out;
activity = Robolectric.setupActivity(PropertiesListActivity.class);
db = new DBHelper(activity);
}
示例12: setUp
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp() {
ShadowLog.stream = System.out;
clientEvents = mock(AppRTCClient.SignalingEvents.class);
serverEvents = mock(AppRTCClient.SignalingEvents.class);
client = new DirectRTCClient(clientEvents);
server = new DirectRTCClient(serverEvents);
}
示例13: setUp
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp() {
ShadowLog.stream = System.out;
MockitoAnnotations.initMocks(this);
executor = Executors.newSingleThreadExecutor();
}
示例14: setUp
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp()
{
// Output logs emitted during tests so they may be accessed
ShadowLog.stream = System.out;
Activity activity = Robolectric.setupActivity(PropertiesListActivity.class);
db = new DBHelper(activity);
}
示例15: setUp
import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp()
{
// Output logs emitted during tests so they may be accessed
ShadowLog.stream = System.out;
db = new DBHelper(RuntimeEnvironment.application);
prefs = RuntimeEnvironment.application.getSharedPreferences("protect.rentalcalc", Context.MODE_PRIVATE);
// Assume that this is not the first launch
prefs.edit().putBoolean("firstrun", false).commit();
}