Index: src/test/api/java/common/java/awt/image/RasterTest.java =================================================================== --- src/test/api/java/common/java/awt/image/RasterTest.java (revision 487516) +++ src/test/api/java/common/java/awt/image/RasterTest.java (working copy) @@ -20,6 +20,8 @@ import junit.framework.TestCase; +import java.awt.*; + public class RasterTest extends TestCase { // A regression test for harmony-2717 public void test_createPackedRaster() @@ -33,4 +35,20 @@ fail(expectedException +" was thrown"); } } + + // Regression test for Harmony-2743 + public void test_createCompatibleWritableRaster() { + MultiPixelPackedSampleModel localMultiPixelPackedSampleModel = + new MultiPixelPackedSampleModel(0, 5, 22, -1, -25, 40825); + Point localPoint = new Point(); + Raster localRaster = Raster.createWritableRaster(localMultiPixelPackedSampleModel,localPoint); + try { + localRaster.createCompatibleWritableRaster(-32,8); + fail("Exception expected"); + } catch (RasterFormatException expectedException) { + System.out.println(expectedException +" was thrown"); + } catch (IllegalArgumentException expectedException) { + fail(expectedException +" was thrown"); + } + } }