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


Java SmallTest類代碼示例

本文整理匯總了Java中android.support.test.filters.SmallTest的典型用法代碼示例。如果您正苦於以下問題:Java SmallTest類的具體用法?Java SmallTest怎麽用?Java SmallTest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SmallTest類屬於android.support.test.filters包,在下文中一共展示了SmallTest類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testInitializeUsingByteBufferReInitilizeUsingTextures

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testInitializeUsingByteBufferReInitilizeUsingTextures() {
  if (!MediaCodecVideoEncoder.isVp8HwSupportedUsingTextures()) {
    Log.i(TAG, "hardware does not support VP8 encoding, skipping testEncoderUsingTextures");
    return;
  }
  MediaCodecVideoEncoder encoder = new MediaCodecVideoEncoder();
  assertTrue(encoder.initEncode(
      MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480, 300, 30, null));
  encoder.release();
  EglBase14 eglBase = new EglBase14(null, EglBase.CONFIG_PLAIN);
  assertTrue(encoder.initEncode(MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480,
      300, 30, eglBase.getEglBaseContext()));
  encoder.release();
  eglBase.release();
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:18,代碼來源:MediaCodecVideoEncoderTest.java

示例2: testLayoutMatrixScale

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testLayoutMatrixScale() {
  // Video has aspect ratio 2, but layout is square. This will cause only the center part of the
  // video to be visible, i.e. the u coordinate will go from 0.25 to 0.75 instead of from 0 to 1.
  final float layoutMatrix[] = getLayoutMatrix(false, 2.0f, 1.0f);
  // Assert:
  // u' = 0.25 + 0.5 u.
  // v' = v.
  // clang-format off
  assertArrayEquals(new double[] {
       0.5, 0, 0, 0,
         0, 1, 0, 0,
         0, 0, 1, 0,
      0.25, 0, 0, 1}, round(layoutMatrix), 0.0);
  // clang-format on
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:18,代碼來源:RendererCommonTest.java

示例3: testEntertainment

import android.support.test.filters.SmallTest; //導入依賴的package包/類
/**
 * Test of constructor Entertainment method, of class Entertainment.
 */

@Test
@SmallTest
public void testEntertainment() {
    System.out.println("constructorEntertainment");
    Entertainment instance = new Entertainment(null,null,null,null,null,null,null,null,null,null);
    assertEquals(instance.getName(), null);
    assertEquals(instance.getAddress(), null);
    assertEquals(instance.getDescription(), null);
    assertEquals(instance.getLongitude(), null);
    assertEquals(instance.getLatitude(), null);
    assertEquals(instance.getPhotoUrl(), null);
    assertEquals(instance.getUID(), null);
    assertEquals(instance.getAuthor(), null);
    assertEquals(instance.getEstablishmentCategory(), null);
}
 
開發者ID:Socialate,項目名稱:furry-sniffle,代碼行數:20,代碼來源:EntertainmentClassTest.java

示例4: testSetLocalOfferMakesVideoFlowLocally

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testSetLocalOfferMakesVideoFlowLocally() throws InterruptedException {
  Log.d(TAG, "testSetLocalOfferMakesVideoFlowLocally");
  MockRenderer localRenderer = new MockRenderer(EXPECTED_VIDEO_FRAMES, LOCAL_RENDERER_NAME);
  pcClient = createPeerConnectionClient(localRenderer, new MockRenderer(0, null),
      createParametersForVideoCall(VIDEO_CODEC_VP8),
      createCameraCapturer(false /* captureToTexture */), null);

  // Wait for local SDP and ice candidates set events.
  assertTrue("Local SDP was not set.", waitForLocalSDP(WAIT_TIMEOUT));
  assertTrue("ICE candidates were not generated.", waitForIceCandidates(WAIT_TIMEOUT));

  // Check that local video frames were rendered.
  assertTrue(
      "Local video frames were not rendered.", localRenderer.waitForFramesRendered(WAIT_TIMEOUT));

  pcClient.close();
  assertTrue(
      "PeerConnection close event was not received.", waitForPeerConnectionClosed(WAIT_TIMEOUT));
  Log.d(TAG, "testSetLocalOfferMakesVideoFlowLocally Done.");
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:23,代碼來源:PeerConnectionClientTest.java

示例5: testRgbRendering

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testRgbRendering() {
  // Create EGL base with a pixel buffer as display output.
  final EglBase eglBase = EglBase.create(null, EglBase.CONFIG_PIXEL_BUFFER);
  eglBase.createPbufferSurface(WIDTH, HEIGHT);
  eglBase.makeCurrent();

  // Create RGB byte buffer plane with random content.
  final ByteBuffer rgbPlane = ByteBuffer.allocateDirect(WIDTH * HEIGHT * 3);
  final Random random = new Random(SEED);
  random.nextBytes(rgbPlane.array());

  // Upload the RGB byte buffer data as a texture.
  final int rgbTexture = GlUtil.generateTexture(GLES20.GL_TEXTURE_2D);
  GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
  GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, rgbTexture);
  GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGB, WIDTH, HEIGHT, 0, GLES20.GL_RGB,
      GLES20.GL_UNSIGNED_BYTE, rgbPlane);
  GlUtil.checkNoGLES2Error("glTexImage2D");

  // Draw the RGB frame onto the pixel buffer.
  final GlRectDrawer drawer = new GlRectDrawer();
  drawer.drawRgb(rgbTexture, RendererCommon.identityMatrix(), WIDTH, HEIGHT, 0 /* viewportX */,
      0 /* viewportY */, WIDTH, HEIGHT);

  // Download the pixels in the pixel buffer as RGBA. Not all platforms support RGB, e.g. Nexus 9.
  final ByteBuffer rgbaData = ByteBuffer.allocateDirect(WIDTH * HEIGHT * 4);
  GLES20.glReadPixels(0, 0, WIDTH, HEIGHT, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, rgbaData);
  GlUtil.checkNoGLES2Error("glReadPixels");

  // Assert rendered image is pixel perfect to source RGB.
  assertByteBufferEquals(WIDTH, HEIGHT, stripAlphaChannel(rgbaData), rgbPlane);

  drawer.release();
  GLES20.glDeleteTextures(1, new int[] {rgbTexture}, 0);
  eglBase.release();
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:39,代碼來源:GlRectDrawerTest.java

示例6: testLoopbackVp8CaptureToTexture

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testLoopbackVp8CaptureToTexture() throws InterruptedException {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
    Log.i(TAG, "Encode to textures is not supported. Requires SDK version 19");
    return;
  }
  // TODO(perkj): If we can always capture to textures, there is no need to check if the
  // hardware encoder supports to encode from a texture.
  if (!MediaCodecVideoEncoder.isVp8HwSupportedUsingTextures()) {
    Log.i(TAG, "VP8 encode to textures is not supported.");
    return;
  }
  doLoopbackTest(createParametersForVideoCall(VIDEO_CODEC_VP8),
      createCameraCapturer(true /* captureToTexture */), true /* decodeToTexture */);
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:17,代碼來源:PeerConnectionClientTest.java

示例7: testLoopbackH264CaptureToTexture

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testLoopbackH264CaptureToTexture() throws InterruptedException {
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
    Log.i(TAG, "Encode to textures is not supported. Requires KITKAT");
    return;
  }
  // TODO(perkj): If we can always capture to textures, there is no need to check if the
  // hardware encoder supports to encode from a texture.
  if (!MediaCodecVideoEncoder.isH264HwSupportedUsingTextures()) {
    Log.i(TAG, "H264 encode to textures is not supported.");
    return;
  }
  doLoopbackTest(createParametersForVideoCall(VIDEO_CODEC_H264),
      createCameraCapturer(true /* captureToTexture */), true /* decodeToTexture */);
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:17,代碼來源:PeerConnectionClientTest.java

示例8: testConnectivityManagerDelegateDoesNotCrash

import android.support.test.filters.SmallTest; //導入依賴的package包/類
/**
 * Tests that ConnectivityManagerDelegate doesn't crash. This test cannot rely on having any
 * active network connections so it cannot usefully check results, but it can at least check
 * that the functions don't crash.
 */
@Test
@UiThreadTest
@SmallTest
public void testConnectivityManagerDelegateDoesNotCrash() {
  ConnectivityManagerDelegate delegate =
      new ConnectivityManagerDelegate(InstrumentationRegistry.getTargetContext());
  delegate.getNetworkState();
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    Network[] networks = delegate.getAllNetworks();
    if (networks.length >= 1) {
      delegate.getNetworkState(networks[0]);
      delegate.hasInternetCapability(networks[0]);
    }
    delegate.getDefaultNetId();
  }
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:22,代碼來源:NetworkMonitorTest.java

示例9: testSentence

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testSentence() {
    System.out.println("constructorSentence");
    Sentence instance = new Sentence(0,"This is a test sentence.",0, 0);
    assertEquals(instance.noOfWords, 5);
    assertEquals(instance.stringLength, 0);
    assertEquals(instance.score, 0.0);
    assertEquals(instance.number, 0);
    assertEquals(instance.value, "This is a test sentence.");
    assertEquals(instance.paragraphNumber, 0);
}
 
開發者ID:Socialate,項目名稱:furry-sniffle,代碼行數:13,代碼來源:SentenceTest.java

示例10: testSetStringLength

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testSetStringLength() {
    System.out.println("setStringLength");
    int length = 1;
    Sentence instance = new Sentence();
    instance.setStringLength(length);
    assertEquals(instance.getStringLength(), length);
}
 
開發者ID:Socialate,項目名稱:furry-sniffle,代碼行數:10,代碼來源:SentenceTest.java

示例11: testGetStringLength

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testGetStringLength() {
    System.out.println("getStringLength");
    Sentence instance = new Sentence();
    int expResult = 1;
    instance.setStringLength(1);
    int result = instance.getStringLength();
    assertEquals(expResult, result);
}
 
開發者ID:Socialate,項目名稱:furry-sniffle,代碼行數:11,代碼來源:SentenceTest.java

示例12: testSetParagraphNumber

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testSetParagraphNumber() {
    System.out.println("setParagraphNumber");
    int number = 1;
    Sentence instance = new Sentence();
    instance.setParagraphNumber(number);
    assertEquals(instance.getParagraphNumber(), number);
}
 
開發者ID:Socialate,項目名稱:furry-sniffle,代碼行數:10,代碼來源:SentenceTest.java

示例13: testGetPargraphNumber

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testGetPargraphNumber() {
    System.out.println("getParagraphNumber");
    Sentence instance = new Sentence();
    int expResult = 1;
    instance.setParagraphNumber(1);
    int result = instance.getParagraphNumber();
    assertEquals(expResult, result);
}
 
開發者ID:Socialate,項目名稱:furry-sniffle,代碼行數:11,代碼來源:SentenceTest.java

示例14: testInitilizeUsingTextures

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testInitilizeUsingTextures() {
  if (!MediaCodecVideoEncoder.isVp8HwSupportedUsingTextures()) {
    Log.i(TAG, "hardware does not support VP8 encoding, skipping testEncoderUsingTextures");
    return;
  }
  EglBase14 eglBase = new EglBase14(null, EglBase.CONFIG_PLAIN);
  MediaCodecVideoEncoder encoder = new MediaCodecVideoEncoder();
  assertTrue(encoder.initEncode(MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480,
      300, 30, eglBase.getEglBaseContext()));
  encoder.release();
  eglBase.release();
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:15,代碼來源:MediaCodecVideoEncoderTest.java

示例15: testGetNumber

import android.support.test.filters.SmallTest; //導入依賴的package包/類
@Test
@SmallTest
public void testGetNumber() {
    System.out.println("getNumber");
    Sentence instance = new Sentence();
    int expResult = 1;
    instance.setNumber(1);
    int result = instance.getNumber();
    assertEquals(expResult, result);
}
 
開發者ID:Socialate,項目名稱:furry-sniffle,代碼行數:11,代碼來源:SentenceTest.java


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