Mercurial > lada > lada-server
view src/test/java/de/intevation/lada/BaseTest.java @ 723:9ff0882d73d8 2.1.1
Version 2.1.1
author | Dustin Demuth <dustin@intevation.de> |
---|---|
date | Fri, 14 Aug 2015 10:33:35 +0200 |
parents | 72c4510c3d4d |
children | bc789d180439 |
line wrap: on
line source
/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz * Software engineering by Intevation GmbH * * This file is Free Software under the GNU GPL (v>=3) * and comes with ABSOLUTELY NO WARRANTY! Check out * the documentation coming with IMIS-Labordaten-Application for details. */ package de.intevation.lada; import java.util.List; import org.apache.log4j.Logger; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.WebArchive; import org.junit.After; import org.junit.AfterClass; /** * Base class for Lada server tests. * * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> */ public class BaseTest { private static String ARCHIVE_NAME = "lada-basis-test.war"; private static Logger logger = Logger.getLogger(BaseTest.class); protected static List<Protocol> testProtocol; protected static boolean verboseLogging = false; /** * Create a deployable WAR archive. */ @Deployment(testable=true) public static WebArchive createDeployment() throws Exception { WebArchive archive = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME) .addPackages(true, Package.getPackage("de.intevation.lada")) .addAsResource("log4j.properties", "log4j.properties") .addAsResource("probequery.json", "probequery.json") .addAsResource("messprogrammquery.json", "messprogrammquery.json") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") .addAsResource("META-INF/test-persistence.xml", "META-INF/persistence.xml"); return archive; } @After public final void printLogs() { for (Protocol p : testProtocol) { logger.info(p.toString(verboseLogging)); } } @AfterClass public static final void afterTests() { System.out.println(""); } }