- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 47 for thenThrow (0.19 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: Sat Dec 20 13:44:44 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.java
TestApplication 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 Dec 26 12:43:10 UTC 2025 - Last Modified: Fri Dec 12 00:25:21 UTC 2025 - 26.5K bytes - Viewed (0) -
src/test/java/jcifs/smb/NetServerEnumIteratorTest.java
when(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: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.8K 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/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/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/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) -
impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/StrategyOrchestratorTest.java
when(mockStrategies.get(0).isApplicable(context)).thenReturn(true); when(mockStrategies.get(0).apply(Mockito.eq(context), Mockito.any())) .thenThrow(new RuntimeException("Strategy failed")); when(mockStrategies.get(1).isApplicable(context)).thenReturn(false); when(mockStrategies.get(2).isApplicable(context)).thenReturn(false);
Registered: Sun Dec 28 03:35:09 UTC 2025 - Last Modified: Tue Nov 18 18:03:26 UTC 2025 - 12.3K bytes - Viewed (0) -
android/guava-tests/test/com/google/common/util/concurrent/MoreExecutorsTest.java
TestApplication 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 Dec 26 12:43:10 UTC 2025 - Last Modified: Fri Dec 12 00:25:21 UTC 2025 - 26.5K bytes - Viewed (0)