當前位置: 首頁>>代碼示例>>Java>>正文


Java ShadowLog.stream方法代碼示例

本文整理匯總了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();
}
 
開發者ID:appnexus,項目名稱:mobile-sdk-android,代碼行數:26,代碼來源:BaseRoboTest.java

示例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;
}
 
開發者ID:mplacona,項目名稱:trade-safe,代碼行數:25,代碼來源:MainActivityTest.java

示例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);
}
 
開發者ID:richardradics,項目名稱:MVPAndroidBootstrap,代碼行數:21,代碼來源:ConnectivityAwereUrlClientTest.java

示例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");
    }
}
 
開發者ID:weichweich,項目名稱:AluShare,代碼行數:26,代碼來源:DummyDataSet.java

示例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());

}
 
開發者ID:nexage,項目名稱:sourcekit-vast-android,代碼行數:17,代碼來源:ParserTest.java

示例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);
}
 
開發者ID:Xlythe,項目名稱:AndroidTextManager,代碼行數:19,代碼來源:ContactEditTextTest.java

示例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();
}
 
開發者ID:appnexus,項目名稱:mobile-sdk-android,代碼行數:25,代碼來源:BaseRoboTest.java

示例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();
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:12,代碼來源:MessagingControllerTest.java

示例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);
}
 
開發者ID:brarcher,項目名稱:rental-calc,代碼行數:8,代碼來源:PropertyNotesActivityTest.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:8,代碼來源:LinearLayoutHelperTest.java

示例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);
}
 
開發者ID:brarcher,項目名稱:rental-calc,代碼行數:10,代碼來源:PropertyCursorAdapterTest.java

示例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);
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:11,代碼來源:DirectRTCClientTest.java

示例13: setUp

import org.robolectric.shadows.ShadowLog; //導入方法依賴的package包/類
@Before
public void setUp() {
    ShadowLog.stream = System.out;

    MockitoAnnotations.initMocks(this);

    executor = Executors.newSingleThreadExecutor();
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:9,代碼來源:TCPChannelClientTest.java

示例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);
}
 
開發者ID:brarcher,項目名稱:rental-calc,代碼行數:10,代碼來源:DatabaseTest.java

示例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();
}
 
開發者ID:brarcher,項目名稱:rental-calc,代碼行數:12,代碼來源:PropertiesListActivityTest.java


注:本文中的org.robolectric.shadows.ShadowLog.stream方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。