- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 44 for thenThrow (1.12 sec)
-
src/test/java/jcifs/smb/SmbResourceLocatorImplTest.java
assertSame(a3, l3.getNextAddress()); assertFalse(l3.hasNextAddress()); // UnknownHostException yields CIFSException when(nsc.getAllByName("badhost", true)).thenThrow(new UnknownHostException("nope")); SmbResourceLocatorImpl bad = locator("smb://badhost/"); CIFSException ex = assertThrows(CIFSException.class, bad::getAddress);
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 17.6K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbTreeHandleImplTest.java
assertTrue(handle.hasCapability(123)); verify(treeConnection).hasCapability(123); // Exception path when(treeConnection.hasCapability(999)).thenThrow(new SmbException("Not connected")); SmbException ex = assertThrows(SmbException.class, () -> handle.hasCapability(999)); assertTrue(ex.getMessage().contains("Not connected")); } @Test
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.4K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbFileFilterTest.java
// Arrange: filter delegates to isDirectory which may throw SmbException SmbFileFilter filter = f -> f.isDirectory(); SmbException boom = new SmbException("io error"); when(smbFile.isDirectory()).thenThrow(boom); // Act + Assert SmbException thrown = assertThrows(SmbException.class, () -> filter.accept(smbFile)); assertEquals("io error", thrown.getMessage());Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.4K bytes - Viewed (0) -
src/test/java/jcifs/http/NtlmHttpURLConnectionTest.java
* @throws IOException */ @Test void testHandshakeThrowsRuntimeExceptionOnFailure() throws Exception { // Arrange when(mockConnection.getHeaderField(0)).thenThrow(new RuntimeException("Connection failed")); doNothing().when(mockConnection).connect(); // Act & Assert assertThrows(RuntimeCIFSException.class, () -> {Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 12.6K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbSessionImplTest.java
void testReauthenticatePropagates() throws Exception { SmbSessionImpl session = newSession(); // Cause the inner reauthenticate to fail at first transport call when(transport.getNegotiateResponse()).thenThrow(new SmbException("fail")); assertThrows(CIFSException.class, session::reauthenticate); }
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 12.5K bytes - Viewed (0) -
src/test/java/jcifs/util/HMACT64Test.java
mockedCrypto.when(Crypto::getMD5).thenReturn(mockMd5); HMACT64 originalHmac = new HMACT64(TEST_KEY); when(mockMd5.clone()).thenThrow(new CloneNotSupportedException("Test Clone Not Supported")); assertThrows(IllegalStateException.class, originalHmac::clone); } }
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.6K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/multichannel/ChannelFailoverTest.java
} @Test void testFailureWithNoAlternativeChannels() throws Exception { failedChannel.addPendingOperation(mockOperation); when(mockLoadBalancer.selectChannel(mockOperation)).thenThrow(new ChannelLoadBalancer.NoAvailableChannelException("No channels")); IOException error = new IOException("Connection failed"); // Should not throw exception even if no alternative channelsRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 21 11:13:46 UTC 2025 - 7.7K bytes - Viewed (0) -
src/test/java/jcifs/smb/SmbPipeInputStreamTest.java
when(tree.getConfig()).thenReturn(config); when(config.getTransactionBufferSize()).thenReturn(65535); when(tree.send(any(Smb2IoctlRequest.class), eq(RequestParam.NO_RETRY))).thenThrow(new SmbException("boom")); IOException ex = assertThrows(IOException.class, stream::available, "Should convert SmbException to IOException"); assertTrue(ex.getMessage().contains("boom")); }
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.9K bytes - Viewed (0) -
fess-crawler/src/test/java/org/codelibs/fess/crawler/processor/impl/SitemapsResponseProcessorTest.java
responseData.setResponseBody(content); when(crawlerContainer.getComponent("sitemapsHelper")).thenReturn(sitemapsHelper); when(sitemapsHelper.parse(any(InputStream.class))).thenThrow(new RuntimeException("Parse error")); // Execute and verify RuntimeException is thrown try { processor.process(responseData); fail("Should throw RuntimeException");
Registered: Sat Dec 20 11:21:39 UTC 2025 - Last Modified: Thu Nov 13 13:29:22 UTC 2025 - 12K bytes - Viewed (0) -
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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.4K bytes - Viewed (0)