Note that there are some explanatory texts on larger screens.

plurals
  1. PORunWith and ContextConfiguration weird behaviour
    primarykey
    data
    text
    <p>I have this very simple class :</p> <pre><code> @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath*:/application-context-this-does-not-exist.xml"}) public class HTMLSourceExtractorImplTest { @Autowired ApplicationContext context; @Test public void test(){ String [] beans = context.getBeanDefinitionNames(); for(String bean : beans){ System.out.println(bean); } System.out.println("Testing"); } } </code></pre> <p>This context file that is specified in classpath DOES NOT EXIST. I can put virtually any name I want and the code does not break. I mean the test runs just fine, as if that file really exists.</p> <p>If I do a small change, from : <strong>classpath*</strong> to <strong>classpath</strong> , then it beaks, saying that this file does not exist, which is the behavior I would expect in the first case also.</p> <p>Spring Version 3.2.3.RELEASE. </p> <p>Can someone explain this weird behavior? </p> <p><strong>EDIT</strong></p> <p>Things from logs as suggested:</p> <pre><code> 20:47:26,923 INFO [GenericApplicationContext] Refreshing org.springframework.context.support.GenericApplicationContext@3df6c65c: startup date [Fri Jun 07 20:47:26 PDT 2013]; root of context hierarchy </code></pre> <p>I even tried to output all beans from application context:</p> <pre><code> org.springframework.context.annotation.internalConfigurationAnnotationProcessor org.springframework.context.annotation.internalAutowiredAnnotationProcessor org.springframework.context.annotation.internalRequiredAnnotationProcessor org.springframework.context.annotation.internalCommonAnnotationProcessor org.springframework.context.annotation.ConfigurationClassProcessor.importAwareProcessor </code></pre> <p>Seems to me that in case of a wildcard, Spring will create a default empty Application Context</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload