在WPF验证中,有以下几点之间的区别:
ValidatesOnNotifyDataErrors = True
ValidatesOnDataErrors = True
NotifyOnValidationError = True
什么时候应该在XAML中正确使用这些属性?
当我使用sqlce 4.0 with entityframework 6.0时出现以下错误
No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'
Run Code Online (Sandbox Code Playgroud)
我的app.config看起来像这样
....
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" requirePermission="false" />
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" >
<parameters>
<parameter value =" System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<!--providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers-->
</entityFramework>
<connectionStrings> …Run Code Online (Sandbox Code Playgroud) 我有测试jms消息发送的Junit测试.我使用Spring jmsTemplate来做到这一点.在这里,我在下面的代码中,我想检查JMS模板是否已调用发送消息,无论它传递的actuall参数的值是什么.
我的发布者方法使用jmsTemplate发送方法看起来像跟在里面..
jmsTemplate.send(jmsQueueProperties.getProperty(key), new MessageCreator()
{
public Message createMessage(Session session) throws JMSException
{
ObjectMessage obj = session.createObjectMessage(dialogueServiceResponse);
return obj;
}
});
Run Code Online (Sandbox Code Playgroud)
在我的测试..
JmsTemplate mockTemplate = Mockito.mock(JmsTemplate.class);
...
publisher.publishServiceMessage(response);
....
Mockito.verify(mockTemplate,
Mockito.times(1)).send("appointment.queue",
Mockito.any(MessageCreator.class));
Run Code Online (Sandbox Code Playgroud)
但是当我执行时,我得到了
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:参数匹配器的使用无效!....
原因是由于Mockito.any(MessageCreator.class),但是没有办法测试我的send方法是在没有在MessageCreator中创建实际对象的情况下执行的.
更新 有没有办法检查我的session.createObjectMessage(dialogueServiceResponse)也被调用
我有一个像下面这样的方法,
public void generateCSVFile(final Date billingDate) {
asyncTaskExecutor.execute(new Runnable() {
public void run() {
try {
accessService.generateCSVFile(billingDate);
} catch (Exception e) {
LOG.error(e.getMessage());
}
}
});
}
Run Code Online (Sandbox Code Playgroud)
我嘲笑:
PowerMockito.doNothing().when(accessService).generateCSVFile(billingDate);
Run Code Online (Sandbox Code Playgroud)
但是当我验证时:
verify(rbmPublicViewAccessService, timeout(100).times(1)).generateCSVFile(billingDate);
Run Code Online (Sandbox Code Playgroud)
它给了我没有被调用.这是因为它是通过单独的线程调用的,是否可以验证在不同线程中调用的方法?
我有以下要求:我的网址可以是以下任何一种
我想捕获resid值并将其放在后端并按照客户的顺序保存.
即,如果?resid=133被请求并且客户稍后继续进行订单,我希望将resid其与订单ID(例如100000123)一起保存(133).
后来我希望resid价值显示在销售订单网格中(在管理员中).
有人可以指导我这样做吗?
有没有办法只能在Visual Studio中过滤掉自己的TODO任务?
目前有几个开发人员正在工作,他们添加了自己的TODO.最后,如果我查看我的任务列表,列出了很多TODO,我几乎无法弄清楚哪些是我的.
我尝试搜索一些VS网站,但没有找到任何有用的信息.如何仅过滤我自己的TODO,或者至少过滤了我所触及的文件中的所有TODO?我正在使用VS 2010.
我一直试图弄清楚究竟什么是入站终点和出站终点.对我而言,理解是有点躲避.
什么是mule流中/ do的入站和出站端点?如果流程想要发送消息,则应在接收时使用哪个端点.或者当一个应用程序想要调用一个它应该与之通信的端点的流?
在开发WPF MVVM(prism)应用程序之后,我想实现身份验证,就像基于ASP.NET表单的身份验证一样.我想限制用户进入需要授权的屏幕.如何在WPF应用程序中实现,因为我正在使用PRISM.
今天如何在火鸟的YYYYMMDD中获取日期,我看了下面但是无法想出怎么写这个.
我有代码片段通过Spring JMSTemplate发送jms消息.为了测试方法我使用Mockito.
我的代码如下所示.... publishDialogueServiceMessage() - >
brokerUrl = jmsQueueProperties.getProperty(MessageRouterConstants.JMS_QUEUE_URL);
LOG.info("The broker url is : {}", brokerUrl);
jmsTemplate.send(jmsQueueProperties.getProperty(MessageRouterConstants.QUEUE), new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
ObjectMessage obj = session.createObjectMessage(serviceResponse);
messageSent = true;
return obj;
}
});
Run Code Online (Sandbox Code Playgroud)
在上面的代码我设置布尔变量true,检查是否发送了消息
我的测试看起来如下,
@Before
public void setUp() throws Exception {
connectionFactory = Mockito.spy(new ActiveMQConnectionFactory(
"vm://localhost?broker.persistent=false"));
conn = connectionFactory.createConnection();
conn.start();
}
@After
public void cleanUp() throws Exception{
conn.stop();
}
Run Code Online (Sandbox Code Playgroud)
@Test
public void testPublishDialogueServiceMessage()
{
ServiceResponse response = Mockito.mock(
ServiceResponse.class, Mockito.withSettings()
.serializable());
JmsTemplate mockTemplate …Run Code Online (Sandbox Code Playgroud) mockito ×3
java ×2
junit ×2
unit-testing ×2
wpf ×2
build ×1
c#-4.0 ×1
esb ×1
firebird ×1
firebird2.5 ×1
jms ×1
magento ×1
maven ×1
mocking ×1
mule ×1
mule-studio ×1
mvvm ×1
powermock ×1
prism-4 ×1
spring-jms ×1
sql ×1
validation ×1
xaml ×1