Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 30 for hasCapability (0.08 seconds)

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

        }
    
        // Happy path: hasCapability returns based on provided capability codes
        @ParameterizedTest
        @DisplayName("hasCapability returns expected values for various caps")
        @ValueSource(ints = { -1, 0, 1, 1024 })
        void hasCapability_variousCaps(int cap) throws SmbException {
            when(transport.hasCapability(anyInt())).thenAnswer(inv -> ((int) inv.getArgument(0)) >= 0);
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 07:14:38 GMT 2025
    - 12.1K bytes
    - Click Count (0)
  2. src/test/java/jcifs/smb/SmbTreeHandleInternalTest.java

        @DisplayName("hasCapability(cap): returns configured value and captures argument across edge caps")
        void hasCapability_variousCaps_returnsTrue_andCapturesArgument(int cap) throws Exception {
            // Arrange: stub to return true regardless of input
            when(handle.hasCapability(anyInt())).thenReturn(true);
    
            // Act
            boolean result = handle.hasCapability(cap);
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 9.3K bytes
    - Click Count (0)
  3. src/test/java/jcifs/smb/SmbTreeHandleImplTest.java

        }
    
        @Test
        @DisplayName("hasCapability delegates and propagates exceptions")
        void hasCapabilityDelegates() throws Exception {
            // Happy path delegates; invalid case propagates SmbException
            when(treeConnection.hasCapability(123)).thenReturn(true);
            assertTrue(handle.hasCapability(123));
            verify(treeConnection).hasCapability(123);
    
            // Exception path
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 14.4K bytes
    - Click Count (0)
  4. src/main/java/jcifs/smb/SmbTreeHandleInternal.java

         * @param cap the capability flag to check
         * @return whether the capability is present
         * @throws CIFSException if an error occurs checking capabilities
         */
        boolean hasCapability(int cap) throws CIFSException;
    
        /**
         * Gets the send buffer size of the underlying SMB connection
         * @return the send buffer size of the underlying connection
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 16 01:32:48 GMT 2025
    - 3K bytes
    - Click Count (0)
  5. src/test/java/jcifs/smb/SmbWatchHandleImplTest.java

            when(handle.getTree()).thenReturn(tree);
            when(tree.isSMB2()).thenReturn(false);
            when(tree.getConfig()).thenReturn(mock(Configuration.class));
            when(tree.hasCapability(SmbConstants.CAP_NT_SMBS)).thenReturn(true);
            when(handle.getFid()).thenReturn(fid);
            when(tree.send(any(CommonServerMessageBlockRequest.class), any(), any(), any())).thenReturn(resp);
        }
    
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 11.5K bytes
    - Click Count (0)
  6. src/main/java/jcifs/smb/SmbTreeHandleImpl.java

        public void ensureDFSResolved() throws CIFSException {
            this.treeConnection.ensureDFSResolved(this.resourceLoc);
        }
    
        @Override
        public boolean hasCapability(final int cap) throws SmbException {
            return this.treeConnection.hasCapability(cap);
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.SmbTreeHandle#isConnected()
         */
        @Override
        public boolean isConnected() {
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sun Aug 31 08:00:57 GMT 2025
    - 11.1K bytes
    - Click Count (0)
  7. src/test/java/jcifs/smb/SmbTreeConnectionTraceTest.java

            // Act
            Configuration result = trace.getConfig();
    
            // Assert
            assertSame(cfg, result);
            verify(ctx, times(1)).getConfig();
        }
    
        @Test
        @DisplayName("hasCapability(): without session/tree throws SmbException")
        void hasCapability_withoutTree_throwsSmbException() {
            // Arrange
            CIFSContext ctx = mock(CIFSContext.class);
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 05:31:44 GMT 2025
    - 8.7K bytes
    - Click Count (0)
  8. src/main/java/jcifs/smb/SmbTransportInternal.java

         *
         * @param cap the capability flag to check
         * @return whether the transport has the given capability
         * @throws SmbException if an error occurs checking capabilities
         */
        boolean hasCapability(int cap) throws SmbException;
    
        /**
         * Checks if the transport has been disconnected.
         *
         * @return whether the transport has been disconnected
         */
        boolean isDisconnected();
    
        /**
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 16 01:32:48 GMT 2025
    - 4.5K bytes
    - Click Count (0)
  9. src/main/java/jcifs/internal/smb2/rdma/RdmaTransport.java

            return statistics;
        }
    
        // Delegate all SmbTransportInternal methods to the wrapped transport
    
        @Override
        public boolean hasCapability(int cap) throws SmbException {
            return delegate.hasCapability(cap);
        }
    
        @Override
        public boolean isDisconnected() {
            return delegate.isDisconnected();
        }
    
        @Override
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sat Aug 23 05:11:12 GMT 2025
    - 8.9K bytes
    - Click Count (0)
  10. src/test/java/jcifs/smb/SmbTreeConnectionTest.java

            setTree(c2, other);
            assertFalse(c1.isSame(c2));
        }
    
        @Test
        @DisplayName("hasCapability throws when not connected")
        void hasCapability_notConnected_throws() {
            SmbTreeConnection c = newConn();
            SmbException ex = assertThrows(SmbException.class, () -> c.hasCapability(1));
            assertTrue(ex.getMessage().contains("Not connected"));
        }
    
        @Test
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Thu Aug 14 07:14:38 GMT 2025
    - 13K bytes
    - Click Count (0)
Back to Top