Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 46 for thenThrow (0.06 seconds)

  1. src/test/java/jcifs/smb/DosFileFilterTest.java

            // and a mock file that throws an exception when getAttributes is called
            SmbException expectedException = new SmbException("Failed to get attributes");
            when(mockFile.getAttributes()).thenThrow(expectedException);
    
            // When calling accept
            // Then an SmbException should be thrown
            SmbException thrown = assertThrows(SmbException.class, () -> {
                dosFileFilter.accept(mockFile);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 6.2K bytes
    - Click Count (0)
  2. 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 channels
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 21 11:13:46 GMT 2025
    - 7.7K bytes
    - Click Count (0)
  3. 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);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 17.6K bytes
    - Click Count (0)
  4. 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();
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 8.1K bytes
    - Click Count (0)
  5. 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() {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 16 22:45:21 GMT 2026
    - 26.1K bytes
    - Click Count (0)
  6. 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);
            });
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 9.8K bytes
    - Click Count (0)
  7. 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() {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Mon Mar 16 22:45:21 GMT 2026
    - 26.1K bytes
    - Click Count (0)
  8. 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, () -> {
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 07:14:38 GMT 2025
    - 12.6K bytes
    - Click Count (0)
  9. 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);
        }
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 12.5K bytes
    - Click Count (0)
  10. 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);
    
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Tue Nov 18 18:03:26 GMT 2025
    - 12.3K bytes
    - Click Count (0)
Back to Top