- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 19 for thenThrow (0.05 sec)
-
src/test/java/jcifs/NameServiceClientTest.java
// Arrange NetbiosAddress inputAddress = mock(NetbiosAddress.class); when(nameServiceClient.getNbtAllByAddress(inputAddress)).thenThrow(new UnknownHostException("Host not found")); // Act & Assert assertThrows(UnknownHostException.class, () -> nameServiceClient.getNbtAllByAddress(inputAddress));Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 15.4K bytes - Viewed (0) -
src/test/java/jcifs/SidResolverTest.java
when(sidResolver.getServerSid(eq(null), anyString())).thenThrow(new CIFSException("Context cannot be null")); assertThrows(CIFSException.class, () -> sidResolver.getServerSid(null, testServerName)); } @Test void testGetServerSid_NullServerName() throws CIFSException { when(sidResolver.getServerSid(any(CIFSContext.class), eq(null))).thenThrow(new CIFSException("Server name cannot be null"));
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 15.5K bytes - Viewed (0) -
src/test/java/jcifs/SmbTransportPoolTest.java
// Given when(transportPool.getSmbTransport(context, "unknown.host", DEFAULT_PORT, false, false)) .thenThrow(new UnknownHostException("Unknown host")); // When & Then assertThrows(UnknownHostException.class,Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 22.6K bytes - Viewed (0) -
src/test/java/jcifs/SmbTreeHandleTest.java
* @throws CIFSException */ @Test void testGetServerTimeZoneOffset_throwsCIFSException() throws CIFSException { when(smbTreeHandle.getServerTimeZoneOffset()).thenThrow(new CIFSException("Test Exception")); assertThrows(CIFSException.class, () -> smbTreeHandle.getServerTimeZoneOffset(), "getServerTimeZoneOffset() should throw CIFSException"); } /**Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 7.1K bytes - Viewed (0) -
src/test/java/jcifs/SmbTreeTest.java
/** * Test for unwrap() method throwing exception. * Verifies that unwrap can throw exceptions when appropriate. */ @Test void testUnwrap_throwsException() { when(smbTree.unwrap(any())).thenThrow(new ClassCastException("Cannot unwrap to specified type")); assertThrows(ClassCastException.class, () -> smbTree.unwrap(CustomSmbTree.class), "Should throw ClassCastException when type is incompatible");Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.2K bytes - Viewed (0) -
src/test/java/jcifs/AddressTest.java
@Test @DisplayName("toInetAddress should handle UnknownHostException") void testToInetAddressWithException() throws UnknownHostException { // Given when(mockAddress.toInetAddress()).thenThrow(new UnknownHostException("Host not found")); // When & Then assertThrows(UnknownHostException.class, () -> { mockAddress.toInetAddress(); }, "Should propagate UnknownHostException");Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.9K 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/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) -
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/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)