blob: c4986605b2278b5ab058c6acc0d988e04dedb1fe [file] [log] [blame]
tom5ac51882014-08-27 18:10:33 -07001package org.onlab.onos.impl;
tom0eb04ca2014-08-25 14:34:51 -07002
3import org.junit.Test;
tom5ac51882014-08-27 18:10:33 -07004import org.onlab.onos.GreetService;
tom0eb04ca2014-08-25 14:34:51 -07005
6import java.util.Iterator;
7
8import static org.junit.Assert.assertEquals;
9import static org.junit.Assert.assertFalse;
10
11/**
12 * Example of a component & service implementation unit test.
13 */
14public class GreetManagerTest {
15
16 @Test
17 public void basics() {
18 GreetService service = new GreetManager();
19 assertEquals("incorrect greeting", "Whazup dude?", service.yo("dude"));
20
21 Iterator<String> names = service.names().iterator();
22 assertEquals("incorrect name", "dude", names.next());
23 assertFalse("no more names expected", names.hasNext());
24 }
25
26 @Test(expected = NullPointerException.class)
27 public void nullArg() {
28 new GreetManager().yo(null);
29 }
30
31}