aboutsummaryrefslogtreecommitdiffstats
path: root/vespalog/src/test/java/com/yahoo/log/impl/LogUtilsTest.java
blob: 2a3347c7f800cda7659063a1ed7b9f5f13627a40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.log.impl;

import org.junit.Test;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;

/**
 * @author Ulf Lilleengen
 * @author Bjorn Borud
 */
public class LogUtilsTest {

    @Test
    public void testEmpty() {
        assertTrue(LogUtils.empty(null));
        assertTrue(LogUtils.empty(""));
        assertFalse(LogUtils.empty("f"));
        assertFalse(LogUtils.empty("fo"));
        assertFalse(LogUtils.empty("foo"));
    }

    /**
     * Just make sure the static getHostName() method returns something
     * that looks half sensible.
     */
    @Test
    public void testSimple () {
        String name = LogUtils.getHostName();
        assertNotNull(name);
        assertFalse(name.equals(""));
    }

}