01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Denis M. Kishenko
19: * @version $Revision$
20: */package org.apache.harmony.awt.gl;
21:
22: import org.apache.harmony.awt.gl.MultiRectArea;
23:
24: public class MultiRectAreaRectCashTest extends MultiRectAreaTestCase {
25:
26: MultiRectArea.RectCash area;
27:
28: static {
29: SERIALIZATION_TEST = false;
30: }
31:
32: public MultiRectAreaRectCashTest(String name) {
33: super (name);
34: }
35:
36: @Override
37: protected void setUp() throws Exception {
38: super .setUp();
39: area = new MultiRectArea.RectCash();
40: }
41:
42: @Override
43: protected void tearDown() throws Exception {
44: area = null;
45: super .tearDown();
46: }
47:
48: // 1234567
49: // 1
50: // 2 22233
51: // 3 22244
52: // 4 222
53: // 5 555 666
54: // 6 555 666
55: // 7
56: public void testCash() {
57: checkArea("RectCash1", area, new int[] {});
58:
59: area.addRectCashed(1, 2, 3, 4);
60: checkArea("RectCash2", area, new int[] { 1, 2, 3, 4 });
61:
62: area.addRectCashed(4, 2, 5, 2);
63: checkArea("RectCash3", area,
64: new int[] { 1, 2, 3, 4, 4, 2, 5, 2 });
65:
66: area.addRectCashed(4, 3, 5, 3);
67: checkArea("RectCash4", area, new int[] { 1, 2, 3, 4, 4, 2, 5,
68: 2, 4, 3, 5, 3 });
69:
70: area.addRectCashed(1, 5, 3, 6);
71: checkArea("RectCash5", area, new int[] { 1, 2, 3, 4, 4, 2, 5,
72: 2, 4, 3, 5, 3, 1, 5, 3, 6 });
73:
74: area.addRectCashed(5, 5, 7, 6);
75: checkArea("RectCash6", area, new int[] { 1, 2, 3, 4, 4, 2, 5,
76: 2, 4, 3, 5, 3, 1, 5, 3, 6, 5, 5, 7, 6 });
77: }
78:
79: public static void main(String[] args) {
80: junit.textui.TestRunner.run(MultiRectAreaRectCashTest.class);
81: }
82:
83: }
|