- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 44 for thenThrow (9.23 sec)
-
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 21K bytes - Viewed (0) -
src/test/java/jcifs/smb/ShareEnumIteratorTest.java
List<FileEntry> entries = Arrays.asList(entry("bad", SmbConstants.TYPE_SHARE), entry("good", SmbConstants.TYPE_SHARE)); // First call throws, second accepts when(filter.accept(any())).thenThrow(new CIFSException("boom")).thenReturn(true); ShareEnumIterator it = new ShareEnumIterator(parent, entries.iterator(), filter); assertTrue(it.hasNext()); SmbResource res = it.next();
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 8.1K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 18.1K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 15.7K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.5K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/create/CreateContextRequestTest.java
void testEncodeWithException() { CreateContextRequest request = mock(CreateContextRequest.class); byte[] buffer = new byte[100]; when(request.encode(any(byte[].class), anyInt())).thenThrow(new RuntimeException("Test error")); assertThrows(RuntimeException.class, () -> request.encode(buffer, 0)); } } @Nested @DisplayName("Test Implementation Tests")
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 24.9K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 20.7K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 13.2K bytes - Viewed (1) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 12.8K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.5K bytes - Viewed (0)