Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for PlatformVersion (0.13 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/testing/PlatformVersion.kt

     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.testing
    
    object PlatformVersion {
      val majorVersion: Int by lazy {
        when (val jvmSpecVersion = getJvmSpecVersion()) {
          "1.8" -> 8
          else -> jvmSpecVersion.toInt()
        }
      }
    
      fun getJvmSpecVersion(): String {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Wed Dec 20 23:27:07 UTC 2023
    - 917 bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/JSSETest.kt

        val response = client.newCall(request).execute()
    
        response.use {
          assertEquals(200, response.code)
          if (PlatformVersion.majorVersion > 11) {
            assertEquals(TlsVersion.TLS_1_3, response.handshake?.tlsVersion)
          }
          if (PlatformVersion.majorVersion > 8) {
            assertEquals(Protocol.HTTP_2, response.protocol)
          }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/testing/PlatformRule.kt

            }
          }
    
        fun fromMajor(version: Int): Matcher<PlatformVersion> {
          return object : TypeSafeMatcher<PlatformVersion>() {
            override fun describeTo(description: Description) {
              description.appendText("JDK with version from $version")
            }
    
            override fun matchesSafely(item: PlatformVersion): Boolean {
              return item.majorVersion >= version
            }
          }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 15.3K bytes
    - Viewed (0)
  4. samples/compare/src/test/kotlin/okhttp3/compare/JavaHttpClientTest.kt

    import java.net.http.HttpRequest
    import java.net.http.HttpResponse.BodyHandlers
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.testing.PlatformRule
    import okhttp3.testing.PlatformVersion
    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.extension.RegisterExtension
    
    /**
     * Java HTTP Client.
     *
     * https://openjdk.java.net/groups/net/httpclient/intro.html
     *
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  5. okhttp-testing-support/src/test/kotlin/okhttp3/testing/PlatformRuleTest.kt

      }
    
      @Test
      fun testGreenCase() {
      }
    
      @Test
      fun testGreenCaseFailingOnLater() {
        platform.expectFailureFromJdkVersion(PlatformVersion.majorVersion + 1)
      }
    
      @Test
      fun failureCase() {
        platform.expectFailureFromJdkVersion(PlatformVersion.majorVersion)
    
        check(false)
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 14:55:09 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/SessionReuseTest.kt

    import javax.net.ssl.SSLSocket
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    import okhttp3.testing.Flaky
    import okhttp3.testing.PlatformRule
    import okhttp3.testing.PlatformVersion
    import okio.ByteString.Companion.toByteString
    import org.junit.jupiter.api.Assertions.assertEquals
    import org.junit.jupiter.api.Assertions.assertNotEquals
    import org.junit.jupiter.api.Assumptions.assumeTrue
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 6K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/ConnectionSpecTest.kt

    import kotlin.test.assertFailsWith
    import okhttp3.internal.applyConnectionSpec
    import okhttp3.internal.platform.Platform.Companion.isAndroid
    import okhttp3.testing.PlatformRule
    import okhttp3.testing.PlatformVersion.majorVersion
    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.extension.RegisterExtension
    
    class ConnectionSpecTest {
      @RegisterExtension
      val platform = PlatformRule()
    
      @Test
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/HttpUrlTest.kt

    import kotlin.test.assertEquals
    import kotlin.test.assertFailsWith
    import kotlin.test.fail
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.UrlComponentEncodingTester.Encoding
    import okhttp3.testing.PlatformVersion
    
    @Suppress("HttpUrlsUsage") // Don't warn if we should be using https://.
    open class HttpUrlTest {
      protected open fun parse(url: String): HttpUrl {
        return url.toHttpUrl()
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 67.9K bytes
    - Viewed (0)
Back to top