blob: c4986605b2278b5ab058c6acc0d988e04dedb1fe [file] [log] [blame]
package org.onlab.onos.impl;
import org.junit.Test;
import org.onlab.onos.GreetService;
import java.util.Iterator;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
/**
* Example of a component & service implementation unit test.
*/
public class GreetManagerTest {
@Test
public void basics() {
GreetService service = new GreetManager();
assertEquals("incorrect greeting", "Whazup dude?", service.yo("dude"));
Iterator<String> names = service.names().iterator();
assertEquals("incorrect name", "dude", names.next());
assertFalse("no more names expected", names.hasNext());
}
@Test(expected = NullPointerException.class)
public void nullArg() {
new GreetManager().yo(null);
}
}