1 // Tags: JDK1.4 |
|
2 // Uses: BufferFactory PlainBufferTest WrappedWithOffsetBufferTest |
|
3 |
|
4 // Copyright (C) 2004 Max Gilead <gilead@yellowhedgehog.com> |
|
5 |
|
6 // This file is part of Mauve. |
|
7 |
|
8 // Mauve is free software; you can redistribute it and/or modify |
|
9 // it under the terms of the GNU General Public License as published by |
|
10 // the Free Software Foundation; either version 2, or (at your option) |
|
11 // any later version. |
|
12 |
|
13 // Mauve is distributed in the hope that it will be useful, |
|
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 // GNU General Public License for more details. |
|
17 |
|
18 // You should have received a copy of the GNU General Public License |
|
19 // along with Mauve; see the file COPYING. If not, write to |
|
20 // the Free Software Foundation, 59 Temple Place - Suite 330, |
|
21 // Boston, MA 02111-1307, USA. |
|
22 |
|
23 package gnu.testlet.java.nio.Buffer; |
|
24 |
|
25 import gnu.testlet.Testlet; |
|
26 import gnu.testlet.TestHarness; |
|
27 |
|
28 import java.nio.Buffer; |
|
29 import java.nio.IntBuffer; |
|
30 |
|
31 public class IntBufferTest implements Testlet |
|
32 { |
|
33 public void test(TestHarness h) |
|
34 { |
|
35 h.debug("Testing IntBufferTest.allocate(int) Buffer"); |
|
36 new PlainBufferTest().test(h, new BufferFactory() |
|
37 { |
|
38 public Buffer newInstance() |
|
39 { |
|
40 return IntBuffer.allocate(10); |
|
41 } |
|
42 }); |
|
43 |
|
44 h.debug("Testing IntBufferTest.wrap(int[]) Buffer"); |
|
45 new PlainBufferTest().test(h, new BufferFactory() |
|
46 { |
|
47 public Buffer newInstance() |
|
48 { |
|
49 return IntBuffer.wrap(new int[10]); |
|
50 } |
|
51 }); |
|
52 |
|
53 h.debug("Testing IntBufferTest.wrap(int[], int, int) Buffer"); |
|
54 new WrappedWithOffsetBufferTest().test(h, new BufferFactory() |
|
55 { |
|
56 public Buffer newInstance() |
|
57 { |
|
58 return IntBuffer.wrap(new int[20], 10, 10); |
|
59 } |
|
60 }); |
|
61 } |
|
62 } |
|