Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 34 for defensively (0.14 sec)

  1. src/test/java/jcifs/smb1/smb1/AllocInfoTest.java

            assertEquals(capacity, mockAllocInfo.getCapacity());
        }
    
        /**
         * Null pointer scenario – calls on a null reference should raise
         * {@link NullPointerException}. This test is defensive; in real code it
         * would likely be handled elsewhere.
         */
        @Test
        @DisplayName("calling getters on null reference throws NPE")
        void testNullReference() {
            AllocInfo nullRef = null;
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 2.4K bytes
    - Viewed (0)
  2. okhttp/src/commonJvmAndroid/kotlin/okhttp3/ConnectionSpec.kt

            require(tls) { "no cipher suites for cleartext connections" }
            require(cipherSuites.isNotEmpty()) { "At least one cipher suite is required" }
    
            this.cipherSuites = cipherSuites.copyOf() as Array<String> // Defensive copy.
          }
    
        fun allEnabledTlsVersions() =
          apply {
            require(tls) { "no TLS versions for cleartext connections" }
            this.tlsVersions = null
          }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 13.4K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SessionSetupHandlerTest.java

        }
    
        @Test
        @DisplayName("Invalid: resolving class by null name throws NPE")
        void testClassForNameWithNull() {
            // Intent: demonstrate defensive behavior with null when resolving this type by name
            assertThrows(NullPointerException.class, () -> Class.forName(null));
        }
    
        @Test
        @DisplayName("Happy path: class is loadable via fully qualified name")
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.3K bytes
    - Viewed (0)
  4. src/test/java/jcifs/smb/PreauthIntegrityTest.java

                // Verify the reset method exists
                assertNotNull(resetMethod);
            }
        }
    
        /**
         * Test that getPreauthIntegrityHash returns a defensive copy
         */
        @Test
        @DisplayName("getPreauthIntegrityHash should return defensive copy")
        void testGetPreauthHashDefensiveCopy() throws Exception {
            byte[] hash = transport.getPreauthIntegrityHash();
            assertNotNull(hash);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 10.5K bytes
    - Viewed (0)
  5. src/test/java/jcifs/internal/smb2/lease/Smb2LeaseKeyTest.java

            Smb2LeaseKey key2 = new Smb2LeaseKey();
    
            assertNotEquals(key1, key2);
            assertFalse(Arrays.equals(key1.getKey(), key2.getKey()));
        }
    
        @Test
        @DisplayName("Should return defensive copy of key")
        void testDefensiveCopy() {
            byte[] originalBytes =
                    new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 };
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 21 00:16:17 UTC 2025
    - 6K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb/SmbFilenameFilterTest.java

            // Verify getPath was called three times (once for each accept call)
            verify(mockDir, times(3)).getPath();
            verifyNoMoreInteractions(mockDir);
        }
    
        /**
         * Defensive behavior: implementation throws NPE on null inputs by design.
         */
        @Test
        @DisplayName("implementation explicitly rejects nulls with NPE")
        void implementationRejectsNulls() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  7. src/test/java/jcifs/smb/SmbFileFilterTest.java

            verifyNoMoreInteractions(smbFile);
        }
    
        @Test
        @DisplayName("accept: rejects null input with meaningful NullPointerException")
        void accept_rejectsNullInput() {
            // Arrange: defensive filter that validates input
            SmbFileFilter filter = f -> {
                if (f == null) {
                    throw new NullPointerException("file must not be null");
                }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  8. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

        }
    
      fun getBody(): Buffer? = body?.clone()
    
      fun setBody(body: Buffer) =
        apply {
          setHeader("Content-Length", body.size)
          this.body = body.clone() // Defensive copy.
        }
    
      fun setBody(body: String): MockResponse = setBody(Buffer().writeUtf8(body))
    
      fun setChunkedBody(
        body: Buffer,
        maxChunkSize: Int,
      ) = apply {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat May 10 11:15:14 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  9. okhttp-tls/src/main/kotlin/okhttp3/tls/HandshakeCertificates.kt

          heldCertificate: HeldCertificate,
          vararg intermediates: X509Certificate,
        ) = apply {
          this.heldCertificate = heldCertificate
          this.intermediates = arrayOf(*intermediates) // Defensive copy.
        }
    
        /**
         * Add a trusted root certificate to use when authenticating a peer. Peers must provide
         * a chain of certificates whose root is one of these.
         */
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat May 10 11:15:14 UTC 2025
    - 8.4K bytes
    - Viewed (0)
  10. src/main/java/jcifs/internal/smb2/Smb2EncryptionContext.java

            }
    
            byte[] key = null;
            byte[] keyCopy = null;
    
            try {
                // Get the key and create a defensive copy for SecretKeySpec
                key = encrypt ? getEncryptionKey() : getDecryptionKey();
                keyCopy = Arrays.copyOf(key, key.length);
    
                // Validate key length matches expected cipher requirements
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 35.5K bytes
    - Viewed (0)
Back to top