Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 40 for isOpen (0.04 sec)

  1. src/test/java/jcifs/SmbPipeHandleTest.java

            /**
             * Verifies that the isOpen method returns true for an open handle.
             */
            @Test
            public void testIsOpen_ReturnsTrueWhenOpen() {
                when(smbPipeHandle.isOpen()).thenReturn(true);
                assertTrue(smbPipeHandle.isOpen(), "isOpen() should return true when the handle is open.");
            }
    
            /**
             * Verifies that the isOpen method returns false for a closed handle.
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7K bytes
    - Viewed (0)
  2. src/test/java/jcifs/smb/SmbPipeHandleInternalTest.java

            assertSame(pipe, handle.getPipe());
        }
    
        @Test
        @DisplayName("isOpen/isStale reflect handle validity and lifecycle")
        void isOpen_isStale_transitions() throws Exception {
            SmbPipeHandleImpl handle = newHandleWithBasicStubs(0, "\\\\pipe\\\\w");
            assertFalse(handle.isOpen(), "Initially not open");
            assertFalse(handle.isStale(), "Initially not stale");
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 16.7K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb/SmbPipeOutputStreamTest.java

        @DisplayName("isOpen delegates to handle.isOpen")
        void isOpen_delegates(boolean state) throws Exception {
            // Arrange
            SmbPipeOutputStream out = newStream();
            when(handle.isOpen()).thenReturn(state);
    
            // Act
            boolean result = out.isOpen();
    
            // Assert
            assertEquals(state, result, "isOpen should reflect handle state");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  4. src/main/java/jcifs/smb/SmbPipeOutputStream.java

            super(handle.getPipe(), th, null, 0, 0, 0);
            this.handle = handle;
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.smb.SmbFileOutputStream#isOpen()
         */
        @Override
        public boolean isOpen() {
            return this.handle.isOpen();
        }
    
        @Override
        protected synchronized SmbTreeHandleImpl ensureTreeConnected() throws CIFSException {
            return this.handle.ensureTreeConnected();
        }
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 2.1K bytes
    - Viewed (0)
  5. src/main/java/jcifs/smb/SmbPipeHandleImpl.java

        }
    
        public String getUncPath() {
            return this.uncPath;
        }
    
        /**
         * {@inheritDoc}
         *
         * @see jcifs.SmbPipeHandle#isOpen()
         */
        @Override
        public boolean isOpen() {
            return this.open && this.handle != null && this.handle.isValid();
        }
    
        /**
         *
         * {@inheritDoc}
         *
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sun Aug 31 08:00:57 UTC 2025
    - 10.2K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb1/smb1/SmbRandomAccessFileTest.java

        }
    
        @Test
        void testClose() throws SmbException {
            // Mock isOpen to return false after close
            doAnswer(new Answer<Void>() {
                @Override
                public Void answer(InvocationOnMock invocation) throws Throwable {
                    when(smbFile.isOpen()).thenReturn(false);
                    return null;
                }
            }).when(smbFile).close(anyLong());
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  7. src/test/java/jcifs/smb/SmbPipeHandleImplTest.java

            // Initially not open (isStale returns false when handle is null, not true)
            assertFalse(target.isOpen());
            assertFalse(target.isStale());
    
            // After ensureOpen, handle valid -> open
            SmbFileHandleImpl fh = target.ensureOpen();
            assertSame(fileHandle, fh);
            assertTrue(target.isOpen());
            assertFalse(target.isStale());
    
            // If handle becomes invalid, reflect stale
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.7K bytes
    - Viewed (0)
  8. src/main/java/jcifs/smb1/smb1/SmbFileOutputStream.java

         *
         * @return true if the stream is open, false otherwise
         */
        public boolean isOpen() {
            return file.isOpen();
        }
    
        void ensureOpen() throws IOException {
            // ensure file is open
            if (!file.isOpen()) {
                file.open(openFlags, access | SmbConstants.FILE_WRITE_DATA, SmbFile.ATTR_NORMAL, 0);
                if (append) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 11K bytes
    - Viewed (0)
  9. src/test/java/jcifs/smb/SmbFileOutputStreamTest.java

                    SmbConstants.DEFAULT_SHARING);
    
            // When & Then
            assertTrue(outputStream.isOpen());
    
            when(mockFileHandle.isValid()).thenReturn(false);
            assertFalse(outputStream.isOpen());
        }
    
        @Test
        void testWriteAfterClose() throws IOException, CIFSException {
            // Given
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  10. src/main/java/jcifs/smb1/smb1/SmbRandomAccessFile.java

            if (len <= 0) {
                return 0;
            }
            final long start = fp;
    
            // ensure file is open
            if (!file.isOpen()) {
                file.open(openFlags, 0, SmbFile.ATTR_NORMAL, options);
            }
    
            int r, n;
            final SmbComReadAndXResponse response = new SmbComReadAndXResponse(b, off);
            do {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 14.1K bytes
    - Viewed (0)
Back to top