Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for thenThrow (0.21 sec)

  1. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 15.5K bytes
    - Viewed (0)
  2. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.4K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SmbEnumerationUtilTest.java

                when(locator.getURL()).thenReturn(anyUrlWithEmptyHost);
                // Simulate failure to find master browser (UnknownHost wrapped in CIFSException)
                when(locator.getAddress()).thenThrow(new CIFSException("no master", new UnknownHostException("MB")));
    
                // Act + Assert: the code maps this case to SmbUnsupportedOperationException
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 17.1K bytes
    - Viewed (0)
  4. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 22.6K bytes
    - Viewed (0)
  5. src/test/java/jcifs/smb/SmbCopyUtilTest.java

            SmbFileHandleImpl handle = mock(SmbFileHandleImpl.class);
            SmbAuthException authEx = new SmbAuthException("denied");
    
            when(dest.openUnshared(anyInt(), anyInt(), anyInt(), anyInt(), anyInt())).thenThrow(authEx) // first attempt fails with auth
                    .thenReturn(handle); // second attempt succeeds
    
            // dest currently has READONLY attribute set
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 12.1K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb/SmbTransportPoolImplTest.java

            when(trans1.unwrap(SmbTransportImpl.class)).thenReturn(trans1);
            when(trans1.ensureConnected()).thenThrow(firstException);
            doNothing().when(trans1).close();
    
            when(trans2.unwrap(SmbTransportImpl.class)).thenReturn(trans2);
            when(trans2.ensureConnected()).thenThrow(secondException);
            doNothing().when(trans2).close();
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 19.2K bytes
    - Viewed (0)
  7. src/test/java/jcifs/smb/SmbTreeConnectionTest.java

            // Configure the tree to throw transport error on first call, succeed on second
            when(tree.send(eq(req), eq(resp), anySet()))
                    .thenThrow(new SmbException("transport error", new jcifs.util.transport.TransportException()))
                    .thenReturn(resp);
    
            setTree(c, tree);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 13K bytes
    - Viewed (0)
  8. src/test/java/jcifs/smb/Kerb5ContextTest.java

        void calculateMIC_failure_wraps() throws Exception {
            byte[] data = new byte[] { 0 };
            when(gssContext.getMIC(any(), anyInt(), anyInt(), any())).thenThrow(new GSSException(GSSException.FAILURE));
    
            CIFSException ex = assertThrows(CIFSException.class, () -> ctx.calculateMIC(data));
            assertTrue(ex.getMessage().contains("Failed to calculate MIC"));
        }
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 14.2K bytes
    - Viewed (0)
  9. src/test/java/jcifs/smb/FileEntryAdapterIteratorTest.java

            FileEntry entry2 = mock(FileEntry.class);
    
            when(delegate.hasNext()).thenReturn(true, true, false);
            when(delegate.next()).thenReturn(entry1, entry2);
            when(filter.accept(resource)).thenThrow(new CIFSException("Error")).thenReturn(true);
    
            TestIterator iterator = new TestIterator(filter);
    
            // Verify iteration
            assertTrue(iterator.hasNext());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  10. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.4K bytes
    - Viewed (0)
Back to top