@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(); }
@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 }
/** * 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); }
@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."); }
@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 */); }
@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 */); }
/** * 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(); } }
@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); }
@Test @SmallTest public void testSetStringLength() { System.out.println("setStringLength"); int length = 1; Sentence instance = new Sentence(); instance.setStringLength(length); assertEquals(instance.getStringLength(), length); }
@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); }
@Test @SmallTest public void testSetParagraphNumber() { System.out.println("setParagraphNumber"); int number = 1; Sentence instance = new Sentence(); instance.setParagraphNumber(number); assertEquals(instance.getParagraphNumber(), number); }
@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); }
@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(); }
@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); }
@Test @SmallTest public void testSetScore() { System.out.println("setScore"); double score = 1.0; Sentence instance = new Sentence(); instance.setScore(score); assertEquals(instance.getScore(), score); }
@Test @SmallTest public void testGetScore() { System.out.println("getScore"); Sentence instance = new Sentence(); double expResult = 1.0; instance.setScore(1.0); double result = instance.getScore(); assertEquals(expResult, result); }
@Test @SmallTest public void testSetNoOfWords() { System.out.println("setNoOfWords"); int number = 1; Sentence instance = new Sentence(); instance.setNoOfWords(number); assertEquals(instance.getNoOfWords(), number); }
@Test @SmallTest public void testSetValue() { System.out.println("setValue"); String name = "Francis"; Sentence instance = new Sentence(); instance.setValue(name); assertEquals(instance.getValue(), name); }
@Test @SmallTest public void testGetValue() { System.out.println("getValue"); Sentence instance = new Sentence(); String expResult = "james"; instance.setValue("james"); String result = instance.getValue(); assertEquals(expResult, result); }
@Test @SmallTest public void testSentenceCharacter() { System.out.println("testSentenceCharacter"); String name = "This website is aw3som3."; Sentence instance = new Sentence(); instance.sentenceCount(name); assertEquals(instance.getVowels(), 7); assertEquals(instance.getConsonants(), 11); assertEquals(instance.getDigits(), 2); assertEquals(instance.getSpaces(), 3); }
/** This is a test for CheckEmailActivity, which automates the form filling and clicks the button **/ @Test @SmallTest public void registerEmailLaunchTest() { Context targetContext = InstrumentationRegistry.getInstrumentation() .getTargetContext(); Intent intent = new Intent(targetContext, RegisterEmailActivity.class); intent.putExtra("signUpEmailAddress", mEmail); rule.launchActivity(intent); /* Your activity is initialized and ready to go. */ onView(withId(R.id.loginPasswordEditText)).perform(typeText(mPassword)); //(ViewAction) closeSoftKeyboard()); // onView(withId(R.id.createAccountButton)).perform(click()); }
@Test @SmallTest public void test1() throws Exception{ if(Looper.myLooper() == null){ Looper.prepare(); } final Sum obj = new Sum(); String description = "I am a summary mdsafm adfbsdhgfg afbgj afhhajg afgjagj fjagjfg kjjajgfgs sfsjg sgfjgj jsdgfjgs sjfdgjg jsgfjsg" + "shgsj sdhfjg jsdbjhf sjdfh jsdgfj sdgjg jjjskdh dskkhfk"; String summary = obj.summarize(description); Sum sum = new Sum(); assertEquals(summary , sum.summarize(description)); }
@Test @SmallTest public void test2() throws Exception{ String description = "I am a paragraph. I am a paragraph. I am a paragraph.\n\n I am a paragraph. I am a paragraph. I am a paragraph. I am a paragraph"; Sum sum = new Sum(); sum.summarize(description); }
@Test @SmallTest public void testInitializeUsingByteBuffer() { if (!MediaCodecVideoEncoder.isVp8HwSupported()) { Log.i(TAG, "Hardware does not support VP8 encoding, skipping testInitReleaseUsingByteBuffer"); return; } MediaCodecVideoEncoder encoder = new MediaCodecVideoEncoder(); assertTrue(encoder.initEncode( MediaCodecVideoEncoder.VideoCodecType.VIDEO_CODEC_VP8, 640, 480, 300, 30, null)); encoder.release(); }
@Test @SmallTest public void comparator() throws Exception { Sentence instance = new Sentence(1,"This is a test sentence.",0, 0); Sentence instance1 = new Sentence(2,"This is a test sentence.",0, 0); assertEquals(sentence.compare(instance1, instance), 1); assertEquals(sentence.compare(instance, instance1), -1); instance1.number = 1; assertEquals(sentence.compare(instance, instance1), 0); }
@Test @SmallTest public void isDisplayedTest() throws InterruptedException { Thread.sleep(2000); onView(withId(R.id.createPasswordTextView)).check(matches(isDisplayed())); onView(withId(R.id.loginEmailEditText)).check(matches(isDisplayed())); onView(withId(R.id.loginPasswordEditText)).check(matches(isDisplayed())); onView(withId(R.id.createAccountButton)).check(matches(isDisplayed())); }
/** * Test of setOwner method, of class Entertainment. */ @Test @SmallTest public void testSetOwner() { System.out.println("setOwner"); String name = "james"; Entertainment instance = new Entertainment(); instance.setOwner(name); assertEquals(instance.getOwner(), name); }
@Test @SmallTest public void testRotateTextureMatrix90Deg() { final float samplingMatrix[] = rotateTextureMatrix(RendererCommon.identityMatrix(), 90); // Assert: // u' = 1 - v. // v' = u. // clang-format off assertArrayEquals(new double[] { 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1}, round(samplingMatrix), 0.0); // clang-format on }
/** * Test of setName method, of class Entertainment. */ @Test @SmallTest public void testSetName() { System.out.println("setName"); String name = "Truth"; Entertainment instance = new Entertainment(); instance.setName(name); assertEquals(instance.getName(), name); }
/** * Test of getName method, of class Entertainment. */ @Test @SmallTest public void testGetName() { System.out.println("getName"); Entertainment instance = new Entertainment(); String expResult = "Truth"; instance.setName("Truth"); String result = instance.getName(); assertEquals(expResult, result); }
/** * Test of getAddress method, of class Entertainment. */ @Test @SmallTest public void testSetAddress() { System.out.println("setAddress"); String address = "289 10th Ave, New York, NY 10001, USA"; Entertainment instance = new Entertainment(); instance.setAddress(address); assertEquals(instance.getAddress(), address); }
/** * Test of getAddress method, of class Entertainment. */ @Test @SmallTest public void testGetAddress() { System.out.println("getAddress"); Entertainment instance = new Entertainment(); String expResult = "289 10th Ave, New York, NY 10001, USA"; instance.setAddress("289 10th Ave, New York, NY 10001, USA"); String result = instance.getAddress(); assertEquals(expResult, result); }
/** * Test of setDescription method, of class Entertainment. */ @Test @SmallTest public void testSetDescription() { System.out.println("setDesciption"); String description = "Colorful, multi-tiered dance club featuring 30-foot ceilings, LED screens & plenty of night owls."; Entertainment instance = new Entertainment(); instance.setDescription(description); assertEquals(instance.getDescription(), description); }
/** * Test disposing the SurfaceTextureHelper immediately after is has been setup to use a * shared context. No frames should be delivered to the listener. */ @Test @SmallTest public void testDisposeImmediately() { final SurfaceTextureHelper surfaceTextureHelper = SurfaceTextureHelper.create("SurfaceTextureHelper test" /* threadName */, null); surfaceTextureHelper.dispose(); }
/** * Test of getLongitude method, of class Entertainment. */ @Test @SmallTest public void testSetLongitude() { System.out.println("setLongitude"); String longitude = "28.0481282"; Entertainment instance = new Entertainment(); instance.setLongitude(longitude); assertEquals(instance.getLongitude(), longitude); }
/** * Test of getlongitude method, of class Entertainment. */ @Test @SmallTest public void testGetLongitude() { System.out.println("getLongitude"); Entertainment instance = new Entertainment(); String expResult = "28.0481282"; instance.setLongitude("28.0481282"); String result = instance.getLongitude(); assertEquals(expResult, result); }
/** * Test of setLatitude method, of class Entertainment. */ @Test @SmallTest public void testSetLatitude() { System.out.println("setLatitude"); String latitude = "-26.1818356"; Entertainment instance = new Entertainment(); instance.setLatitude(latitude); assertEquals(instance.getLatitude(), latitude); }
/** * Test of getLatitude method, of class Entertainment. */ @Test @SmallTest public void testGetLatitude() { System.out.println("getLongitude"); Entertainment instance = new Entertainment(); String expResult = "-26.1818356"; instance.setLatitude("-26.1818356"); String result = instance.getLatitude(); assertEquals(expResult, result); }
@Test @SmallTest public void testLayoutMatrixMirror() { final float layoutMatrix[] = getLayoutMatrix(true, 1.0f, 1.0f); // Assert: // u' = 1 - u. // v' = v. // clang-format off assertArrayEquals(new double[] { -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1}, round(layoutMatrix), 0.0); // clang-format on }