Browse souce code repository at: https://github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/tests/java/awt/FontEffectsTest.java
package tests.java.awt;

import static org.junit.Assert.assertFalse;

import java.awt.EventQueue;
import java.awt.FontFormatException;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

import org.junit.Test;
import com.github.jjYBdx4IL.utils.env.Maven;
import com.github.jjYBdx4IL.utils.gfx.FontEffects;
import com.github.jjYBdx4IL.utils.junit4.InteractiveTestBase;
import com.github.jjYBdx4IL.utils.junit4.Screenshot;

public class FontEffectsTest extends InteractiveTestBase {

    private static final File TEMP_DIR = Maven.getTempTestDir(FontEffectsTest.class);

    @Test
    public void testFontEffects()
        throws InterruptedException, InvocationTargetException, FontFormatException, IOException {
        openWindow();

        assertFalse(EventQueue.isDispatchThread());

        FontEffects effects = new FontEffects();
        effects.setText("blur shadow, no glass");
        effects.setShadowType(FontEffects.ShadowType.BLUR);
        effects.setGlassBG(false);
        effects.setShadowOffset(15);
        effects.paint();
        appendImage(effects.getImage());

        effects = new FontEffects();
        effects.setText("blur shadow, glass");
        effects.setShadowType(FontEffects.ShadowType.BLUR);
        effects.setGlassBG(true);
        effects.setShadowOffset(15);
        effects.paint();
        appendImage(effects.getImage());

        effects = new FontEffects();
        effects.setText("drop shadow, no glass");
        effects.setShadowType(FontEffects.ShadowType.DROP);
        effects.setGlassBG(false);
        effects.setShadowOffset(15);
        effects.paint();
        appendImage(effects.getImage());

        effects = new FontEffects();
        effects.setText("drop shadow, glass");
        effects.setShadowType(FontEffects.ShadowType.DROP);
        effects.setGlassBG(true);
        effects.setShadowOffset(15);
        effects.paint();
        appendImage(effects.getImage());

        Screenshot.takeDesktopScreenshot(FontEffectsTest.class.getName() + ".png", true);
        writeWindowAsPng(new File(TEMP_DIR, "FontEffectsTest.png"));
        // 
        waitForWindowClosing();
    }
}
-------------------------------------------------------------------------------
Test set: tests.java.awt.FontEffectsTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.413 s - in tests.java.awt.FontEffectsTest
testFontEffects  Time elapsed: 2.413 s