Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

Usage of the AbstractIntegrationTestBase base class

  1. The following code fragment illustrates how to use AbstractIntegrationTestBase class
    Code Block
    import edu.mit.csf.test.AbstractIntegrationTestBase;
    
    public class TestHibernateAcademicTermDao extends AbstractIntegrationTestBase {
    
    }
    

  2. Add the following dependencies to your project's pom.xml.
    Code Block
            <dependency>
                <groupId>edu.mit.ist.es.csf</groupId>
                <artifactId>csf-test</artifactId>
                <version>[0.0.0,999.999.999)</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>edu.mit.ist.es.csf</groupId>
                <artifactId>csf-test</artifactId>
                <version>[0.0.0,999.999.999)</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.10</version>
            </dependency>
    
{anchor:configure default context} h3. How to configuration the default test application context The annotation @ContextConfiguration(locations =

{"classpath:applicationContext-csf-unit-tests-default.xml"})

is

used

to

set

the

default

application

context

for

all

the

junit

tests

which

extend

the

AbstractIntegrationTestBase

.java

class.

&nbsp;&nbsp; If the project was created using the

  

If the project was created using the es-project-template

(for

either

the

jar

or

war)

then

applicationContext-csf-unit-tests-default.xml

file

can

be

found

it

the

project's

src/test/resources

directory.

If

the

was

not

created

using

the

es-project-template,

then

the

applicationContext-csf-unit-tests-default.xml

must

be

created

in

the

projects

src/test/resources

directory.

&nbsp;&nbsp;To download the

  To download the applicationContext-csf-unit-tests-default.xml

file,

[

right

click

on

this

link

| ^applicationContext-csf-unit-tests-default.xml]

and

select

*

Save

target

as...

*.&nbsp;&nbsp;{color:red}Be sure to save the file in the

.  Be sure to save the file in the project's

src/test/resources

directory.

{color}

Panel

Anchor
configure default context
configure default context

How to configuration the default test application context

The annotation

@ContextConfiguration(locations =

Wiki Markup
Panel

Anchor
override default context
override default context

How to override for the default test application context