blob: 9c05f2038ae85504cd4ad0f1127d61ab1c75322e [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001package org.onlab.onos.net.impl;
2
3import org.junit.Test;
4import org.onlab.onos.net.GreetService;
5
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}