- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 44 for thenThrow (0.05 sec)
- 
				
				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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.4K bytes - Viewed (0)
- 
				
				guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.javaTestApplication application = new TestApplication(); ExecutorService service = mock(ExecutorService.class); application.addDelayedShutdownHook(service, 2, SECONDS); when(service.awaitTermination(2, SECONDS)).thenThrow(new InterruptedException()); application.shutdown(); verify(service).shutdown(); } public void testGetExitingExecutorService_executorSetToUseDaemonThreads() { Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Tue May 13 18:46:00 UTC 2025 - 28K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/NetServerEnumIteratorTest.javawhen(locator.getType()).thenReturn(SmbConstants.TYPE_WORKGROUP); when(locator.getURL()).thenReturn(createSmbURL("smb://")); when(nameFilter.accept(any(SmbResource.class), anyString())).thenThrow(new CIFSException("Filter error")); // Mock response when(treeHandle.send(any(), any(), (RequestParam[]) any())).thenAnswer(invocation -> { return invocation.getArgument(1); }); Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.8K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/SmbResourceLocatorImplTest.javaassertSame(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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 17.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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 21 11:13:46 UTC 2025 - 7.7K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/SmbSessionImplTest.javavoid 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 12.5K 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 12.6K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/ShareEnumIteratorTest.javaList<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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 8.1K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/util/HMACT64Test.javamockedCrypto.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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.6K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/SmbPipeInputStreamTest.javawhen(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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.9K bytes - Viewed (0)