Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -23,7 +23,6 @@
import org.eclipse.wb.tests.designer.core.model.TestObjectInfo;
import org.eclipse.wb.tests.designer.rcp.RcpModelTest;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
Expand Down Expand Up @@ -1043,13 +1042,13 @@ public void test_align_space_equally_2() throws Exception {
// Center in window
//
////////////////////////////////////////////////////////////////////////////
@Disabled
@Test
public void test_align_center_in_window() throws Exception {
CompositeInfo shell =
parseComposite(
"class Test extends Shell {",
" Test() {",
" super(SWT.NO_TRIM);",
" setSize(600, 400);",
" {",
" Button button = new Button(this, SWT.NONE);",
Expand All @@ -1073,10 +1072,11 @@ public void test_align_center_in_window() throws Exception {
assertEditor(
"class Test extends Shell {",
" Test() {",
" super(SWT.NO_TRIM);",
" setSize(600, 400);",
" {",
" Button button = new Button(this, SWT.NONE);",
" button.setBounds(262, 180, 60, 40);",
" button.setBounds(270, 180, 60, 40);",
" button.setText('000');",
" }",
" }",
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -32,7 +32,6 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentMatchers;

Expand Down Expand Up @@ -487,7 +486,6 @@ public void test_setStyle_fromCascade_toSeparator() throws Exception {
/**
* Test adding a selection listener to menu item.
*/
@Disabled
@Test
public void test_addSelectionListener() throws Exception {
CompositeInfo shell =
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -31,6 +31,13 @@
* @author lobas_av
*/
public abstract class ImagePropertyEditorTest extends RcpModelTest {

@Override
protected void configureNewProject() throws Exception {
super.configureNewProject();
m_testProject.addPlugin("org.eclipse.wb.core");
}

////////////////////////////////////////////////////////////////////////////
//
// Utils
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,7 +22,6 @@

import org.apache.commons.io.FilenameUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.File;
Expand Down Expand Up @@ -97,24 +96,22 @@ public void test_textSource_absolutePath() throws Exception {
/**
* Image creation using constructor with input stream (over class resource).
*/
@Disabled
@Test
public void test_textSource_image_over_classpath() throws Exception {
assert_getText_getClipboardSource_forSource(
"new Image(null, getClass().getResourceAsStream(\"/javax/swing/plaf/basic/icons/JavaCup16.png\"))",
"Classpath: /javax/swing/plaf/basic/icons/JavaCup16.png",
"new org.eclipse.swt.graphics.Image(null, {wbp_classTop}.getResourceAsStream(\"/javax/swing/plaf/basic/icons/JavaCup16.png\"))");
"new Image(null, getClass().getResourceAsStream(\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\"))",
"Classpath: /org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif",
"new org.eclipse.swt.graphics.Image(null, {wbp_classTop}.getResourceAsStream(\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\"))");
}

/**
* Image creation using constructor with input stream (over class resource).
*/
@Disabled
@Test
public void test_textSource_image_over_classpath_OtherClass() throws Exception {
assert_getText_getClipboardSource_forSource(
"new Image(null, java.lang.String.class.getResourceAsStream(\"/javax/swing/plaf/basic/icons/JavaCup16.png\"))",
"Classpath: /javax/swing/plaf/basic/icons/JavaCup16.png",
"new org.eclipse.swt.graphics.Image(null, {wbp_classTop}.getResourceAsStream(\"/javax/swing/plaf/basic/icons/JavaCup16.png\"))");
"new Image(null, org.eclipse.wb.core.editor.constants.CoreImages.class.getResourceAsStream(\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\"))",
"Classpath: /org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif",
"new org.eclipse.swt.graphics.Image(null, {wbp_classTop}.getResourceAsStream(\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\"))");
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -26,7 +26,6 @@

import org.apache.commons.io.FilenameUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.File;
Expand Down Expand Up @@ -103,25 +102,23 @@ public void test_textSource_absolutePath() throws Exception {
/**
* Image creation using constructor with input stream (over class resource).
*/
@Disabled
@Test
public void test_textSource_image_over_classpath() throws Exception {
assert_getText_getClipboardSource_forSource(
"new Image(null, getClass().getResourceAsStream(\"/javax/swing/plaf/basic/icons/JavaCup16.png\"))",
"Classpath: /javax/swing/plaf/basic/icons/JavaCup16.png",
getInvocationSource(shell(), "{wbp_classTop}", "/javax/swing/plaf/basic/icons/JavaCup16.png"));
"new Image(null, getClass().getResourceAsStream(\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\"))",
"Classpath: /org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif",
getInvocationSource(shell(), "{wbp_classTop}", "\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\""));
}

/**
* Image creation using constructor with input stream (over class resource).
*/
@Disabled
@Test
public void test_textSource_image_over_classpath_OtherClass() throws Exception {
assert_getText_getClipboardSource_forSource(
"new Image(null, java.lang.String.class.getResourceAsStream(\"/javax/swing/plaf/basic/icons/JavaCup16.png\"))",
"Classpath: /javax/swing/plaf/basic/icons/JavaCup16.png",
getInvocationSource(shell(), "{wbp_classTop}", "/javax/swing/plaf/basic/icons/JavaCup16.png"));
"new Image(null, org.eclipse.wb.core.editor.constants.CoreImages.class.getResourceAsStream(\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\"))",
"Classpath: /org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif",
getInvocationSource(shell(), "{wbp_classTop}", "\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\""));
}

////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -154,9 +151,9 @@ public void test_textSource_absolutePath2() throws Exception {
public void test_textSource_image_over_classpath2() throws Exception {
CompositeInfo shell = shell();
assert_getText_getClipboardSource_forSource2(
getInvocationSource(shell, "getClass()", "\"/javax/swing/plaf/basic/icons/JavaCup16.png\""),
"Classpath: /javax/swing/plaf/basic/icons/JavaCup16.png",
getInvocationSource(shell, "{wbp_classTop}", "\"/javax/swing/plaf/basic/icons/JavaCup16.png\""));
getInvocationSource(shell, "getClass()", "\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\""),
"Classpath: /org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif",
getInvocationSource(shell, "{wbp_classTop}", "\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\""));
}

/**
Expand All @@ -166,9 +163,9 @@ public void test_textSource_image_over_classpath2() throws Exception {
public void test_textSource_image_over_classpath_OtherClass2() throws Exception {
CompositeInfo shell = shell();
assert_getText_getClipboardSource_forSource2(
getInvocationSource(shell, "java.lang.String.class", "\"/javax/swing/plaf/basic/icons/JavaCup16.png\""),
"Classpath: /javax/swing/plaf/basic/icons/JavaCup16.png",
getInvocationSource(shell, "{wbp_classTop}", "\"/javax/swing/plaf/basic/icons/JavaCup16.png\""));
getInvocationSource(shell, "java.lang.String.class", "\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\""),
"Classpath: /org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif",
getInvocationSource(shell, "{wbp_classTop}", "\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\""));
}

/**
Expand Down Expand Up @@ -210,15 +207,15 @@ public void test_textSource_order() throws Exception {
"}");
ManagerContainerInfo.getResourceManagerInfo(shell);
shell.addMethodInvocation("setImage(org.eclipse.swt.graphics.Image)",
getInvocationSource(shell, "java.lang.String.class", "\"/javax/swing/plaf/basic/icons/JavaCup16.png\""));
getInvocationSource(shell, "java.lang.String.class", "\"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\""));
shell.refresh();
assertEditor(
"// filler filler filler",
"public class Test extends Shell {",
" private LocalResourceManager localResourceManager;",
" public Test() {",
" createResourceManager();",
" setImage(localResourceManager.create(ImageDescriptor.createFromFile(String.class, \"/javax/swing/plaf/basic/icons/JavaCup16.png\")));",
" setImage(localResourceManager.create(ImageDescriptor.createFromFile(String.class, \"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif\")));",
" }",
" private void createResourceManager() {",
" localResourceManager = new LocalResourceManager(JFaceResources.getResources(),this);",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.wb.tests.designer.swt.model.property;

import org.eclipse.wb.core.editor.constants.CoreImages;
import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils;
import org.eclipse.wb.internal.swt.model.widgets.CompositeInfo;
import org.eclipse.wb.internal.swt.utils.ManagerUtils;
Expand All @@ -23,7 +24,6 @@

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.File;
Expand All @@ -41,6 +41,12 @@ public class SWTResourceManagerTest extends RcpModelTest {
private Class<?> SWTManagerClass;
private Class<?> ImageClass;

@Override
protected void configureNewProject() throws Exception {
super.configureNewProject();
m_testProject.addPlugin("org.eclipse.wb.core");
}

////////////////////////////////////////////////////////////////////////////
//
// Life cycle
Expand Down Expand Up @@ -212,7 +218,6 @@ public void test_getImage_absolute() throws Exception {
}
}

@Disabled
@Test
public void test_getImage_classpath() throws Exception {
// create image over SWTResourceManager
Expand All @@ -221,7 +226,7 @@ public void test_getImage_classpath() throws Exception {
SWTManagerClass,
"getImage(java.lang.Class,java.lang.String)",
SWTManagerClass,
"/javax/swing/plaf/basic/icons/JavaCup16.png");
"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif");
// check create
assertNotNull(image);
// check state
Expand All @@ -230,10 +235,11 @@ public void test_getImage_classpath() throws Exception {
SWTManagerClass,
"getImage(java.lang.Class,java.lang.String)",
SWTManagerClass,
"/javax/swing/plaf/basic/icons/JavaCup16.png"));
"/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif"));
// load image directly over Image
Image directImage = new Image(null,
getClass().getResourceAsStream("/javax/swing/plaf/basic/icons/JavaCup16.png"));
ImageData directImageData = new ImageData(
CoreImages.class.getResourceAsStream("/org/eclipse/wb/core/controls/flyout/icons/arrow_bottom.gif"));
Image directImage = new Image(null, directImageData);
// check equals images
try {
assertEqualsImage(image, directImage);
Expand All @@ -246,14 +252,14 @@ public void test_getImage_classpath() throws Exception {
SWTManagerClass,
"getImage(java.lang.Class,java.lang.String)",
SWTManagerClass,
"/javax/swing/plaf/basic/icons/image-failed.png");
"/org/eclipse/wb/core/controls/flyout/icons/arrow_top.gif");
assertNotNull(image1);
assertFalse(image1.isDisposed());
assertSame(image1, ReflectionUtils.invokeMethod(
SWTManagerClass,
"getImage(java.lang.Class,java.lang.String)",
SWTManagerClass,
"/javax/swing/plaf/basic/icons/image-failed.png"));
"/org/eclipse/wb/core/controls/flyout/icons/arrow_top.gif"));
assertNotSame(image, image1);
}

Expand Down Expand Up @@ -314,18 +320,17 @@ private static void assertEqualsImage(Image image1, Image image2) throws Excepti
ImageData data1 = image1.getImageData();
ImageData data2 = image2.getImageData();

assertEquals(data1.width, data2.width);
assertEquals(data1.height, data2.height);
assertEquals(data1.depth, data2.depth);
assertEquals(data1.scanlinePad, data2.scanlinePad);
assertEquals(data1.bytesPerLine, data2.bytesPerLine);
assertEquals(data1.transparentPixel, data2.transparentPixel);
assertEquals(data1.maskPad, data2.maskPad);
assertEquals(data1.alpha, data2.alpha);
// Type is only set when image was created via ImageData (Windows)
// assertEquals(data1.type, data2.type);
assertEquals(data1.x, data2.x);
assertEquals(data1.y, data2.y);
assertEquals(data1.width, data2.width, "width");
assertEquals(data1.height, data2.height, "height");
assertEquals(data1.depth, data2.depth, "depth");
assertEquals(data1.scanlinePad, data2.scanlinePad, "scanline pad");
assertEquals(data1.bytesPerLine, data2.bytesPerLine, "bytes per line");
assertEquals(data1.transparentPixel, data2.transparentPixel, "transparent pixel");
assertEquals(data1.maskPad, data2.maskPad, "mask pad");
assertEquals(data1.alpha, data2.alpha, "alpha");
assertEquals(data1.type, data2.type);
assertEquals(data1.x, data2.x, "x");
assertEquals(data1.y, data2.y, "y");
}

////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.util.List;
Expand Down Expand Up @@ -186,8 +185,6 @@ public void test_add_TableItem() throws Exception {
* In SWT Cocoa and Linux GTK, the column headers are excluded from the client
* area, hence why we have to adjust them for the tests.
*/
// Disabled because of https://github.com/eclipse-windowbuilder/windowbuilder/issues/389
@Disabled
@Test
public void test_TableColumn() throws Exception {
CompositeInfo shell =
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -28,7 +28,6 @@
import org.eclipse.swt.widgets.Shell;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
Expand All @@ -51,8 +50,6 @@ public void _test_exit() throws Exception {
// Tests
//
////////////////////////////////////////////////////////////////////////////
// Disabled because of https://github.com/eclipse-windowbuilder/windowbuilder/issues/389
@Disabled
@Test
public void test_1() throws Exception {
ShellInfo shell = (ShellInfo) parseComposite(
Expand Down Expand Up @@ -100,7 +97,6 @@ public void test_1() throws Exception {
/**
* Test for {@link CoordinateUtils#getClientAreaInsets2(Object)} for {@link Group}.
*/
@Disabled
@Test
public void test_withGroup() throws Exception {
CompositeInfo shell =
Expand Down
Loading