All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.refit.cdi.CdiFitSuite Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
/*
 * Copyright 2011 Harald Wellmann
 *
 * This file is part of reFit.
 * 
 * reFit is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * reFit is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with reFit.  If not, see .
 */
package com.googlecode.refit.cdi;

import org.junit.runners.model.InitializationError;

import com.googlecode.refit.junit.FitSuite;

import fit.FixtureLoader;

/**
 * Use this class to run a suite of FIT tests under JUnit. To do so, create a class with the
 * following annotations:
 * 
 * @RunWith(SpringFitSuite.class)
 * @FitConfiguration(
 *     inputDir = "src/test/fit", 
 *     outputDir = "target/fit", 
 *     includes = "**/*.fit.html")
 * public class MyFitSuite {
 * }
 * 
* * The suite first builds a list of input files to be run as FIT tests. The input files are * located under the {@code inputDir} root. The file patterns to be included or excluded are specified * by the {@code includes} and {@code excludes} properties. The default include pattern is * {@code **/*.html}, the exclude pattern list is empty by default. * Each of these properties can be a list of Strings * interpreted as Ant file patterns. *

* The suite then runs all files matching at least one of the include patterns and none of the * exclude patterns. *

* Each test file will be a direct child of the suite, named by its relative path. *

* Each fixture class referenced from the FIT test files needs to be annotated with * {@link ContextConfiguration} to specify the Spring context configuration. Spring dependency * injection will be performed automatically after fixture instantiation. * * @author hwellmann * */ public class CdiFitSuite extends FitSuite { public CdiFitSuite(Class klass) throws InitializationError { super(klass); FixtureLoader.setInstance(new CdiFixtureLoader()); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy