Esempio n. 1
0
 @org.junit.Test
 public void testCreateMap() throws Exception {
   final UGMap<String, String> map = ug.createMap();
   assertTrue("Map should be of type SwingMap", map instanceof SwingMap);
   map.put("Bla", "asdf");
   map.put("foo", "bar");
   assertEquals("Key 'Bla' should return 'asdf'", "asdf", map.get("Bla"));
   assertEquals("Key 'foo' should return 'bar'", "bar", map.get("foo"));
   assertNull("Key 'dkdkddk' should be null", map.get("dkdkddk"));
 }
Esempio n. 2
0
 @org.junit.Test
 public void testCreateList() throws Exception {
   final UGList<String> list = ug.createList();
   assertTrue("List should be of type SwingList", list instanceof SwingList);
   assertEquals("Length of list at the beginning should be 0", 0, list.size());
   list.add("Foo");
   list.add("Bar");
   assertEquals("Length after two inserts should be 2", 2, list.size());
   assertEquals("Element at 0 should be 'Foo'", "Foo", list.at(0));
   assertEquals("Element at 0 should be 'Bar'", "Bar", list.at(1));
 }
Esempio n. 3
0
 @org.junit.Test
 public void testGetImage() throws Exception {
   final UGImage image = ug.getImage("testimg.png");
   assertTrue("Image should be of type SwingImage", image instanceof SwingImage);
 }