diff options
author | RĂ¼diger Herrmann | 2011-01-17 12:06:28 +0000 |
---|---|---|
committer | RĂ¼diger Herrmann | 2011-01-17 12:06:28 +0000 |
commit | 26346ed4ba0856c69cb69d060974db12cf60e814 (patch) | |
tree | 0ced2ada88e0a8b61de8bf0ffeecf55db49accf9 /tests | |
parent | 6992480545d7093298215ac89a5f599e2bee6c00 (diff) | |
download | org.eclipse.rap-26346ed4ba0856c69cb69d060974db12cf60e814.tar.gz org.eclipse.rap-26346ed4ba0856c69cb69d060974db12cf60e814.tar.xz org.eclipse.rap-26346ed4ba0856c69cb69d060974db12cf60e814.zip |
Split up test cases for lineCap and lineJoin
Diffstat (limited to 'tests')
-rw-r--r-- | tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/graphics/GC_Test.java | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/graphics/GC_Test.java b/tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/graphics/GC_Test.java index 54b411aaa4..53b671660c 100644 --- a/tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/graphics/GC_Test.java +++ b/tests/org.eclipse.rap.rwt.test/src/org/eclipse/swt/graphics/GC_Test.java @@ -553,11 +553,24 @@ public class GC_Test extends TestCase { SetProperty operation = ( SetProperty )gcOperations[ 0 ]; assertEquals( SetProperty.LINE_CAP, operation.id ); assertEquals( new Integer( SWT.CAP_ROUND ), operation.value ); + } + + public void testSetLineCapWithUnchangeValue() { + Control control = new Shell( display ); + GC gc = new GC( control ); + gc.setLineCap( SWT.CAP_ROUND ); + gc.getGCAdapter().clearGCOperations(); + gc.setLineCap( SWT.CAP_ROUND ); + assertEquals( 0, getGCOperations( gc ).length ); + } + + public void testSetLineCapWithInvalidValue() { + Control control = new Shell( display ); + GC gc = new GC( control ); try { gc.setLineCap( 500 ); fail( "value not allowed" ); - } catch( IllegalArgumentException e ) { - // expected + } catch( IllegalArgumentException expected ) { } } @@ -570,11 +583,24 @@ public class GC_Test extends TestCase { SetProperty operation = ( SetProperty )gcOperations[ 0 ]; assertEquals( SetProperty.LINE_JOIN, operation.id ); assertEquals( new Integer( SWT.JOIN_ROUND ), operation.value ); + } + + public void testSetLineJoinWithUnchangedValue() { + Control control = new Shell( display ); + GC gc = new GC( control ); + gc.setLineJoin( SWT.JOIN_ROUND ); + gc.getGCAdapter().clearGCOperations(); + gc.setLineJoin( SWT.JOIN_ROUND ); + assertEquals( 0, getGCOperations( gc ).length ); + } + + public void testSetLineJoinWithInvalidValue() { + Control control = new Shell( display ); + GC gc = new GC( control ); try { gc.setLineCap( 500 ); fail( "value not allowed" ); - } catch( IllegalArgumentException e ) { - // expected + } catch( IllegalArgumentException expected ) { } } @@ -602,7 +628,6 @@ public class GC_Test extends TestCase { assertEquals( new Integer( SWT.JOIN_BEVEL ), operation.value ); } - public void testSetLineAttributesWithNullArgument() { GC gc = new GC( display ); try { |