小编Cra*_*lla的帖子

JMeter - 从命令行更改用户定义的变量

我正在尝试使用命令行更新jmeter测试计划中的"用户定义变量"

jmeter -n -t SimpleJmxExample.jmx -l log.jtl -Jtestproperty=202
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

正如你所看到我正在使用-J参数.但它似乎没有任何区别?对于测试计划,是否有更好/更可接受的传递不同变量的方法?

这是我的jmx文件

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">1</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1358160198000</longProp>
        <longProp name="ThreadGroup.end_time">1358160198000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp> …
Run Code Online (Sandbox Code Playgroud)

command-line jmeter

25
推荐指数
1
解决办法
2万
查看次数

使用默认的JavaScriptSerializer将DateTime绑定到knockout视图模型

我刚刚开始使用淘汰赛,而且我在使用JavaScriptSerializer进行DateTime序列化和反序列化时遇到了麻烦.

我在他的博客中更新了Steves koListEditor示例中的礼物模型,以包含Modified DateTime字段:

public class GiftModel
{
    public string Title { get; set; }
    public double Price { get; set; }
    public DateTime Modified { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

然后我更新了Index.aspx以包含新字段:

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
    <h1>Gift list editor</h1>

    <p>You have asked for <span data-bind="text: gifts().length">&nbsp;</span> gift(s)</p>

    <form class="giftListEditor">
        <table> 
            <tbody data-bind="template: { name: 'giftRowTemplate', foreach: gifts }"></tbody> 
        </table>

        <button data-bind="click: addGift">Add Gift</button>
        <button data-bind="enable: gifts().length > 0" type="submit">Submit</button>
    </form>

    <script type="text/html" id="giftRowTemplate"> 
        <tr> 
            <td>Gift name: <input class="required" data-bind="value: …
Run Code Online (Sandbox Code Playgroud)

javascript datetime json javascriptserializer knockout.js

12
推荐指数
1
解决办法
2万
查看次数

让流畅的NHibernate与SQLite一起使用

我确信有一些简单的事情我还没有完成,但我想让Fluent NHibernate在我的机器上使用Sqlite.

我使用NuGet下载流畅的nhibernate并添加了以下实体和映射:

public class Customer
{
    public virtual string CustomerCode { get; set; }
    public virtual string Name { get; set; }
}

public class CustomerMap : ClassMap<Customer>
{
    public CustomerMap ()
        {
        Id(x => x.CustomerCode);
        Map(x => x.Name);
        Table("tblCustomer");
        }
}
Run Code Online (Sandbox Code Playgroud)

然后,在开始使用流畅的指南之后,我将以下代码添加到Windows Command项目中:

class Program
{
    static void Main(string[] args)
    {

        var sessionFactory = CreateSessionFactory();

        using (var session = sessionFactory.OpenSession())
        {
            using (var transaction = session.BeginTransaction())
            {

                var customer = new Customer { CustomerCode = "123", Name = …
Run Code Online (Sandbox Code Playgroud)

sqlite nhibernate system.data.sqlite fluent-nhibernate

10
推荐指数
3
解决办法
2万
查看次数

Browser.AttachTo <T>()导致间歇性异常"Internet Explorer忙时超时"

作为持续集成构建过程的一部分运行的WatiN步骤在尝试间歇性地附加到浏览器实例时失败.目前约有五分之一.

Browser.AttachTo<IE>(Find.ByTitle("Title of Popup"));
Run Code Online (Sandbox Code Playgroud)

出现以下错误:

WatiN.Core.Exceptions.TimeoutException: Timeout while Internet Explorer busy
   at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.ThrowTimeOutException(Exception lastException, String message)
   at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.HandleTimeOut()
   at WatiN.Core.UtilityClasses.TryFuncUntilTimeOut.Try[T](DoFunc`1 func)
   at WatiN.Core.WaitForCompleteBase.WaitUntil(DoFunc`1 waitWhile, BuildTimeOutExceptionMessage exceptionMessage)
   at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitUntilNotNull(DoFunc`1 func, BuildTimeOutExceptionMessage exceptionMessage)
   at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitWhileIEBusy(IWebBrowser2 ie)
   at WatiN.Core.Native.InternetExplorer.IEWaitForComplete.WaitForCompleteOrTimeout()
   at WatiN.Core.WaitForCompleteBase.DoWait()
   at WatiN.Core.Native.InternetExplorer.AttachToIeHelper.FinishInitializationAndWaitForComplete(IE ie, SimpleTimer timer, Boolean waitForComplete)
   at WatiN.Core.Native.InternetExplorer.AttachToIeHelper.Find(Constraint findBy, Int32 timeout, Boolean waitForComplete)
   at WatiN.Core.Browser.AttachTo[T](Constraint constraint)
Run Code Online (Sandbox Code Playgroud)

我已经完成了以前帖子中建议的所有显而易见的事情:

即在运行WatiN步骤之前杀死所有Internet Explorer进程:

Process.GetProcessesByName("IEXPLORE").ToList().ForEach(p => p.Kill());
Run Code Online (Sandbox Code Playgroud)

在运行任何WatiN步骤之前增加超时:

var timeout = 60;
Settings.AttachToBrowserTimeOut = timeout;
Settings.WaitForCompleteTimeOut = timeout;
Settings.WaitUntilExistsTimeOut = timeout;
Run Code Online (Sandbox Code Playgroud)

每个WatiN步骤都作为以下代码块中的操作传入:

public void UseAndCloseBrowser(Action<Browser> action, …
Run Code Online (Sandbox Code Playgroud)

.net watin timeout internet-explorer-9

10
推荐指数
1
解决办法
1852
查看次数

File.WriteAllBytes导致错误"系统资源不足,无法完成所请求的服务"

我有一个带WebMethod的标准SOAP Web服务,它接受一个字节数组,然后执行一个

[WebMethod(true)]
WriteFile(byte[] Data, string FilePath)
{

    File.WriteAllBytes(FilePath, Data);
}
Run Code Online (Sandbox Code Playgroud)

如果这个过程传递了一个大文件,例如2兆字节,则会发出以下错误消息:

存在不足的系统资源来完成所请求的服务

看看我得到的堆栈跟踪:

  • System.IO.File.WriteAllBytes
  • System.IO.FileStream.Write
  • System.IO.FileStream.WriteCore
  • System.IO .__ Error.WinIOError
  • System.IO.IOException:存在不足的系统资源来完成所请求的服务

我已经尝试了所有显而易见的事情,例如将maxrequestlength和执行超时设置为更真实的设置:

<httpRuntime maxRequestLength="409600" executionTimeout="900"/>
Run Code Online (Sandbox Code Playgroud)

它仍然似乎与上述故障.如果你发送一个较小的文件,它会保存到磁盘上.所以这是文件大小或时间问题.

有谁知道我还能做些什么来解决这个问题?

谢谢

戴夫

.net soap web-services

9
推荐指数
1
解决办法
6549
查看次数

使用"字符串"字段,"文本"字段和"复制"字段与Solr对齐

我有Solr和Faceting的问题,并想知道是否有人知道修复.我现在有一个解决方法,但我真的想知道为什么我的查询不起作用.

这是我的Schema,简化为更容易理解:

<fields>
    <field name="uniqueid" type="string" indexed="true" required="true"/>
    <!-- Indexed and Stored Field --->
    <field name="recordtype" type="text" indexed="true" stored="true"/>
    <!-- Facet Version of fields -->
    <field name="frecordtype" type="string" indexed="true" stored="false"/>
</fields>

<!-- Copy fields for facet searches -->
<copyField source="recordtype" dest="frecordtype"/>
Run Code Online (Sandbox Code Playgroud)

正如您所看到的,我有一个名为recordtype的不区分大小写的字段,它被复制到区分大小写的字段frecordtype,它不会对文本进行标记.这是因为solr在分面结果中返回索引值而不是存储值.

当我尝试以下查询时:

http://localhost:8080
/solr
/select
?version=2.2
&facet.field=%7b!ex%3dfrecordtype%7dfrecordtype
&facet=on
&fq=%7b!tag%3dfrecordtype%7dfrecordtype%3aLarge%20Record
&f1=*%2cscore
&rows=20
&start=0
&qt=standard
&q=text%3a%25
Run Code Online (Sandbox Code Playgroud)

我没有得到任何结果,但是设备仍然显示有1条记录.

<result name="response" numFound="0" start="0" /> 
 <lst name="facet_counts">
  <lst name="facet_queries" /> 
 <lst name="facet_fields">
 <lst name="frecordtype">
  <int name="Large Record">1</int> 
  <int name="Small Record">12</int> 
  <int name="Other">1</int> 
  </lst>
  </lst> …
Run Code Online (Sandbox Code Playgroud)

lucene solr facet

8
推荐指数
1
解决办法
6889
查看次数

从Team city运行NUnit测试

我已成功设法让我们的TeamCity Server上的每个构建都运行MSTests.

我有几个使用NUnit的项目,所以希望让TeamCity运行NUnit测试就像运行MSTests一样简单:

Team City中的MS测试设置

因此,当我尝试为我的NUnit测试做同样的事情时,测试选项卡在Build完成时不显示,所以我猜它没有运行我的测试.

Team City中的Nunit测试设置

有谁知道我做错了什么?

不确定这是否有帮助,但这是来自构建日志:

[Project "AssemblyName.proj.teamcity.patch.tcprojx" (Build;TeamCity_Generated_NUnitTests target(s)):] C:\Program Files\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" "C:\Program Files\TeamCity\buildAgent\temp\buildTmp\tmp2867.tmp"
[13:22:57]: Start TeamCity NUnit Test Runner
[13:22:59]: Build finished
Run Code Online (Sandbox Code Playgroud)

这就像它启动nunit build runner,然后停止?

谢谢

戴夫

teamcity nunit teamcity-5.1

8
推荐指数
1
解决办法
1万
查看次数

Linq to Entities,Table per Type和Nullable Foreign Key Relationships

我正在使用Linq来应用每种类型表格方法.到目前为止,这一直进展顺利.我有以下设置:

  • 父表
  • 子表(从父级继承)
  • 大孩子表(从子表继承)
  • 链接表(具有外键可空,到子表)

这是数据库图

替代文字

在上面的视频之后,我将Table Per Type方法应用于Linq to entities在将上述表添加到模型时创建的默认模式.

在应用每种类型的表之前:

替代文字

每种类型的表后:

替代文字

然后我编译了项目并得到了您在上图中可以看到的错误.为了解决这个问题,我去了外键链接的映射,我添加了childid字段,错误信息正在呻吟.

替代文字

然后我重新编译并得到另一个错误:

映射片段中的问题从第147,176行开始:具有不同键的两个实体映射到同一行.确保这两个映射片段不会将具有重叠键的两组实体映射到同一组行.

这就是我现在的观点.问题似乎是"LinkingTable"上的"ChildID"是Nullable.如果我将其设置为不可空,我不会得到上述错误.

我已将上述步骤中使用的数据库和项目保存到天空驱动器中.

有谁知道如何解决这个错误?

戴夫

这是固定代码(感谢Gecko)

之前

<AssociationSetMapping Name="FK_LinkingTable_Child"
    TypeName="TablePerTypeModel.FK_LinkingTable_Child" 
    StoreEntitySet="LinkingTable">
    <EndProperty Name="Child">
        <ScalarProperty Name="Id" ColumnName="ChildID" />
    </EndProperty>
    <EndProperty Name="LinkingTable">
        <ScalarProperty Name="LinkTableID" ColumnName="LinkTableID" />
    </EndProperty>
</AssociationSetMapping>
Run Code Online (Sandbox Code Playgroud)

<AssociationSetMapping Name="FK_LinkingTable_Child"
    TypeName="TablePerTypeModel.FK_LinkingTable_Child" 
    StoreEntitySet="LinkingTable">
    <EndProperty Name="Child">
        <ScalarProperty Name="Id" ColumnName="ChildID" />
    </EndProperty>
    <EndProperty Name="LinkingTable">
        <ScalarProperty Name="LinkTableID" ColumnName="LinkTableID" />
    </EndProperty>
    <Condition ColumnName="ChildID" IsNull="false"/>
</AssociationSetMapping>
Run Code Online (Sandbox Code Playgroud)

linq linq-to-entities entity-framework table-per-type

7
推荐指数
1
解决办法
3033
查看次数

Subversion(SVN)等效于Visual Source Safe(VSS)"Share"

我的项目中有一个场景,我需要在同一个解决方案中的多个项目之间共享一个文件.回到我的Visual Source Safe天(Shudder),我使用"共享"选项允许我在任何位置对此文件进行更改.然后一旦签入,我可以保证其他位置将获得更新.

替代文字

我试图在Subversion中这样做,但我似乎无法在任何地方找到该选项.我知道svn:externals然而我只对在多个位置之间共享一个文件感兴趣.

有谁知道在Subversion中如何做到这一点?

谢谢

编辑

最后我决定使用visual studio中的共享功能.它的工作方式与用于Visual Source安全的共享工作方式完全相同.即我只需要维护1个文件并且都更新.

要执行此操作,请转到添加现有项目>>然后从上到下右下角CLick添加为链接.

svn share visual-sourcesafe

7
推荐指数
1
解决办法
1327
查看次数

Linq to Entities和连接属性

有没有人知道是否可以在现有实体类型上创建一个新属性,该实体类型基于连接在一起的其他2个属性?

例如,我的人员实体类型包含这些字段"ID","Forename","Surname","DOB"

我想创建一个名为"Fullname"的新字段

Forenames + " " + Surname
Run Code Online (Sandbox Code Playgroud)

所以我最终得到了"ID","Forename","Surname","DOB","Fullname".

我知道我可以通过编程方式使用Linq来做到这一点

var results = from p in db.People
select new { 
ID = p.ID, 
Forename = p.Forename, 
Surname = p.Surname, 
DOB = p.DOB,
Fullname = p.Forename+ " " + p.Surname
};
Run Code Online (Sandbox Code Playgroud)

然后打电话给像

var resultsAfterConcat = from q in results 
where q.Fullname.Contains(value)
select q;
Run Code Online (Sandbox Code Playgroud)

但是,我真的很想使用Linq to Entities在概念模型级别为我做这项工作.

c# linq linq-to-entities c#-3.0

6
推荐指数
1
解决办法
5971
查看次数