Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for getHostName (0.05 sec)

  1. src/test/java/jcifs/netbios/UniAddressTest.java

                when(mockInetAddress.getHostName()).thenReturn("inet-host");
                UniAddress uniAddress = new UniAddress(mockInetAddress);
                assertEquals("inet-host", uniAddress.getHostName());
            }
    
            @Test
            void shouldReturnNbtAddressHostnameWhenWrappedIsNbtAddress() {
                when(mockNbtAddress.getHostName()).thenReturn("nbt-host");
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 16.4K bytes
    - Viewed (0)
  2. src/test/java/jcifs/AddressTest.java

        }
    
        @Test
        @DisplayName("getHostName should return valid hostname or address")
        void testGetHostNameContract() {
            // Given
            String expectedHostName = "server.example.com";
            when(mockAddress.getHostName()).thenReturn(expectedHostName);
    
            // When
            String hostName = mockAddress.getHostName();
    
            // Then
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.9K bytes
    - Viewed (0)
  3. src/main/java/jcifs/netbios/UniAddress.java

         *
         * @return the hostname associated with the address
         */
        @Override
        public String getHostName() {
            if (this.addr instanceof NbtAddress) {
                return ((NbtAddress) this.addr).getHostName();
            }
            return ((InetAddress) this.addr).getHostName();
        }
    
        /**
         * Return the IP address as text such as "192.168.1.15".
         *
         * @return the ip address
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 8.3K bytes
    - Viewed (0)
  4. src/test/java/jcifs/netbios/LmhostsTest.java

            assertNotNull(result);
            assertEquals("TESTHOST", result.getHostName());
    
            // Test second host
            result = lmhosts.getByName("SERVER01", mockContext);
            assertNotNull(result);
            assertEquals("SERVER01", result.getHostName());
        }
    
        @Test
        void testGetByNameCaching() throws IOException {
            // Create a temporary lmhosts file
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.2K bytes
    - Viewed (0)
  5. src/test/java/jcifs/ntlmssp/Type2MessageTest.java

            when(mockContext.getNameServiceClient()).thenReturn(mockNameServiceClient);
            when(mockNameServiceClient.getLocalHost()).thenReturn(mockHost);
            when(mockHost.getHostName()).thenReturn(TEST_HOSTNAME);
            when(mockConfig.getDefaultDomain()).thenReturn(TEST_DOMAIN);
            when(mockConfig.isUseUnicode()).thenReturn(true);
    
            return mockContext;
        }
    
        @Nested
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 38.9K bytes
    - Viewed (0)
  6. src/test/java/jcifs/smb1/UniAddressTest.java

        }
    
        @Test
        void getHostNameDelegatesToWrappedInetAddress() {
            InetAddress dummy = mock(InetAddress.class);
            when(dummy.getHostName()).thenReturn("host.example.com");
            UniAddress ua = new UniAddress(dummy);
            assertEquals("host.example.com", ua.getHostName(), "should forward hostName to underlying InetAddress");
        }
    
        @Test
        void getHostAddressDelegatesToWrappedInetAddress() {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  7. src/main/java/jcifs/smb1/UniAddress.java

         *
         * @return the hostname of this address
         */
    
        public String getHostName() {
            if (addr instanceof NbtAddress) {
                return ((NbtAddress) addr).getHostName();
            }
            return ((InetAddress) addr).getHostName();
        }
    
        /**
         * Return the IP address as text such as "192.168.1.15".
         *
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 17K bytes
    - Viewed (0)
  8. src/test/java/jcifs/netbios/NbtAddressTest.java

            // Test getHostName when hostname is known
            mockName = new Name(mockConfig, "KNOWNHOST", 0x20, null);
            NbtAddress nbtAddress = new NbtAddress(mockName, testAddressInt, false, NbtAddress.H_NODE);
            assertEquals("KNOWNHOST", nbtAddress.getHostName());
        }
    
        @Test
        void testGetHostName_UnknownHost() {
            // Test getHostName when hostname is unknown, should return IP address
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 20.4K bytes
    - Viewed (0)
  9. src/main/java/jcifs/ntlmssp/Type1Message.java

         * @param tc
         *            context to use
         */
        public Type1Message(final CIFSContext tc) {
            this(tc, getDefaultFlags(tc), tc.getConfig().getDefaultDomain(), tc.getNameServiceClient().getLocalHost().getHostName());
        }
    
        /**
         * Creates a Type-1 message with the specified parameters.
         *
         * @param tc
         *            context to use
         * @param flags
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 7.8K bytes
    - Viewed (0)
  10. src/main/java/jcifs/Address.java

        <T extends Address> T unwrap(Class<T> type);
    
        /**
         * Gets the host name of this address.
         *
         * @return the resolved host name, or the host address if it could not be resolved
         */
        String getHostName();
    
        /**
         * Return the IP address as text such as "192.168.1.15".
         *
         * @return the ip address
         */
        String getHostAddress();
    
        /**
         * Converts this address to an InetAddress.
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 2.2K bytes
    - Viewed (0)
Back to top