Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for testAutoCloseable (0.22 sec)

  1. src/test/java/jcifs/SmbWatchHandleTest.java

            verify(watchHandle, times(1)).close();
        }
    
        /**
         * Test AutoCloseable behavior with try-with-resources
         */
        @Test
        void testAutoCloseable() throws CIFSException {
            // Create a mock that tracks close calls
            SmbWatchHandle autoCloseableHandle = mock(SmbWatchHandle.class);
            when(autoCloseableHandle.watch()).thenReturn(mockNotifications);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 13.2K bytes
    - Viewed (0)
  2. src/test/java/jcifs/util/SecureCredentialStorageTest.java

            }, "Should throw IllegalStateException after destroy");
    
            // Clean up
            Arrays.fill(plaintext, '\0');
        }
    
        @Test
        public void testAutoCloseable() throws Exception {
            char[] plaintext = "AutoCloseTest".toCharArray();
            SecureCredentialStorage autoStorage = null;
    
            try {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 12.7K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/NtlmPasswordAuthenticatorTest.java

        }
    
        /**
         * Test AutoCloseable implementation
         */
        @Test
        @DisplayName("Test AutoCloseable with try-with-resources")
        public void testAutoCloseable() {
            char[] testPassword = "AutoClosePass123!".toCharArray();
    
            try (NtlmPasswordAuthenticator auth = new NtlmPasswordAuthenticator("user", testPassword)) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 23.3K bytes
    - Viewed (0)
  4. src/test/java/jcifs/util/SecureKeyManagerTest.java

            keyManager.close();
            keyManager.close(); // Should not throw
    
            assertEquals(0, keyManager.getKeyCount(), "Should have no keys after close");
        }
    
        @Test
        public void testAutoCloseable() throws Exception {
            try (SecureKeyManager manager = new SecureKeyManager()) {
                manager.storeSessionKey("auto-session", testKey, "AES");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 30 05:58:03 UTC 2025
    - 14.2K bytes
    - Viewed (0)
  5. src/test/java/jcifs/SmbResourceTest.java

                verify(mockResource).close();
            }
    
            @Test
            @DisplayName("resource should be AutoCloseable")
            void testAutoCloseable() {
                // Given
                SmbResource resource = createMockResource();
    
                // When/Then
                assertDoesNotThrow(() -> {
                    try (SmbResource r = resource) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 35K bytes
    - Viewed (0)
  6. src/test/java/jcifs/internal/smb2/Smb2EncryptionContextTest.java

            assertFalse(context.needsKeyRotation(), "Should not need rotation after reset");
        }
    
        @Test
        @DisplayName("Should implement AutoCloseable and securely wipe keys on close")
        void testAutoCloseable() {
            // Given
            byte[] encKey = new byte[16];
            byte[] decKey = new byte[16];
            new SecureRandom().nextBytes(encKey);
            new SecureRandom().nextBytes(decKey);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 44.1K bytes
    - Viewed (0)
Back to top