[Schmitzm-commits] r964 - trunk/src_junit/schmitzm/geotools/gui

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Aug 12 10:13:03 CEST 2010


Author: alfonx
Date: 2010-08-12 10:13:02 +0200 (Thu, 12 Aug 2010)
New Revision: 964

Added:
   trunk/src_junit/schmitzm/geotools/gui/GridPanelFormatterTest.java
Log:
Added tests that show that the last commit (which replaces SwingUtil2) actually created NPEs when running the application.

Added: trunk/src_junit/schmitzm/geotools/gui/GridPanelFormatterTest.java
===================================================================
--- trunk/src_junit/schmitzm/geotools/gui/GridPanelFormatterTest.java	2010-08-11 09:05:56 UTC (rev 963)
+++ trunk/src_junit/schmitzm/geotools/gui/GridPanelFormatterTest.java	2010-08-12 08:13:02 UTC (rev 964)
@@ -0,0 +1,55 @@
+package schmitzm.geotools.gui;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class GridPanelFormatterTest {
+
+	XMapPane xMapPane = null;
+
+	@Before
+	public void setupBeforeTest() {
+		xMapPane = new XMapPane();
+	}
+
+	@Test
+	public void testGetWidthForVertical_LatLon() {
+		GridPanelFormatter_LatLon1 gridPanelFormatterLatLon1 = new GridPanelFormatter_LatLon1();
+
+		GridPanel gridPanel = new GridPanel(GridPanel.VERTICAL, xMapPane);
+
+		int widthForVertical = gridPanelFormatterLatLon1
+				.getWidthForVertical(gridPanel);
+
+		assertTrue(widthForVertical > 1);
+
+	}
+
+	@Test
+	public void testGetWidthForVertical_DHDN() {
+		GridPanelFormatter_DHDN gridPanelFormatterDHDN = new GridPanelFormatter_DHDN();
+
+		GridPanel gridPanel = new GridPanel(GridPanel.VERTICAL, xMapPane);
+
+		int widthForVertical = gridPanelFormatterDHDN
+				.getWidthForVertical(gridPanel);
+
+		assertTrue(widthForVertical > 1);
+
+	}
+
+	@Test
+	public void testGetHeightForHorizontal() {
+		GridPanelFormatter_LatLon1 gridPanelFormatterLatLon1 = new GridPanelFormatter_LatLon1();
+
+		GridPanel gridPanel = new GridPanel(GridPanel.HORIZONTAL, xMapPane);
+
+		int heightForHorizontal = gridPanelFormatterLatLon1
+				.getHeightForHorizontal(gridPanel);
+
+		assertTrue(heightForHorizontal > 1);
+	}
+
+}


Property changes on: trunk/src_junit/schmitzm/geotools/gui/GridPanelFormatterTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id URL
Name: svn:eol-style
   + native



More information about the Schmitzm-commits mailing list