< prev index next >

test/java/awt/image/multiresolution/BaseMultiResolutionImageTest.java

Print this page




 174             rvImageList.remove(0);
 175         } catch (Exception e) {
 176             passed = true;
 177         }
 178 
 179         if (!passed) {
 180             throw new RuntimeException("Resolution variants list is modifiable!");
 181         }
 182 
 183         passed = false;
 184 
 185         try {
 186             rvImageList.add(0, createRVImage(10));
 187         } catch (Exception e) {
 188             passed = true;
 189         }
 190 
 191         if (!passed) {
 192             throw new RuntimeException("Resolution variants list is modifiable!");
 193         }











 194     }
 195 
 196     private static int getSize(int i) {
 197         return 8 * (i + 1);
 198     }
 199 
 200     private static BufferedImage createRVImage(int i) {
 201         return new BufferedImage(getSize(i), getSize(i),
 202                 BufferedImage.TYPE_INT_RGB);
 203     }
 204 }


 174             rvImageList.remove(0);
 175         } catch (Exception e) {
 176             passed = true;
 177         }
 178 
 179         if (!passed) {
 180             throw new RuntimeException("Resolution variants list is modifiable!");
 181         }
 182 
 183         passed = false;
 184 
 185         try {
 186             rvImageList.add(0, createRVImage(10));
 187         } catch (Exception e) {
 188             passed = true;
 189         }
 190 
 191         if (!passed) {
 192             throw new RuntimeException("Resolution variants list is modifiable!");
 193         }
 194 
 195         passed = false;
 196         try {
 197             mrImage.getGraphics();
 198         } catch (UnsupportedOperationException e) {
 199             passed = true;
 200         }
 201 
 202         if (!passed) {
 203             throw new RuntimeException("getGraphics() method shouldn't be supported!");
 204         }
 205     }
 206 
 207     private static int getSize(int i) {
 208         return 8 * (i + 1);
 209     }
 210 
 211     private static BufferedImage createRVImage(int i) {
 212         return new BufferedImage(getSize(i), getSize(i),
 213                 BufferedImage.TYPE_INT_RGB);
 214     }
 215 }
< prev index next >