SelfHoster.discoverFirstFreePort(): Close the socket.
[online-glom:gwt-glom.git] / src / test / java / org / glom / web / client / GwtTestOnlineGlom.java
1 package org.glom.web.client;
2
3 import static org.junit.Assert.assertFalse;
4 import static org.junit.Assert.assertNotNull;
5 import static org.junit.Assert.assertTrue;
6
7 import org.glom.web.client.ui.DocumentSelectionView;
8 import org.junit.Before;
9 import org.junit.Test;
10
11 import com.googlecode.gwt.test.GwtTestWithEasyMock;
12
13 public class GwtTestOnlineGlom extends GwtTestWithEasyMock {
14
15         /**
16          * Tell gwt-test-utils to use this mock when trying to create this class via GWT.create() in OnlineGlom.
17          */
18         // @Mock
19         // private AppPlaceHistoryMapper mockAppPlaceHistoryMapper;
20
21         private OnlineGlom app;
22
23         @Test
24         public void testSomething() {
25                 assertTrue(true);
26                 /*
27                  * TODO: For instance: // Arrange Browser.fillText(app.nameField, "123");
28                  * 
29                  * // Act Browser.click(app.sendButton);
30                  * 
31                  * // Assert assertFalse(app.dialogBox.isShowing()); assertEquals("Please enter at least four characters",
32                  * app.errorLabel.getText());
33                  */
34         }
35
36         @Override
37         public String getModuleName() {
38                 return "org.glom.web.OnlineGlom";
39         }
40
41         @Before
42         public void beforeOnlineGlom() {
43                 app = new OnlineGlom();
44                 app.onModuleLoad();
45
46                 assertNotNull(app.clientFactory);
47                 final DocumentSelectionView view = app.clientFactory.getDocumentSelectionView();
48                 assertNotNull(view);
49                 assertNotNull(view.asWidget());
50                 assertTrue(view.asWidget().isVisible());
51
52                 // Some pre-assertions
53                 assertTrue(app.docSelectionPanel.isVisible());
54                 assertFalse(app.dataPanel.isVisible());
55                 assertFalse(app.tableSelectionPanel.isVisible());
56                 // TODO: For instance: assertEquals("", app.docSelectionPanel.getText());
57         }
58
59 }