コード例 #1
0
 @Test
 public void testSimple() {
   String[] args =
       new String[] {"iface=192.168.0.100", "filter=arp", "db=" + getDBFile().getAbsolutePath()};
   config = new StartupConfig(args);
   ListenerFactory factory = ListenerFactory.newInstance(config);
   ButtonEventListener eventListener = factory.newButtonEventListener();
   String iface = eventListener.getInterface();
   assertThat(iface).isEqualTo("192.168.0.100");
 }
コード例 #2
0
 @Test
 public void testUsedb() {
   String[] args =
       new String[] {"iface=192.168.0.100", "filter=usedb", "db=" + getDBFile().getAbsolutePath()};
   config = new StartupConfig(args);
   ListenerFactory factory = ListenerFactory.newInstance(config);
   ButtonEventListener eventListener = factory.newButtonEventListener();
   String filter = eventListener.getFilter();
   System.out.println(filter);
   // TODO: Implement a way to test validity of filter given a n arbitrary button_table state
 }