Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:31:12+00:00 2026-06-06T17:31:12+00:00

Lets say I have a test class called ServiceTest with three test methods test1,

  • 0

Lets say I have a test class called ServiceTest with three test methods test1, test2 and test3. All three methods use some resources which are provided by spring. In the current state of affairs, if there is a problem with the loading of the spring context, the context load is retried for each test method. Is there a way that I can have it aborted on the first failure itself with existing hook-ins? There might be good reasons behind it – but I fail to appreciate it. Any pointers would be helpful. The real problem is that the context load takes a few minutes and is useless to keep reattempting to load context if it has already failed for the first time and only seeks to prolong the time that the CI engine takes to report failures.

I was thinking of proposing a patch to spring guys that can maintain an attempt map in org.springframework.test.context.TestContext which can be used to track attempts made and refrain from trying over and over again. Thoughts?

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:com/kilo/spring/test-context.xml" })
public class ServiceTest {

@Resource(name = "fibonacciService")
private FibonacciService fibonacciService;

@Test
public void test1() {
    long fibonacci = fibonacciService.getFibonacci(5);
}

@Test
public void test2() {
    long fibonacci = fibonacciService.getFibonacci(4);
}

@Test
public void test3() {
    long fibonacci = fibonacciService.getFibonacci(6);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:31:12+00:00Added an answer on June 6, 2026 at 5:31 pm

    No, there is currently no way to have ApplicationContext loading aborted on the first failure with existing hook-ins.

    Feel free to create a JIRA issue against the SPR project and the Test component with your suggestions.

    Regards,

    Sam (author of the Spring TestContext Framework)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say i have a page called https://url.com/test and https://url.com/test2 class Test extends Application
Lets say I have a div like this: <div id=test class=sourcecode> Some String </div>
Let's say I have a test class called testFixtureA with several methods testA ,
Lets say i have this usercontrol public class test : UserControl { public int
Lets say I have hierarchy like this (This is just a test program. Please
Let's say I have a subroutine/method that a user can call to test some
Lets say have this immutable record type: public class Record { public Record(int x,
Lets say I have the below method called DoSomething. When writing unit tests how
To make it easy, lets say I have an arraylist allBooks containing class books
Lets say i have this class: class Test123<T> where T : struct { public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.