11/*******************************************************************************
2- * Copyright (c) 2011 Google, Inc.
2+ * Copyright (c) 2011, 2025 Google, Inc. and others .
33 *
44 * This program and the accompanying materials are made available under the
55 * terms of the Eclipse Public License 2.0 which is available at
1515import org .eclipse .wb .internal .swing .FormLayout .model .FormSizeConstantInfo ;
1616import org .eclipse .wb .internal .swing .FormLayout .model .FormSizeInfo ;
1717import org .eclipse .wb .internal .swing .laf .LafSupport ;
18- import org .eclipse .wb .tests .designer .Expectations ;
19- import org .eclipse .wb .tests .designer .Expectations .DblValue ;
20- import org .eclipse .wb .tests .designer .Expectations .IntValue ;
2118
2219import com .jgoodies .forms .layout .ColumnSpec ;
2320import com .jgoodies .forms .layout .ConstantSize ;
2623import com .jgoodies .forms .layout .Sizes ;
2724
2825import org .junit .jupiter .api .BeforeEach ;
29- import org .junit .jupiter .api .Disabled ;
3026import org .junit .jupiter .api .Test ;
3127
3228/**
@@ -64,7 +60,6 @@ public void _test_exit() throws Exception {
6460 /**
6561 * Test for {@link FormSizeConstantInfo}.
6662 */
67- @ Disabled
6863 @ Test
6964 public void test_FormSizeConstantInfo () throws Exception {
7065 FormSizeConstantInfo size = new FormSizeConstantInfo (25 , ConstantSize .PIXEL );
@@ -110,12 +105,7 @@ public void test_FormSizeConstantInfo() throws Exception {
110105 assertEquals (40 , size .getValue (), 0.001 );
111106 // to millimeters
112107 size .setUnit (ConstantSize .MILLIMETER );
113- assertEquals (
114- Expectations .get (10.7 , new DblValue []{
115- new DblValue ("kosta-home" , 8.5 ),
116- new DblValue ("scheglov-win" , 10.7 )}),
117- size .getValue (),
118- 0.001 );
108+ assertEquals (10.7 , size .getValue (), 0.001 );
119109 }
120110 }
121111
@@ -139,53 +129,34 @@ public void test_FormSizeConstantInfo_convertSpecial() throws Exception {
139129 /**
140130 * Test for {@link FormSizeConstantInfo#convertFromPixels(int, Unit)}
141131 */
142- @ Disabled
143132 @ Test
144133 public void test_FormSizeConstantInfo_convertFromPixels () throws Exception {
145134 {
146135 double expected = 50.0 ;
147136 check_convertFromPixels (50 , ConstantSize .PIXEL , expected );
148137 }
149138 {
150- double expected =
151- Expectations .get (39.0 , new DblValue []{
152- new DblValue ("kosta-home" , 31.0 ),
153- new DblValue ("scheglov-win" , 38.0 )});
139+ double expected = 38 ;
154140 check_convertFromPixels (50 , ConstantSize .POINT , expected );
155141 }
156142 {
157- double expected =
158- Expectations .get (34.0 , new DblValue []{
159- new DblValue ("kosta-home" , 26.0 ),
160- new DblValue ("scheglov-win" , 34.0 )});
143+ double expected = 29 ;
161144 check_convertFromPixels (50 , ConstantSize .DIALOG_UNITS_X , expected );
162145 }
163146 {
164- double expected =
165- Expectations .get (34.0 , new DblValue []{
166- new DblValue ("kosta-home" , 32.0 ),
167- new DblValue ("scheglov-win" , 34.0 )});
147+ double expected = 32 ;
168148 check_convertFromPixels (50 , ConstantSize .DIALOG_UNITS_Y , expected );
169149 }
170150 {
171- double expected =
172- Expectations .get (13.4 , new DblValue []{
173- new DblValue ("kosta-home" , 10.7 ),
174- new DblValue ("scheglov-win" , 13.4 )});
151+ double expected = 13.4 ;
175152 check_convertFromPixels (50 , ConstantSize .MILLIMETER , expected );
176153 }
177154 {
178- double expected =
179- Expectations .get (1.3 , new DblValue []{
180- new DblValue ("kosta-home" , 1.1 ),
181- new DblValue ("scheglov-win" , 1.3 )});
155+ double expected = 1.3 ;
182156 check_convertFromPixels (50 , ConstantSize .CENTIMETER , expected );
183157 }
184158 {
185- double expected =
186- Expectations .get (0.5 , new DblValue []{
187- new DblValue ("kosta-home" , 0.4 ),
188- new DblValue ("scheglov-win" , 0.5 )});
159+ double expected = 0.5 ;
189160 check_convertFromPixels (50 , ConstantSize .INCH , expected );
190161 }
191162 }
@@ -197,53 +168,34 @@ private void check_convertFromPixels(int pixels, Unit unit, double expected) thr
197168 /**
198169 * Test for {@link FormSizeConstantInfo#convertToPixels(double, Unit)}
199170 */
200- @ Disabled
201171 @ Test
202172 public void test_FormSizeConstantInfo_convertToPixels () throws Exception {
203173 {
204174 int expected = 10 ;
205175 check_convertToPixels (10.0 , ConstantSize .PIXEL , expected );
206176 }
207177 {
208- int expected =
209- Expectations .get (13 , new IntValue []{
210- new IntValue ("kosta-home" , 16 ),
211- new IntValue ("scheglov-win" , 13 )});
178+ int expected = 13 ;
212179 check_convertToPixels (10.0 , ConstantSize .POINT , expected );
213180 }
214181 {
215- int expected =
216- Expectations .get (15 , new IntValue []{
217- new IntValue ("kosta-home" , 20 ),
218- new IntValue ("scheglov-win" , 15 )});
182+ int expected = 18 ;
219183 check_convertToPixels (10.0 , ConstantSize .DIALOG_UNITS_X , expected );
220184 }
221185 {
222- int expected =
223- Expectations .get (15 , new IntValue []{
224- new IntValue ("kosta-home" , 16 ),
225- new IntValue ("scheglov-win" , 15 )});
186+ int expected = 16 ;
226187 check_convertToPixels (10.0 , ConstantSize .DIALOG_UNITS_Y , expected );
227188 }
228189 {
229- int expected =
230- Expectations .get (38 , new IntValue []{
231- new IntValue ("kosta-home" , 47 ),
232- new IntValue ("scheglov-win" , 38 )});
190+ int expected = 38 ;
233191 check_convertToPixels (10.0 , ConstantSize .MILLIMETER , expected );
234192 }
235193 {
236- int expected =
237- Expectations .get (378 , new IntValue []{
238- new IntValue ("kosta-home" , 472 ),
239- new IntValue ("scheglov-win" , 378 )});
194+ int expected = 378 ;
240195 check_convertToPixels (10.0 , ConstantSize .CENTIMETER , expected );
241196 }
242197 {
243- int expected =
244- Expectations .get (960 , new IntValue []{
245- new IntValue ("kosta-home" , 1200 ),
246- new IntValue ("scheglov-win" , 960 )});
198+ int expected = 960 ;
247199 check_convertToPixels (10.0 , ConstantSize .INCH , expected );
248200 }
249201 }
0 commit comments