<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=cbeams" rel="nofollow">Chris Beams</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6184?redirect=false" rel="nofollow">SPR-6184</a></strong> and commented</p>
<p dir="auto">Currently, JavaConfig integrates with the TestContext framework via its <code class="notranslate">ContextLoader</code> implementation, <code class="notranslate">JavaConfigContextLoader</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations=&quot;com.bank.TransferAppConfig&quot;,
                      loader=JavaConfigContextLoader.class)
public class TransferServiceTests {
    // @Test methods ...
}"><pre class="notranslate"><code class="notranslate">@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="com.bank.TransferAppConfig",
                      loader=JavaConfigContextLoader.class)
public class TransferServiceTests {
    // @Test methods ...
}
</code></pre></div>
<p dir="auto">This integration works well enough but is not refactoring-friendly due to the requirement that <code class="notranslate">@ContextConfiguration</code> imposes that locations must be a <code class="notranslate">String[]</code>. It forces the fully-qualified class name to be expressed as a string, when it would clearly be superior to be able to pass it around by <code class="notranslate">Class</code> literal.</p>
<p dir="auto">Implementing this change would require a change to core, either by adding an attribute to <code class="notranslate">@ContextConfiguration</code> that takes a <code class="notranslate">Class[]</code> (not likely), or otherwise devising a way of proving a customized annotation (e.g., <code class="notranslate">@JavaConfigContextConfiguration</code>).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 GA</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398112598" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13033" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13033/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13033">#13033</a> Introduce SmartContextLoader SPI (<em><strong>"is depended on by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398111738" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12888" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12888/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12888">#12888</a> Document TestContext support for <code class="notranslate">@Configuration</code> classes in the reference manual (<em><strong>"is depended on by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398108905" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12425" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12425/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12425">#12425</a> SpringJUnit4ClassRunner is not compatible with java context configuration (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398100929" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11233" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11233/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11233">#11233</a> Annotation configuration based TestContext (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a href="https://jira.spring.io/browse/SJC-272" rel="nofollow">SJC-272</a> JavaConfigContextLoader support with Spring 3.0 (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398112658" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13042" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13042/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13042">#13042</a> AnnotationConfigContextLoader should not restrict the name of default configuration classes to ContextConfiguration</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398110141" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12615" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12615/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12615">#12615</a> TestContext framework should support declarative configuration of bean definition profiles</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398109984" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12592" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12592/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12592">#12592</a> Support for dependency injection and initialization of test instances using classpath scanning</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398094525" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10353" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10353/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10353">#10353</a> Provide dedicated ApplicationContext implementations for use with (JavaConfig) <code class="notranslate">@Configuration</code> classes</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398106528" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12078" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12078/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12078">#12078</a> Support Java-Based Application Configuration</li>
</ul>
<p dir="auto">37 votes, 30 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=cedrik_lime" rel="nofollow">Cédrik LIME</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7743?redirect=false" rel="nofollow">SPR-7743</a></strong> and commented</p>
<p dir="auto">This patch exposes the properties of <code class="notranslate">HttpURLConnection</code> within <code class="notranslate">SimpleClientHttpRequestFactory</code> such as <code class="notranslate">connectTimeout</code> and <code class="notranslate">readTimeout</code>.<br>
There will therefore be no loss of available functionality in using Spring's <code class="notranslate">ClientHttpRequestFactory</code> in place of a <code class="notranslate">HttpURLConnection</code>.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/17360/SimpleClientHttpRequestFactory.patch" rel="nofollow">SimpleClientHttpRequestFactory.patch</a> (<em>3.82 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398111324" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12815" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12815/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12815">#12815</a> Introduce FeatureSpecification for PropertyOverrideBeanDefinitionParser (context:property-override) (<em><strong>"duplicates"</strong></em>)</li>
</ul>