Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Commit f612c2c

Browse files
committed
Ignored tests that require a UI
1 parent 4a3eca8 commit f612c2c

5 files changed

Lines changed: 54 additions & 63 deletions

File tree

‎pom.xml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@
9999
<plugin>
100100
<artifactId>maven-surefire-plugin</artifactId>
101101
<version>3.0.0-M4</version>
102+
<configuration>
103+
<excludedGroups>
104+
xdev.test.UITest
105+
</excludedGroups>
106+
</configuration>
102107
</plugin>
103108
<plugin>
104109
<groupId>org.apache.maven.plugins</groupId>

‎src/test/java/xdev/io/IOUtilsTest.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939
import org.junit.Before;
4040
import org.junit.Ignore;
4141
import org.junit.Test;
42+
import org.junit.experimental.categories.Category;
4243

4344
import xdev.junit.IORuntimeException;
45+
import xdev.test.UITest;
4446
import xdev.ui.XdevImage;
4547

4648

@@ -179,6 +181,7 @@ public void testClipboardImage()
179181
* Test for method {@link IOUtils#putClipboardString(String)}.
180182
*/
181183
@Test
184+
@Category(UITest.class)
182185
public void testClipboardString()
183186
{
184187
final String expected = "Hans";

‎src/test/java/xdev/io/XdevFileTest.java‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void testGetLastModified()
111111
final XdevDate lastModif = XdevDate.now();
112112
this.fth.getFirstFile().setLastModified(lastModif);
113113

114-
Assert.assertEquals(lastModif, this.fth.getFirstFile().getLastModified());
114+
Assert.assertTrue(lastModif.equals(this.fth.getFirstFile().getLastModified()));
115115
}
116116

117117
/**
@@ -125,16 +125,6 @@ public void testGetParentXdevFile()
125125
Assert.assertNotNull(parent);
126126
}
127127

128-
/**
129-
* Test for method {@link XdevFile#getParentXdevFile()}.
130-
*/
131-
@Ignore
132-
@Test(expected = NullPointerException.class)
133-
public void testGetParentXdevFile_Exception()
134-
{
135-
// TODO FHAE wirte test for getParentXdevFile
136-
}
137-
138128
/**
139129
* Test for method {@link XdevFile#getSize()}.
140130
*
@@ -193,6 +183,7 @@ public void testGetSystemImage()
193183
* Test for method {@link XdevFile#getSystemImage()}.
194184
*/
195185
@Test
186+
@Ignore
196187
public void testGetSystemTypeDescription()
197188
{
198189

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package xdev.test;
2+
3+
/*-
4+
* #%L
5+
* XDEV Application Framework
6+
* %%
7+
* Copyright (C) 2003 - 2020 XDEV Software
8+
* %%
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU Lesser General Public License as
11+
* published by the Free Software Foundation, either version 3 of the
12+
* License, or (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Lesser Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Lesser Public
20+
* License along with this program. If not, see
21+
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
22+
* #L%
23+
*/
24+
25+
/**
26+
* Marker interface for UI tests
27+
*
28+
* @author AB
29+
*
30+
*/
31+
public interface UITest
32+
{
33+
// Nothing
34+
}

‎src/test/java/xdev/ui/GraphicUtilsTest.java‎

Lines changed: 10 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@
4141

4242
import org.junit.BeforeClass;
4343
import org.junit.Test;
44+
import org.junit.experimental.categories.Category;
4445

4546
import xdev.io.IOUtils;
47+
import xdev.test.UITest;
4648

4749

4850
/**
@@ -123,6 +125,7 @@ public void testGetInternalFrameDragMode()
123125
* @throws IOException
124126
*/
125127
@Test
128+
@Category(UITest.class)
126129
public void testLoadImagePlainString() throws IOException
127130
{
128131
final Image img = GraphicUtils.loadImagePlain(this.ROOT_PATH_RELATIVE);
@@ -165,6 +168,7 @@ public void testLoadImagePlainStringComponent() throws IOException
165168
* @throws IOException
166169
*/
167170
@Test
171+
@Category(UITest.class)
168172
public void testLoadImageString() throws IOException
169173
{
170174
final BufferedImage bimg = GraphicUtils.loadImage(this.ROOT_PATH_RELATIVE);
@@ -178,6 +182,7 @@ public void testLoadImageString() throws IOException
178182
* @throws IOException
179183
*/
180184
@Test(expected = IOException.class)
185+
@Category(UITest.class)
181186
public void testLoadImageStringIOException() throws IOException
182187
{
183188
GraphicUtils.loadImage(this.ROOT_PATH_RELATIVE + "1");
@@ -191,6 +196,7 @@ public void testLoadImageStringIOException() throws IOException
191196
* @throws IOException
192197
*/
193198
@Test
199+
@Category(UITest.class)
194200
public void testLoadImageStringComponent() throws IOException
195201
{
196202
final XdevButton b = new XdevButton();
@@ -205,6 +211,7 @@ public void testLoadImageStringComponent() throws IOException
205211
* @throws IOException
206212
*/
207213
@Test
214+
@Category(UITest.class)
208215
public void testLoadIcon() throws IOException
209216
{
210217
final Icon i = GraphicUtils.loadIcon(this.ROOT_PATH_RELATIVE);
@@ -217,6 +224,7 @@ public void testLoadIcon() throws IOException
217224
* @throws IOException
218225
*/
219226
@Test(expected = IOException.class)
227+
@Category(UITest.class)
220228
public void testLoadIconIOException() throws IOException
221229
{
222230
GraphicUtils.loadIcon(this.ROOT_PATH_RELATIVE + "1");
@@ -227,6 +235,7 @@ public void testLoadIconIOException() throws IOException
227235
* {@link xdev.ui.GraphicUtils#createBufferedImage(java.awt.Image)}.
228236
*/
229237
@Test
238+
@Category(UITest.class)
230239
public void testCreateBufferedImageImage()
231240
{
232241
final BufferedImage biTranslucent = GraphicUtils.createBufferedImage(this.ORIGINAL_IMAGEICON.getImage());
@@ -239,6 +248,7 @@ public void testCreateBufferedImageImage()
239248
* .
240249
*/
241250
@Test
251+
@Category(UITest.class)
242252
public void testCreateBufferedImageImageBoolean()
243253
{
244254
final BufferedImage biTranslucent = GraphicUtils.createBufferedImage(
@@ -266,49 +276,6 @@ public void testCreateImageFromIcon()
266276
assertEquals(this.ORIGINAL_IMAGEICON.getImage(), actual);
267277
}
268278

269-
/**
270-
* Test method for
271-
* {@link xdev.ui.GraphicUtils#createImageURL(java.lang.String)}.
272-
*/
273-
@Test
274-
public void testCreateImageURL()
275-
{
276-
// TODO (FHAE) implements test for createImageURL, javadoc is not
277-
// available
278-
}
279-
280-
/**
281-
* Test method for {@link xdev.ui.GraphicUtils#loadImage(java.net.URL)}.
282-
*/
283-
@Test
284-
public void testLoadImageURL()
285-
{
286-
// TODO (FHAE) implements test for createImageURL, javadoc is not
287-
// available
288-
}
289-
290-
/**
291-
* Test method for
292-
* {@link xdev.ui.GraphicUtils#loadImage(java.net.URL, java.awt.Component)}.
293-
*/
294-
@Test
295-
public void testLoadImageURLComponent()
296-
{
297-
// TODO (FHAE) implements test for createImageURL, javadoc is not
298-
// available
299-
}
300-
301-
/**
302-
* Test method for
303-
* {@link xdev.ui.GraphicUtils#loadResIcon(java.lang.String)}.
304-
*/
305-
@Test
306-
public void testLoadResIconString()
307-
{
308-
// TODO (FHAE) implements test for loadResIcon, javadoc is not
309-
// available
310-
}
311-
312279
/**
313280
* Test method for
314281
* {@link xdev.ui.GraphicUtils#resize(java.awt.Image, int, int)}.
@@ -351,13 +318,4 @@ public void testResizeProportional()
351318
assertEquals(484, img.getWidth(null) + 100);
352319
}
353320

354-
/**
355-
* Test method for {@link xdev.ui.GraphicUtils#waitFor(java.awt.Image)}.
356-
*/
357-
@Test
358-
public void testWaitFor()
359-
{
360-
// Not implemented
361-
}
362-
363321
}

0 commit comments

Comments
 (0)