Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 44 for thenThrow (0.05 sec)

  1. src/test/java/jcifs/internal/fscc/FileSystemInformationTest.java

            void testDecodeException() throws SMBProtocolDecodingException {
                byte[] buffer = new byte[100];
                when(mockFileSystemInfo.decode(any(byte[].class), anyInt(), anyInt()))
                        .thenThrow(new SMBProtocolDecodingException("Test error"));
    
                assertThrows(SMBProtocolDecodingException.class, () -> {
                    mockFileSystemInfo.decode(buffer, 0, 100);
                });
            }
        }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  2. src/test/java/jcifs/pac/kerberos/KerberosTicketTest.java

            try (MockedStatic<KerberosEncData> mockedEncData = Mockito.mockStatic(KerberosEncData.class)) {
                mockedEncData.when(() -> KerberosEncData.decrypt(ENCRYPTED_DATA, kerberosKey, ENCRYPTION_TYPE))
                        .thenThrow(new GeneralSecurityException("Decryption error"));
    
                PACDecodingException e = assertThrows(PACDecodingException.class, () -> new KerberosTicket(token, (byte) 0, keys));
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.4K bytes
    - Viewed (0)
  3. src/test/java/jcifs/SmbWatchHandleTest.java

        @Test
        void testWatchThrowsCIFSException() throws CIFSException {
            // Setup mock behavior
            CIFSException expectedException = new CIFSException("Watch operation failed");
            when(watchHandle.watch()).thenThrow(expectedException);
    
            // Execute and verify
            CIFSException thrown = assertThrows(CIFSException.class, () -> {
                watchHandle.watch();
            });
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 13.2K bytes
    - Viewed (0)
  4. src/test/java/jcifs/dcerpc/DcerpcPipeHandleTest.java

                DcerpcPipeHandle handle = createMockedDcerpcPipeHandle();
                CIFSException exception = new CIFSException("Test exception");
                when(mockSmbPipeHandleInternal.getSessionKey()).thenThrow(exception);
                assertThrows(CIFSException.class, handle::getSessionKey);
            }
        }
    
        @Nested
        @DisplayName("Send/Receive Fragment Tests")
        class SendReceiveFragmentTests {
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 21K bytes
    - Viewed (0)
  5. src/test/java/jcifs/internal/CommonServerMessageBlockTest.java

        void testDecodeThrowsException() throws SMBProtocolDecodingException {
            // Given
            byte[] buffer = new byte[10];
            int bufferIndex = 0;
    
            when(messageBlock.decode(buffer, bufferIndex)).thenThrow(new SMBProtocolDecodingException("Invalid buffer"));
    
            // When & Then
            assertThrows(SMBProtocolDecodingException.class, () -> messageBlock.decode(buffer, bufferIndex));
        }
    
        @Test
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.7K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb/SmbWatchHandleImplTest.java

            when(handle.getFileId()).thenReturn(new byte[16]);
            when(tree.send(any(CommonServerMessageBlockRequest.class), any(), any(), any()))
                    .thenThrow(new SmbException(0xC0000120, (Throwable) null));
            SmbWatchHandleImpl sut = new SmbWatchHandleImpl(handle, 0, false);
    
            List<FileNotifyInformation> result = sut.watch();
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  7. src/test/java/jcifs/smb/SmbFileInputStreamTest.java

            void readSingleByteEOF() throws Exception {
                // Arrange SMB2 EOF via NT status code mapping in SmbFileInputStream
                when(mockTree.send(any(Request.class), any(RequestParam.class))).thenThrow(new SmbException(0xC0000011, false)); // STATUS_END_OF_FILE
    
                SmbFileInputStream in = newStream();
                int v = in.read();
                assertEquals(-1, v);
            }
        }
    
        @Nested
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 12.8K bytes
    - Viewed (0)
  8. src/test/java/jcifs/config/DelegatingConfigurationTest.java

        void testExceptionHandling() {
            // Given
            RuntimeException testException = new RuntimeException("Test exception");
            when(mockDelegate.getResponseTimeout()).thenThrow(testException);
    
            // When & Then
            RuntimeException thrownException = assertThrows(RuntimeException.class, () -> {
                delegatingConfig.getResponseTimeout();
            });
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 20.7K bytes
    - Viewed (0)
  9. src/test/java/jcifs/smb/DirFileEntryEnumIteratorBaseTest.java

        void nameFilterThrowsIsHandled() throws Exception {
            // Arrange
            stubAcquireReturnsSelf();
            when(nameFilter.accept(parent, "bad")).thenThrow(new CIFSException("bad name"));
            when(nameFilter.accept(parent, "good")).thenReturn(true);
    
            FileEntry initial = entry("first");
            FileEntry[] page1 = new FileEntry[] { entry("bad"), entry("good") };
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.5K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/create/CreateContextResponseTest.java

                CreateContextResponse response = mock(CreateContextResponse.class);
                byte[] buffer = new byte[100];
                when(response.decode(any(byte[].class), anyInt(), anyInt())).thenThrow(new SMBProtocolDecodingException("Test error"));
    
                assertThrows(SMBProtocolDecodingException.class, () -> response.decode(buffer, 0, 10));
            }
        }
    
        @Nested
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 16.2K bytes
    - Viewed (0)
Back to top