diff --git a/org.eclipse.wb.tests/META-INF/MANIFEST.MF b/org.eclipse.wb.tests/META-INF/MANIFEST.MF index cadcb535a..f51458ec8 100644 --- a/org.eclipse.wb.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.wb.tests/META-INF/MANIFEST.MF @@ -149,6 +149,7 @@ Export-Package: org.eclipse.wb.tests.designer;x-internal:=true, org.eclipse.wb.tests.utils;x-internal:=true Import-Package: com.jgoodies.forms.factories;version="[1.9.0,2.0.0]", com.jgoodies.forms.layout;version="[1.9.0,2.0.0]", + com.jgoodies.forms.util;version="[1.9.0,2.0.0)", net.miginfocom.layout;version="[11.3.0,12.0.0]", net.miginfocom.swing;version="[11.3.0,12.0.0]", org.apache.commons.collections4;version="[4.4.0,5.0.0)", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/bean/ActionGefTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/bean/ActionGefTest.java index ec76c324b..58038d78d 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/bean/ActionGefTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/bean/ActionGefTest.java @@ -31,7 +31,6 @@ import org.apache.commons.lang3.function.FailableConsumer; import org.apache.commons.lang3.function.FailableRunnable; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import javax.swing.JButton; @@ -232,7 +231,6 @@ public Test() { /** * Test for {@link ActionExternalEntryInfo}. */ - @Disabled @Test public void test_JToolBar_ActionExternalEntryInfo() throws Exception { createExternalAction(); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/ComponentTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/ComponentTest.java index 4a5e230ee..71010e150 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/ComponentTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/ComponentTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -31,7 +31,6 @@ import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.RGB; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.awt.Component; @@ -88,7 +87,6 @@ public void test_clearSwingTree_removeAll_NPE() throws Exception { /** * We can not create {@link java.awt.Image} with zero size, so we should check this. */ - @Disabled @Test public void test_zeroSize() throws Exception { ContainerInfo panel = diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/JSpinnerTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/JSpinnerTest.java index b96fbbc64..495a79fa7 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/JSpinnerTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/component/JSpinnerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -23,7 +23,6 @@ import org.eclipse.wb.tests.designer.Expectations.StrValue; import org.eclipse.wb.tests.designer.swing.SwingModelTest; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.lang.reflect.Field; @@ -142,7 +141,6 @@ public void test_dateModel_getDateStep() throws Exception { 0xDEADBEEF)); } - @Disabled @Test public void test_dateModel() throws Exception { String source = diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/AbstractFormLayoutTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/AbstractFormLayoutTest.java index 13cd19867..3cca55e01 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/AbstractFormLayoutTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/AbstractFormLayoutTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,15 +17,21 @@ import org.eclipse.wb.tests.designer.swing.model.layout.AbstractLayoutTest; import com.jgoodies.forms.layout.FormLayout; +import com.jgoodies.forms.util.DefaultUnitConverter; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; +import java.awt.Font; + /** * Abstract test for {@link FormLayout}. * * @author scheglov_ke */ public abstract class AbstractFormLayoutTest extends AbstractLayoutTest { + private static Font m_font; protected boolean m_useFormsImports = true; //////////////////////////////////////////////////////////////////////////// @@ -33,6 +39,20 @@ public abstract class AbstractFormLayoutTest extends AbstractLayoutTest { // Life cycle // //////////////////////////////////////////////////////////////////////////// + + @BeforeAll + public static void setUpAll() { + m_font = DefaultUnitConverter.getInstance().getDefaultDialogFont(); + Font newFont = new Font(Font.SANS_SERIF, Font.PLAIN, 12); + DefaultUnitConverter.getInstance().setDefaultDialogFont(newFont); + } + + @AfterAll + public static void tearDownAll() { + DefaultUnitConverter.getInstance().setDefaultDialogFont(m_font); + m_font = null; + } + @Override @BeforeEach public void setUp() throws Exception { diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/DefaultComponentFactoryTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/DefaultComponentFactoryTest.java index eec99a00d..633c0831d 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/DefaultComponentFactoryTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/DefaultComponentFactoryTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -29,7 +29,6 @@ import com.jgoodies.forms.factories.DefaultComponentFactory; import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -109,7 +108,6 @@ public void test_createLabel() throws Exception { * Test for {@link DefaultComponentFactoryCreateLabelEntryInfo}. */ @DisposeProjectAfter - @Disabled @Test public void test_createLabel_tool() throws Exception { do_projectDispose(); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormDimensionInfoTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormDimensionInfoTest.java index 3e9aca944..06a65e683 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormDimensionInfoTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormDimensionInfoTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -26,7 +26,6 @@ import com.jgoodies.forms.layout.Size; import com.jgoodies.forms.layout.Sizes; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.lang.reflect.Method; @@ -266,7 +265,6 @@ public void test_rowTemplates() throws Exception { // Convert to GAP template // //////////////////////////////////////////////////////////////////////////// - @Disabled @Test public void test_convertToNearestGap_columns() throws Exception { check_convertToNearestGap_column("4px", 5, "LABEL_COMPONENT_GAP_COLSPEC"); @@ -284,7 +282,6 @@ public void test_convertToNearestGap_columns() throws Exception { check_convertToNearestGap_column("20px", 5, null); } - @Disabled @Test public void test_convertToNearestGap_rows() throws Exception { check_convertToNearestGap_row("4px", 5, "LABEL_COMPONENT_GAP_ROWSPEC"); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormLayoutConverterTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormLayoutConverterTest.java index 0d2a2648f..10e36db5e 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormLayoutConverterTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormLayoutConverterTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -18,7 +18,6 @@ import com.jgoodies.forms.layout.FormLayout; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -60,7 +59,6 @@ public void test_empty() throws Exception { "}"); } - @Disabled @Test public void test_oneRow() throws Exception { ContainerInfo panel = @@ -96,7 +94,7 @@ public void test_oneRow() throws Exception { " setLayout(new FormLayout(new ColumnSpec[] {", " FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,", " ColumnSpec.decode('100px'),", - " ColumnSpec.decode('16px'),", + " FormSpecs.UNRELATED_GAP_COLSPEC,", " ColumnSpec.decode('80px'),},", " new RowSpec[] {", " FormSpecs.UNRELATED_GAP_ROWSPEC,", @@ -118,7 +116,6 @@ public void test_oneRow() throws Exception { } } - @Disabled @Test public void test_twoRows_spanColumns() throws Exception { ContainerInfo panel = @@ -181,7 +178,6 @@ public void test_twoRows_spanColumns() throws Exception { "}"); } - @Disabled @Test public void test_Switching_fromGridBagLayout() throws Exception { ContainerInfo panel = @@ -243,17 +239,17 @@ public void test_Switching_fromGridBagLayout() throws Exception { "public class Test extends JPanel {", " public Test() {", " setLayout(new FormLayout(new ColumnSpec[] {", - " ColumnSpec.decode('46px'),", + " ColumnSpec.decode('60px'),", " FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,", - " ColumnSpec.decode('305px'),", + " ColumnSpec.decode('275px'),", " FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,", - " ColumnSpec.decode('89px'),},", + " ColumnSpec.decode('105px'),},", " new RowSpec[] {", - " RowSpec.decode('20px'),", + " RowSpec.decode('26px'),", " FormSpecs.LINE_GAP_ROWSPEC,", - " RowSpec.decode('20px'),", + " RowSpec.decode('21px'),", " FormSpecs.LINE_GAP_ROWSPEC,", - " RowSpec.decode('23px'),}));", + " RowSpec.decode('27px'),}));", " {", " JComboBox comboBox = new JComboBox();", " add(comboBox, '3, 1, fill, center');", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormSizeInfoTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormSizeInfoTest.java index c3b895986..b9dbc2772 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormSizeInfoTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/FormLayout/FormSizeInfoTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -15,9 +15,6 @@ import org.eclipse.wb.internal.swing.FormLayout.model.FormSizeConstantInfo; import org.eclipse.wb.internal.swing.FormLayout.model.FormSizeInfo; import org.eclipse.wb.internal.swing.laf.LafSupport; -import org.eclipse.wb.tests.designer.Expectations; -import org.eclipse.wb.tests.designer.Expectations.DblValue; -import org.eclipse.wb.tests.designer.Expectations.IntValue; import com.jgoodies.forms.layout.ColumnSpec; import com.jgoodies.forms.layout.ConstantSize; @@ -26,7 +23,6 @@ import com.jgoodies.forms.layout.Sizes; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -35,6 +31,7 @@ * @author scheglov_ke */ public class FormSizeInfoTest extends AbstractFormLayoutTest { + //////////////////////////////////////////////////////////////////////////// // // Life cycle @@ -64,7 +61,6 @@ public void _test_exit() throws Exception { /** * Test for {@link FormSizeConstantInfo}. */ - @Disabled @Test public void test_FormSizeConstantInfo() throws Exception { FormSizeConstantInfo size = new FormSizeConstantInfo(25, ConstantSize.PIXEL); @@ -110,12 +106,7 @@ public void test_FormSizeConstantInfo() throws Exception { assertEquals(40, size.getValue(), 0.001); // to millimeters size.setUnit(ConstantSize.MILLIMETER); - assertEquals( - Expectations.get(10.7, new DblValue[]{ - new DblValue("kosta-home", 8.5), - new DblValue("scheglov-win", 10.7)}), - size.getValue(), - 0.001); + assertEquals(10.7, size.getValue(), 0.001); } } @@ -139,7 +130,6 @@ public void test_FormSizeConstantInfo_convertSpecial() throws Exception { /** * Test for {@link FormSizeConstantInfo#convertFromPixels(int, Unit)} */ - @Disabled @Test public void test_FormSizeConstantInfo_convertFromPixels() throws Exception { { @@ -147,45 +137,27 @@ public void test_FormSizeConstantInfo_convertFromPixels() throws Exception { check_convertFromPixels(50, ConstantSize.PIXEL, expected); } { - double expected = - Expectations.get(39.0, new DblValue[]{ - new DblValue("kosta-home", 31.0), - new DblValue("scheglov-win", 38.0)}); + double expected = 38; check_convertFromPixels(50, ConstantSize.POINT, expected); } { - double expected = - Expectations.get(34.0, new DblValue[]{ - new DblValue("kosta-home", 26.0), - new DblValue("scheglov-win", 34.0)}); + double expected = 30; check_convertFromPixels(50, ConstantSize.DIALOG_UNITS_X, expected); } { - double expected = - Expectations.get(34.0, new DblValue[]{ - new DblValue("kosta-home", 32.0), - new DblValue("scheglov-win", 34.0)}); + double expected = 32; check_convertFromPixels(50, ConstantSize.DIALOG_UNITS_Y, expected); } { - double expected = - Expectations.get(13.4, new DblValue[]{ - new DblValue("kosta-home", 10.7), - new DblValue("scheglov-win", 13.4)}); + double expected = 13.4; check_convertFromPixels(50, ConstantSize.MILLIMETER, expected); } { - double expected = - Expectations.get(1.3, new DblValue[]{ - new DblValue("kosta-home", 1.1), - new DblValue("scheglov-win", 1.3)}); + double expected = 1.3; check_convertFromPixels(50, ConstantSize.CENTIMETER, expected); } { - double expected = - Expectations.get(0.5, new DblValue[]{ - new DblValue("kosta-home", 0.4), - new DblValue("scheglov-win", 0.5)}); + double expected = 0.5; check_convertFromPixels(50, ConstantSize.INCH, expected); } } @@ -197,7 +169,6 @@ private void check_convertFromPixels(int pixels, Unit unit, double expected) thr /** * Test for {@link FormSizeConstantInfo#convertToPixels(double, Unit)} */ - @Disabled @Test public void test_FormSizeConstantInfo_convertToPixels() throws Exception { { @@ -205,45 +176,27 @@ public void test_FormSizeConstantInfo_convertToPixels() throws Exception { check_convertToPixels(10.0, ConstantSize.PIXEL, expected); } { - int expected = - Expectations.get(13, new IntValue[]{ - new IntValue("kosta-home", 16), - new IntValue("scheglov-win", 13)}); + int expected = 13; check_convertToPixels(10.0, ConstantSize.POINT, expected); } { - int expected = - Expectations.get(15, new IntValue[]{ - new IntValue("kosta-home", 20), - new IntValue("scheglov-win", 15)}); + int expected = 17; check_convertToPixels(10.0, ConstantSize.DIALOG_UNITS_X, expected); } { - int expected = - Expectations.get(15, new IntValue[]{ - new IntValue("kosta-home", 16), - new IntValue("scheglov-win", 15)}); + int expected = 16; check_convertToPixels(10.0, ConstantSize.DIALOG_UNITS_Y, expected); } { - int expected = - Expectations.get(38, new IntValue[]{ - new IntValue("kosta-home", 47), - new IntValue("scheglov-win", 38)}); + int expected = 38; check_convertToPixels(10.0, ConstantSize.MILLIMETER, expected); } { - int expected = - Expectations.get(378, new IntValue[]{ - new IntValue("kosta-home", 472), - new IntValue("scheglov-win", 378)}); + int expected = 378; check_convertToPixels(10.0, ConstantSize.CENTIMETER, expected); } { - int expected = - Expectations.get(960, new IntValue[]{ - new IntValue("kosta-home", 1200), - new IntValue("scheglov-win", 960)}); + int expected = 960; check_convertToPixels(10.0, ConstantSize.INCH, expected); } } diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/LayoutManagersTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/LayoutManagersTest.java index a8573ccdc..da57ac379 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/LayoutManagersTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/LayoutManagersTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -39,7 +39,6 @@ import org.eclipse.wb.tests.designer.swing.SwingTestUtils; import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.awt.BorderLayout; @@ -605,7 +604,6 @@ public void test_delete() throws Exception { /** * Delete using "Layout" property. */ - @Disabled @Test public void test_delete2() throws Exception { ContainerInfo panel = diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutConverterTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutConverterTest.java index 8f3e40b30..d7735499c 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutConverterTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutConverterTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -18,7 +18,6 @@ import net.miginfocom.swing.MigLayout; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import javax.swing.JTable; @@ -388,7 +387,6 @@ public void test_oneRow_bottom() throws Exception { "}"); } - @Disabled @Test public void test_oneRow_fill() throws Exception { ContainerInfo panel = @@ -483,7 +481,6 @@ public void test_twoRows_spanColumns() throws Exception { "}"); } - @Disabled @Test public void test_Switching_fromGridBagLayout() throws Exception { ContainerInfo panel = @@ -544,7 +541,7 @@ public void test_Switching_fromGridBagLayout() throws Exception { assertEditor( "public class Test extends JPanel {", " public Test() {", - " setLayout(new MigLayout('', '[46px][305px][5px][89px]', '[20px][20px][23px]'));", + " setLayout(new MigLayout('', '[60px][275px][5px][105px]', '[26px][21px][27px]'));", " {", " JComboBox comboBox = new JComboBox();", " add(comboBox, 'cell 1 0,growx,aligny center');", diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutTest.java index 1b3d48c19..11a7e33ce 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/MigLayout/MigLayoutTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -42,7 +42,6 @@ import net.miginfocom.swing.MigLayout; import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.util.List; @@ -234,7 +233,6 @@ public void test_writeDimensions_LC() throws Exception { /** * Test for {@link IGridInfo}. */ - @Disabled @Test public void test_IGridInfo() throws Exception { ContainerInfo panel = @@ -1341,7 +1339,6 @@ public void test_dimensionSize_setCheck() throws Exception { /** * Test for {@link MigDimensionInfo#toUnitString(int, String)}. */ - @Disabled @Test public void test_dimensionSize_toUnitString() throws Exception { ContainerInfo panel = diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutSelectionActionsTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutSelectionActionsTest.java index 0fbbdcfad..c4062c768 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutSelectionActionsTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutSelectionActionsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -19,7 +19,6 @@ import org.eclipse.jface.action.IAction; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -36,7 +35,6 @@ public class GridBagLayoutSelectionActionsTest extends AbstractGridBagLayoutTest // Tests // //////////////////////////////////////////////////////////////////////////// - @Disabled @Test public void test_selectionActions() throws Exception { ContainerInfo panel = diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutTest.java index 646ba630d..a6ef66319 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/layout/gbl/GridBagLayoutTest.java @@ -41,7 +41,6 @@ import org.assertj.core.api.Assertions; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.awt.Component; @@ -2431,7 +2430,6 @@ public Test() { /** * We should not change alignments when paste existing panel. */ - @Disabled @Test public void test_clipboard_disableAutoAlignment() throws Exception { ContainerInfo panel = parseContainer(""" @@ -2492,28 +2490,28 @@ public Test() { } } { - JPanel panel = new JPanel(); - add(panel); + JPanel inner = new JPanel(); + add(inner); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{0, 0, 0}; gridBagLayout.rowHeights = new int[]{0, 0}; gridBagLayout.columnWeights = new double[]{0.0, 0.0, Double.MIN_VALUE}; gridBagLayout.rowWeights = new double[]{0.0, Double.MIN_VALUE}; - panel.setLayout(gridBagLayout); + inner.setLayout(gridBagLayout); { JLabel label = new JLabel(); GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(0, 0, 0, 5); gbc.gridx = 0; gbc.gridy = 0; - panel.add(label, gbc); + inner.add(label, gbc); } { JTextField textField = new JTextField(); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; - panel.add(textField, gbc); + inner.add(textField, gbc); } } } diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/FontPropertyEditorTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/FontPropertyEditorTest.java index 677654557..c34a49e84 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/FontPropertyEditorTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/FontPropertyEditorTest.java @@ -30,7 +30,6 @@ import org.apache.commons.lang3.StringUtils; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.awt.Font; @@ -709,10 +708,9 @@ public void test_copyPaste_null() throws Exception { check_copyPaste(originalSource, expectedSource); } - @Disabled @Test public void test_copyPaste_explicit() throws Exception { - String originalSource = "new Font(\"Arial\", Font.BOLD | Font.ITALIC, 15)"; + String originalSource = "new Font(\"%s\", Font.BOLD | Font.ITALIC, 15)".formatted(Font.SANS_SERIF); String expectedSource = originalSource; check_copyPaste(originalSource, expectedSource); } diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/TabOrderPropertyValueTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/TabOrderPropertyValueTest.java index 4a80e6cf8..c887ec12c 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/TabOrderPropertyValueTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/property/TabOrderPropertyValueTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -23,7 +23,6 @@ import org.eclipse.jdt.core.IJavaProject; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.util.List; @@ -97,7 +96,6 @@ public void test_getValue_1() throws Exception { assertSame(components.get(1), tabOrderInfo.getOrderedInfos().get(1)); } - @Disabled @Test public void test_getValue_2() throws Exception { ProjectUtils.ensureResourceType( @@ -138,7 +136,6 @@ public void test_getValue_2() throws Exception { assertSame(components.get(1), tabOrderInfo.getOrderedInfos().get(0)); } - @Disabled @Test public void test_setValue() throws Exception { // create panel diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/top/JFrameTopBoundsTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/top/JFrameTopBoundsTest.java index e4b1f3da6..3105d0992 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/top/JFrameTopBoundsTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/top/JFrameTopBoundsTest.java @@ -14,8 +14,6 @@ import org.eclipse.wb.internal.swing.model.component.ContainerInfo; import org.eclipse.wb.internal.swing.model.component.top.WindowTopBoundsSupport; -import org.eclipse.wb.tests.designer.Expectations; -import org.eclipse.wb.tests.designer.Expectations.DimValue; import org.eclipse.wb.tests.designer.TestUtils; import org.eclipse.wb.tests.designer.swing.SwingGefTest; @@ -24,7 +22,6 @@ import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.jdt.core.ICompilationUnit; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.awt.Window; @@ -162,13 +159,9 @@ public MyBigFrame() { /** * Using {@link JFrame#pack()}. */ - @Disabled @Test public void test_resize_pack() throws Exception { - Dimension packSize = - Expectations.get(new Dimension(132, 89), new DimValue[]{ - new DimValue("flanker-windows", new Dimension(132, 83)), - new DimValue("scheglov-win", new Dimension(132, 83)),}); + Dimension packSize = new Dimension(119, 80); Dimension resizeSize = new Dimension(450, 300); ICompilationUnit unit = check_resize("// no size", "pack();", packSize, resizeSize, packSize, "// no size"); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/util/SurroundSupportTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/util/SurroundSupportTest.java index 0c87f53f6..4d99ebf2d 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/util/SurroundSupportTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/swing/model/util/SurroundSupportTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -29,7 +29,6 @@ import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.MenuManager; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -327,7 +326,6 @@ public void test_absolute_singleControl() throws Exception { /** * Single {@link ComponentInfo} on {@link AbsoluteLayoutInfo}. */ - @Disabled @Test public void test_absolute_singleControl_onTitledJPanel() throws Exception { ContainerInfo panel =