Index: /modules/swing/src/test/api/java/common/javax/swing/ScrollPaneLayoutTest.java =================================================================== --- /modules/swing/src/test/api/java/common/javax/swing/ScrollPaneLayoutTest.java (revision 453106) +++ /modules/swing/src/test/api/java/common/javax/swing/ScrollPaneLayoutTest.java (working copy) @@ -73,7 +73,14 @@ fail("Class cast exception shall be thrown"); } catch (ClassCastException e) { } - } + //regression for HARMONY-1735 + try { + layout.preferredLayoutSize(null); + fail("No expected exception"); + }catch (NullPointerException e) { + //expected + } + } public void testDefaultLayout() throws Exception { ScrollPaneLayout l = new ScrollPaneLayout(); @@ -96,6 +103,13 @@ layout.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER, layout.getHorizontalScrollBarPolicy()); + //regression 1 for HARMONY-1737 + try{ + layout.setHorizontalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); + fail("No expected IllegalArgumentException"); + }catch(IllegalArgumentException e){ + //expected + } } public void testSetVerticalPolicy() throws Exception { @@ -106,6 +120,13 @@ layout.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, layout.getVerticalScrollBarPolicy()); + //regression 2 for HARMONY-1737 + try{ + layout.setVerticalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + fail("No expected IllegalArgumentException"); + }catch(IllegalArgumentException e){ + //expected + } } public void testGetViewport() throws Exception {