Skip to content

Commit

Permalink
enhance travis build for better log
Browse files Browse the repository at this point in the history
add intilization of JavaFX Platform for some test (to avoid unnecessary log errors)
  • Loading branch information
McFoggy committed Sep 18, 2013
1 parent 6ab4e60 commit bedaaca
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ before_install:
- "export DISPLAY=:99.0"
- "export TERM=dumb"
- "sh -e /etc/init.d/xvfb start"
script: gradle clean check --info
after_script:
- "cat ./build/test-results/*.xml"
jdk:
- oraclejdk7
25 changes: 25 additions & 0 deletions src/test/java/jfxtras/labs/JavaFXPlatformAbstractTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package jfxtras.labs;

import java.util.concurrent.CountDownLatch;

import javafx.embed.swing.JFXPanel;

import javax.swing.SwingUtilities;

import org.junit.BeforeClass;

public class JavaFXPlatformAbstractTest {
@BeforeClass public static final void initJavaFXPlatform() {
final CountDownLatch latch = new CountDownLatch(1);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new JFXPanel(); // initializes JavaFX environment
latch.countDown();
}
});
try {
latch.await();
} catch (InterruptedException e) {
}
}
}
5 changes: 3 additions & 2 deletions src/test/java/jfxtras/labs/map/tile/TileRepositoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import javafx.scene.image.ImageView;
import jfxtras.labs.JavaFXPlatformAbstractTest;
import jfxtras.labs.map.ApiKeys;
import jfxtras.labs.map.tile.bing.BingTileSourceFactory;
import jfxtras.labs.map.tile.bing.BingType;
import jfxtras.labs.map.tile.local.LocalTileSourceFactory;
import jfxtras.labs.map.tile.osm.OsmTileSourceFactory;
import jfxtras.labs.map.tile.osm.OsmType;

import org.junit.Before;
import org.junit.Test;

/**
Expand All @@ -48,8 +50,7 @@
* @author Mario Schroeder
*
*/
public class TileRepositoryTest {

public class TileRepositoryTest extends JavaFXPlatformAbstractTest {
@Test
public void testWithNull(){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,29 @@

package jfxtras.labs.map.tile.attribution;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.List;

import jfxtras.labs.JavaFXPlatformAbstractTest;
import jfxtras.labs.map.ApiKeys;
import jfxtras.labs.map.tile.Attribution;
import jfxtras.labs.map.tile.bing.BingAttributionLoader;
import jfxtras.labs.map.tile.bing.BingImageMetaDataHandler;
import jfxtras.labs.map.tile.bing.BingMapMetaDataHandler;
import jfxtras.labs.map.tile.bing.BingMetaDataHandler;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

/**
*
* @author Mario Schroeder
*/
public class BingAttributionLoaderTest {

public class BingAttributionLoaderTest extends JavaFXPlatformAbstractTest {
/**
* Test of load method, of class BingAttributionLoader.
*/
Expand Down

0 comments on commit bedaaca

Please sign in to comment.