aboutsummaryrefslogtreecommitdiffstats
path: root/vespalog/src/test/java/com/yahoo/log/impl/LogUtilsTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'vespalog/src/test/java/com/yahoo/log/impl/LogUtilsTest.java')
-rw-r--r--vespalog/src/test/java/com/yahoo/log/impl/LogUtilsTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/vespalog/src/test/java/com/yahoo/log/impl/LogUtilsTest.java b/vespalog/src/test/java/com/yahoo/log/impl/LogUtilsTest.java
new file mode 100644
index 00000000000..76998395e12
--- /dev/null
+++ b/vespalog/src/test/java/com/yahoo/log/impl/LogUtilsTest.java
@@ -0,0 +1,36 @@
+// Copyright Yahoo. 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(""));
+ }
+
+}