@@ -0,0 +1,2679 @@
+/****************************************************************************%0A * Copyright (C) 2014 ecsec GmbH.%0A * All rights reserved.%0A * Contact: ecsec GmbH (info@ecsec.de)%0A *%0A * This file is part of the Open eCard App.%0A *%0A * GNU General Public License Usage%0A * This file may be used under the terms of the GNU General Public%0A * License version 3.0 as published by the Free Software Foundation%0A * and appearing in the file LICENSE.GPL included in the packaging of%0A * this file. Please review the following information to ensure the%0A * GNU General Public License version 3.0 requirements will be met:%0A * http://www.gnu.org/copyleft/gpl.html.%0A *%0A * Other Usage%0A * Alternatively, this file may be used in accordance with the terms%0A * and conditions contained in a signed written agreement between%0A * you and ecsec GmbH.%0A *%0A ***************************************************************************/%0A%0Apackage org.openecard.cif;%0A%0Aimport java.awt.image.BufferedImage;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.net.URL;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Properties;%0Aimport javax.imageio.ImageIO;%0Aimport javax.swing.ImageIcon;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport static org.testng.Assert.*;%0Aimport org.testng.annotations.BeforeClass;%0Aimport org.testng.annotations.Test;%0A%0A%0A/**%0A * Test to evaluate the availability of the images.%0A *%0A * @author Tobias Wich%0A */%0Apublic class ImageChecker %7B%0A%0A    private static final Logger logger = LoggerFactory.getLogger(ImageChecker.class);%0A    private List%3CURL%3E imageUrls;%0A%0A    @BeforeClass%0A    public void loadImageUrls() throws IOException %7B%0A%09// load properties file%0A%09InputStream in = ImageChecker.class.getResourceAsStream(%22/card-images/card-images.properties%22);%0A%09Properties p = new Properties();%0A%09p.load(in);%0A%0A%09// convert each entry into a URL%0A%09imageUrls = new ArrayList%3C%3E();%0A%09for (Map.Entry%3CObject, Object%3E next : p.entrySet()) %7B%0A%09    String file = (String) next.getValue();%0A%09    URL url = ImageChecker.class.getResource(%22/card-images/%22 + file);%0A%09    imageUrls.add(url);%0A%09%7D%0A    %7D%0A%0A    @Test%0A    public void testPresence() throws IOException %7B%0A%09for (URL url : imageUrls) %7B%0A%09    url.openStream();%0A%09    assertNotNull(url);%0A%09%7D%0A    %7D%0A%0A    // TODO: remove integration test as soon as OpenJDK 8 in Debian can handle JPEGs correctly%0A    // see also https://dev.openecard.org/issues/369%0A    @Test(groups=%7B%22it%22%7D)%0A    public void testLoadImages() throws IOException %7B%0A%09for (URL url : imageUrls) %7B%0A%09    logger.info(%22Trying to load image '%7B%7D'.%22, url);%0A%09    BufferedImage bi = ImageIO.read(url);%0A%09    ImageIcon icon = new ImageIcon(bi);%0A%09%7D%0A    %7D%0A%0A%7D%0A

Add test to validate card images