Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 30 for assertEquals (0.18 sec)

  1. okhttp/src/test/java/okhttp3/HttpUrlTest.kt

        val hostNfcPunycode = "xn--caf-dma.com"
        val hostNfd = "cafeĢ.com"
        val hostNfdPunycode = "xn--cafe-yvc.com"
        assertEquals(hostNfcPunycode, "http://$hostNfc/".toHttpUrl().host)
        assertEquals(hostNfcPunycode, "http://$hostNfcPunycode/".toHttpUrl().host)
        assertEquals(hostNfcPunycode, "http://$hostNfd/".toHttpUrl().host)
        if (isJvm) return // TODO: the rest of this test is broken on JVM platforms.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 67.9K bytes
    - Viewed (0)
  2. okhttp-tls/src/test/java/okhttp3/tls/CertificatesJavaTest.java

     * limitations under the License.
     */
    package okhttp3.tls;
    
    import java.security.cert.X509Certificate;
    import org.junit.jupiter.api.Test;
    
    import static org.junit.jupiter.api.Assertions.assertEquals;
    
    public class CertificatesJavaTest {
      @Test
      public void testRoundtrip() {
        String certificateString = ""
          + "-----BEGIN CERTIFICATE-----\n"
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Nov 20 02:23:18 GMT 2020
    - 1.8K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/idn/IdnaMappingTableTest.kt

        assertEquals(3, binarySearch(0, 5) { index -> 7.compareTo(table[index]) })
        assertEquals(4, binarySearch(0, 5) { index -> 9.compareTo(table[index]) })
    
        // Search for misses.
        assertEquals(-1, binarySearch(0, 5) { index -> 0.compareTo(table[index]) })
        assertEquals(-2, binarySearch(0, 5) { index -> 2.compareTo(table[index]) })
        assertEquals(-3, binarySearch(0, 5) { index -> 4.compareTo(table[index]) })
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/CallKotlinTest.kt

        server.enqueue(MockResponse(body = "abc"))
    
        val request = Request.Builder().url(server.url("/")).build()
    
        val response = client.newCall(request).execute()
    
        response.use {
          assertEquals(200, response.code)
          assertEquals(
            "CN=localhost",
            (response.handshake!!.peerCertificates.single() as X509Certificate).subjectDN.name,
          )
        }
      }
    
      private fun enableTls() {
        client =
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/CertificatePinnerTest.kt

          CertificatePinner.Pin(
            "**.example.co.uk",
            "sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
          )
        assertEquals(
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=".decodeBase64(),
          pin.hash,
        )
        assertEquals("sha256", pin.hashAlgorithm)
        assertEquals("**.example.co.uk", pin.pattern)
        Assertions.assertTrue(pin.matchesHostname("www.example.co.uk"))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/idn/StringprepTablesReaderTest.kt

     * limitations under the License.
     */
    package okhttp3.internal.idn
    
    import assertk.assertThat
    import assertk.assertions.hasSize
    import kotlin.test.Test
    import kotlin.test.assertEquals
    import okio.Buffer
    import okio.FileSystem
    import okio.Path.Companion.toPath
    
    class StringprepTablesReaderTest {
      @Test fun readRfc3491FromResources() {
        val reader = StringprepTablesReader(FileSystem.RESOURCES)
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/MediaTypeGetTest.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3
    
    import kotlin.test.assertEquals
    import kotlin.test.assertFailsWith
    import okhttp3.MediaType.Companion.toMediaType
    
    open class MediaTypeGetTest : MediaTypeTest() {
      override fun parse(string: String): MediaType = string.toMediaType()
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/SessionReuseTest.kt

        server.enqueue(MockResponse(body = "abc2"))
    
        val request = Request(server.url("/"))
    
        client.newCall(request).execute().use { response ->
          assertEquals(200, response.code)
        }
    
        client.connectionPool.evictAll()
        assertEquals(0, client.connectionPool.connectionCount())
    
        // Force reuse. This appears flaky (30% of the time) even though sessions are reused.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 6K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/authenticator/JavaNetAuthenticatorTest.kt

    import okhttp3.Request
    import okhttp3.Response
    import okhttp3.TestValueFactory
    import okhttp3.internal.RecordingAuthenticator
    import org.junit.jupiter.api.AfterEach
    import org.junit.jupiter.api.Assertions.assertEquals
    import org.junit.jupiter.api.BeforeEach
    import org.junit.jupiter.api.Test
    
    // Most tests from URLConnectionTest
    class JavaNetAuthenticatorTest {
      private var authenticator = JavaNetAuthenticator()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  10. regression-test/src/androidTest/java/okhttp/regression/compare/OkHttpClientTest.java

        Request request = new Request.Builder()
            .url("https://google.com/robots.txt")
            .build();
        try (Response response = client.newCall(request).execute()) {
          assertEquals(200, response.code());
          assertEquals(Protocol.HTTP_2, response.protocol());
        }
      }
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Nov 14 17:38:22 GMT 2020
    - 1.4K bytes
    - Viewed (0)
Back to top