- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 33 for getNtStatus (0.05 seconds)
-
src/test/java/jcifs/smb1/smb1/SmbExceptionTest.java
import org.junit.jupiter.params.provider.ValueSource; import org.mockito.junit.jupiter.MockitoExtension; /** * Unit tests for {@link SmbException}. * * The tests exercise the public API: constructors, {@link #getNtStatus()}, * {@link #getRootCause()}, and {@link #toString()}. */ @ExtendWith(MockitoExtension.class) class SmbExceptionTest { /** * Happy path – constructor with a valid NT status code (0). */Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Thu Aug 14 05:31:44 GMT 2025 - 4.5K bytes - Click Count (0) -
src/main/java/jcifs/smb/SmbOperationException.java
} } return "unknown"; } private long extractNtStatus(Throwable cause) { if (cause instanceof SmbException) { return ((SmbException) cause).getNtStatus(); } return 0; } private String extractServerMessage(Throwable cause) { if (cause instanceof SmbException) { // Try to get server message from SMB exceptionCreated: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Sat Aug 30 05:58:03 GMT 2025 - 16.5K bytes - Click Count (0) -
src/main/java/jcifs/smb1/smb1/SmbException.java
status = winerr ? errcode : getStatusByCode(errcode); } /** * Returns the NT status code for this exception. * * @return the NT status code */ public int getNtStatus() { return status; } /** * Returns the root cause of this exception if one exists * * @return the root cause throwable, or null if none exists */
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Sat Aug 16 01:32:48 GMT 2025 - 6K bytes - Click Count (0) -
src/main/java/jcifs/smb/SmbException.java
this.status = winerr ? errcode : getStatusByCode(errcode); } /** * Get the NT STATUS code associated with this exception * * @return status code */ public int getNtStatus() { return this.status; } /** * Get the root cause of this exception (deprecated - use getCause() instead) * * @return cause */ @Deprecated
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Sat Aug 16 01:32:48 GMT 2025 - 6.7K bytes - Click Count (0) -
src/test/java/jcifs/smb/SmbAuthExceptionTest.java
assertTrue(ex instanceof SmbException); assertEquals(SmbException.getMessageByCode(errCode), ex.getMessage(), "message should reflect error code mapping"); assertEquals(expectedStatus, ex.getNtStatus(), "status should map based on code"); assertNull(ex.getCause(), "cause must be null for int constructor"); assertNull(ex.getRootCause(), "rootCause must be null for int constructor"); } /**
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Thu Aug 14 05:31:44 GMT 2025 - 4.3K bytes - Click Count (0) -
src/test/java/jcifs/smb/SMBSignatureValidationExceptionTest.java
assertTrue(ex instanceof SmbException, "Should be an SmbException subtype"); // SmbException default ctor leaves status 0, which equals NT_STATUS_SUCCESS assertEquals(NtStatus.NT_STATUS_SUCCESS, ex.getNtStatus(), "Default status should be success (0)"); } // Edge/null/empty: message-only constructor should propagate message and set unsuccessful status @ParameterizedTest @NullSource
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Thu Aug 14 05:31:44 GMT 2025 - 5.3K bytes - Click Count (0) -
src/test/java/jcifs/smb1/smb1/SmbAuthExceptionTest.java
assertEquals(SmbException.getStatusByCode(code), e.getNtStatus(), "status for code " + Integer.toHexString(code)); } @Test void negativeCodeDefaultsToUnsuccessful() { SmbAuthException e = new SmbAuthException(-1); assertEquals(SmbException.getStatusByCode(-1), e.getNtStatus()); assertEquals(SmbException.getMessageByCode(-1), e.getMessage()); } @Test
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Thu Aug 14 05:31:44 GMT 2025 - 2.2K bytes - Click Count (0) -
src/test/java/jcifs/dcerpc/msrpc/SamrAliasHandleTest.java
SmbException thrown = assertThrows(SmbException.class, () -> { new SamrAliasHandle(mockDcerpcHandle, mockSamrDomainHandle, access, rid); }); assertEquals(errorCode, thrown.getNtStatus()); } @Test void close_shouldCloseAliasSuccessfully() throws IOException { // Arrange int access = 1; int rid = 100; // Mock constructor success
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) -
src/main/java/jcifs/smb/DirFileEntryEnumIterator1.java
} catch (final SmbException e) { if (this.response != null && this.response.isReceived() && e.getNtStatus() == NtStatus.NT_STATUS_NO_SUCH_FILE) { doClose(); return null; } throw e; } this.response.setSubCommand(SmbComTransaction.TRANS2_FIND_NEXT2);
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Thu Aug 14 07:14:38 GMT 2025 - 5.1K bytes - Click Count (0) -
src/test/java/jcifs/smb1/dcerpc/msrpc/LsaPolicyHandleTest.java
new LsaPolicyHandle(mockDcerpcHandle, server, access); }); // In smb1, non-NTSTATUS error codes get mapped to NT_STATUS_UNSUCCESSFUL (0xC0000001) assertEquals(0xC0000001, thrown.getNtStatus()); // NT_STATUS_UNSUCCESSFUL verify(mockDcerpcHandle, times(1)).sendrecv(any(MsrpcLsarOpenPolicy2.class)); } @Test void constructor_shouldThrowIOExceptionOnSendRecvFailure() throws IOException {
Created: Sun Apr 05 00:10:12 GMT 2026 - Last Modified: Thu Aug 14 05:31:44 GMT 2025 - 7.2K bytes - Click Count (0)