我目前正在开发一个使用弹簧批量的弹簧启动项目.我正在尝试使用JavaConfig而不是xml,但是目前在xml中的所有文档都很难.
我按照https://blog.codecentric.de/en/2013/06/spring-batch-2-2-javaconfig-part-5-modular-configurations进行操作,但是使用它时遇到了困难JobLauncherTestUtils.我知道我需要告诉测试使用正确的弹簧上下文,但我似乎无法弄清楚如何做到这一点.我收到以下错误:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.batch.test.JobLauncherTestUtils' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Run Code Online (Sandbox Code Playgroud)
我的测试如下所示:
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {MyApplication.class, MyJobConfiguration.class})
public class RetrieveDividendsTest {
@Autowired
private JobLauncherTestUtils jobLauncherTestUtils;
@Test
public void testSomething() throws Exception {
jobLauncherTestUtils.launchJob();
}
}
Run Code Online (Sandbox Code Playgroud) 令人兴奋的是,Windows 8支持Metro App开发的这么多语言.特别感兴趣的是HTML5/CSS/JavaScript.我不明白的是,这段代码是用一种可执行文件编译的(比如C#,VB和C++选项),还是我的应用程序基本上都是在IE中作为实际的网页运行?
我想使用ASP.NET MVC3和MongoDB构建一个新的Web应用程序.我在网上看过很多例子,甚至自己构建了一些工作代码,但我想知道如何设置我的应用程序.在使用Entity Framework的MVC示例中,它们将所有内容放在Models文件夹中.我想我会做同样的事情,但我应该在哪里提出我的疑问等等.我应该把它们抽象到更好的位置.我对制作C#应用程序和.NET世界有点新意,所以我还不清楚一些"方法".另外,每次需要时都会创建数据库对象(我告诉它mongo的服务器地址)是否会影响性能?我可以只连接一次然后通过该对象进行通话吗?每次执行该操作时,它是否真的重新连接?
谢谢!