Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 111 for simulate (0.05 sec)

  1. src/test/java/jcifs/dcerpc/msrpc/SamrDomainHandleTest.java

            // Arrange
            int access = 0x01;
            int errorCode = 0xC0000022; // Example error code (STATUS_ACCESS_DENIED)
            // Simulate RPC error
            doAnswer(invocation -> {
                MsrpcSamrOpenDomain rpc = invocation.getArgument(0);
                rpc.retval = errorCode; // Simulate error
                return null;
            }).when(mockDcerpcHandle).sendrecv(any(MsrpcSamrOpenDomain.class));
    
            // Act & Assert
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  2. src/test/java/jcifs/dcerpc/msrpc/LsaPolicyHandleTest.java

            int access = 123;
    
            // Mock the behavior of sendrecv for MsrpcLsarOpenPolicy2
            doAnswer(invocation -> {
                MsrpcLsarOpenPolicy2 rpc = invocation.getArgument(0);
                rpc.retval = 0; // Simulate success
                return null;
            }).when(mockDcerpcHandle).sendrecv(any(MsrpcLsarOpenPolicy2.class));
    
            // Act
            LsaPolicyHandle handle = new LsaPolicyHandle(mockDcerpcHandle, server, access);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  3. src/test/java/jcifs/internal/witness/MockWitnessService.java

            if (serverSocket == null) {
                throw new IOException("Service not started");
            }
            return serverSocket.getLocalPort();
        }
    
        /**
         * Simulate a witness registration
         *
         * @param shareName the share name
         * @param serverAddress the server address
         * @param flags the registration flags
         * @return the registration ID
         */
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 23 09:06:40 UTC 2025
    - 8.2K bytes
    - Viewed (0)
  4. src/test/java/jcifs/util/transport/ResponseTest.java

        @Test
        void testGetGrantedCredits() {
            // Simulate granted credits
            when(mockResponse.getGrantedCredits()).thenReturn(100);
            assertEquals(100, mockResponse.getGrantedCredits());
    
            // Verify the method was called
            verify(mockResponse, times(1)).getGrantedCredits();
        }
    
        @Test
        void testGetErrorCode() {
            // Simulate error code
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 6.5K bytes
    - Viewed (0)
  5. src/main/java/jcifs/internal/smb2/rdma/disni/DisniRdmaConnection.java

            }
    
            try {
                // In real implementation, this would perform RDMA read into the buffer
                // For skeleton implementation, simulate reading the requested amount
                int bytesToRead = Math.min(length, buffer.remaining());
    
                // Simulate RDMA read operation
                log.debug("DiSNI RDMA read request: {} bytes from remote address 0x{}", bytesToRead, Long.toHexString(remoteAddress));
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 23 05:11:12 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb1/dcerpc/msrpc/LsaPolicyHandleTest.java

            int access = 123;
    
            // Mock the behavior of sendrecv for MsrpcLsarOpenPolicy2
            doAnswer(invocation -> {
                MsrpcLsarOpenPolicy2 rpc = invocation.getArgument(0);
                rpc.retval = 0; // Simulate success
                return null;
            }).when(mockDcerpcHandle).sendrecv(any(MsrpcLsarOpenPolicy2.class));
    
            // Act
            LsaPolicyHandle handle = new LsaPolicyHandle(mockDcerpcHandle, server, access);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.2K bytes
    - Viewed (0)
  7. src/test/java/jcifs/context/AbstractCIFSContextTest.java

            assertFalse(result); // AbstractCIFSContext always returns false for close()
            assertTrue(context.isCloseCalled());
        }
    
        @Test
        void testRun_successfulClose() throws CIFSException {
            // Simulate the shutdown hook being run
            context.run();
    
            assertTrue(context.isCloseCalled()); // Verify close() was called
        }
    
        @Test
        void testRun_closeThrowsException() throws CIFSException {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7K bytes
    - Viewed (0)
  8. src/test/java/jcifs/dcerpc/ndr/NdrObjectTest.java

                }
                // Simulate some encoding activity on the buffer
                dst.enc_ndr_long(123);
            }
    
            @Override
            public void decode(NdrBuffer src) throws NdrException {
                if (throwOnDecode) {
                    throw new NdrException("Failed to decode");
                }
                // Simulate some decoding activity on the buffer
                src.dec_ndr_long();
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 3.4K bytes
    - Viewed (0)
  9. src/test/java/jcifs/dcerpc/msrpc/SamrAliasHandleTest.java

            int rid = 100;
            int errorCode = 0xC0000022; // Example error code
    
            // Mock the behavior of sendrecv for MsrpcSamrOpenAlias to simulate failure
            doAnswer(invocation -> {
                MsrpcSamrOpenAlias rpc = invocation.getArgument(0);
                rpc.retval = errorCode; // Simulate failure
                return null;
            }).when(mockDcerpcHandle).sendrecv(any(MsrpcSamrOpenAlias.class));
    
            // Act & Assert
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 6.2K bytes
    - Viewed (0)
  10. src/test/java/jcifs/http/NtlmServletTest.java

    import jcifs.CIFSException;
    import jcifs.Configuration;
    import jcifs.NameServiceClient;
    import jcifs.smb.NtlmPasswordAuthentication;
    
    /**
     * Tests for the NtlmServlet class.
     * This class uses Mockito to simulate a servlet environment and test authentication logic.
     */
    @ExtendWith(MockitoExtension.class)
    class NtlmServletTest {
    
        // A concrete implementation of the abstract NtlmServlet for testing purposes.
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 21 04:51:33 UTC 2025
    - 11.5K bytes
    - Viewed (0)
Back to top