changeset 1739:d4e7ccafce3f

Timeline is empty for the threads tab review-thread: http://icedtea.classpath.org/pipermail/thermostat/2015-September/015665.html reviewed-by: jerboaa PR2602
author Mario Torre <neugens.limasoftware@gmail.com>
date Tue, 01 Sep 2015 13:27:40 +0200
parents bafe5e5ab55b
children 4ef35bbc19f7
files thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadView.java thread/client-swing/src/test/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadViewTest.java
diffstat 2 files changed, 29 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadView.java	Mon Aug 24 13:07:06 2015 -0400
+++ b/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadView.java	Tue Sep 01 13:27:40 2015 +0200
@@ -155,11 +155,15 @@
         topPane = new ThermostatTabbedPane();
         topPane.setName("topTabbedPane");
         
-        threadTimelineView = new SwingThreadTimelineView(uiDefaults);
-        topPane.addTab(t.localize(LocaleResources.TIMELINE).getContents(), threadTimelineView.getUiComponent());
+        threadCountView = new SwingThreadCountView();
+        Component comp = threadCountView.getUiComponent();
+        comp.setName("count");
+        topPane.addTab(t.localize(LocaleResources.THREAD_COUNT).getContents(), comp);
         
-        threadCountView = new SwingThreadCountView();
-        topPane.addTab(t.localize(LocaleResources.THREAD_COUNT).getContents(), threadCountView.getUiComponent());
+        threadTimelineView = new SwingThreadTimelineView(uiDefaults);
+        comp = threadTimelineView.getUiComponent();
+        comp.setName("timeline");
+        topPane.addTab(t.localize(LocaleResources.TIMELINE).getContents(), comp);
         
         panel.getSplitPane().setTopComponent(topPane);
     }
--- a/thread/client-swing/src/test/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadViewTest.java	Mon Aug 24 13:07:06 2015 -0400
+++ b/thread/client-swing/src/test/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadViewTest.java	Tue Sep 01 13:27:40 2015 +0200
@@ -40,16 +40,22 @@
 import com.redhat.thermostat.client.swing.UIDefaults;
 import com.redhat.thermostat.shared.locale.Translate;
 import com.redhat.thermostat.thread.client.common.locale.LocaleResources;
+
 import java.awt.Color;
+import java.awt.Component;
 import java.lang.reflect.InvocationTargetException;
 import java.util.Locale;
+
 import javax.swing.JFrame;
+
 import net.java.openjdk.cacio.ctc.junit.CacioFESTRunner;
+
 import org.fest.swing.annotation.GUITest;
 import org.fest.swing.edt.FailOnThreadViolationRepaintManager;
 import org.fest.swing.edt.GuiActionRunner;
 import org.fest.swing.edt.GuiTask;
 import org.fest.swing.fixture.FrameFixture;
+import org.fest.swing.fixture.JTabbedPaneFixture;
 import org.fest.swing.fixture.JToggleButtonFixture;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -59,6 +65,7 @@
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 
+import static org.junit.Assert.*;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
@@ -111,6 +118,20 @@
         frameFixture = new FrameFixture(frame);
     }
 
+    @Category(GUITest.class)
+    @GUITest
+    @Test
+    public void verifyThreadCountIsFirstTab() {
+        frameFixture.show();
+
+        JTabbedPaneFixture tabPane = frameFixture.tabbedPane("topTabbedPane");
+        Component comp = tabPane.component().getComponentAt(0);
+        assertEquals("count", comp.getName());
+        
+        comp = tabPane.component().getComponentAt(1);
+        assertEquals("timeline", comp.getName());
+    }
+    
     @GUITest
     @Test
     public void verifyMonitorLabelChange() throws InvocationTargetException, InterruptedException {