- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for thenThrow (0.13 sec)
- 
				
				src/test/java/jcifs/smb/SmbTreeHandleInternalTest.java} @Test @DisplayName("hasCapability(cap): propagates CIFSException on failure") void hasCapability_throws() throws Exception { // Arrange when(handle.hasCapability(anyInt())).thenThrow(new CIFSException("capability check failed")); // Act + Assert CIFSException ex = assertThrows(CIFSException.class, () -> handle.hasCapability(42));Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.3K 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 9.2K 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 7.1K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/SmbPipeOutputStreamTest.java// Arrange SmbPipeOutputStream out = newStream(); CIFSException boom = new CIFSException("tree-fail"); when(handle.ensureTreeConnected()).thenThrow(boom); // Act + Assert CIFSException ex = assertThrows(CIFSException.class, out::ensureTreeConnected); assertEquals("tree-fail", ex.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)
- 
				
				src/test/java/jcifs/smb/SmbTreeInternalTest.java} @Test @DisplayName("send throws CIFSException for null request when implementation does") void send_nullRequest_throws() throws Exception { // Arrange when(tree.send(isNull())).thenThrow(new CIFSException("null request")); // Act CIFSException ex = assertThrows(CIFSException.class, () -> tree.send(null)); // Assert assertEquals("null request", ex.getMessage());Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.6K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/SmbResourceLocatorInternalTest.java@Test @DisplayName("overlaps throws CIFSException when implementation fails") void overlapsThrowsCifsException() throws Exception { when(locator.overlaps(any())).thenThrow(new CIFSException("Simulated failure")); CIFSException ex = assertThrows(CIFSException.class, () -> locator.overlaps(other)); assertTrue(ex.getMessage().contains("Simulated failure"));Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 6.9K 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: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.9K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/SmbUnsupportedOperationExceptionTest.java// we need to use a method that can throw checked exceptions or wrap it in a RuntimeException @SuppressWarnings("unchecked") Supplier<String> supplier = mock(Supplier.class); when(supplier.get()).thenThrow(new RuntimeException(new SmbUnsupportedOperationException("boom"))); // Act & Assert: the exception is propagated and interaction recorded onceRegistered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.2K bytes - Viewed (0)
- 
				
				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);Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 6.2K bytes - Viewed (0)
- 
				
				src/test/java/jcifs/smb/DfsImplTest.java// Mock transport to throw IOException - simulating connection failure when(mockTransportPool.getSmbTransport(any(CIFSContext.class), anyString(), anyInt(), anyBoolean(), anyBoolean())) .thenThrow(new IOException("Connection failed")); // Instantiate the class under test dfsImpl = new DfsImpl(mockContext); } // Test for the constructor @Test void testDfsImplConstructor() {Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.5K bytes - Viewed (0)