发明名称 Declarative testing using dependency injection
摘要 Methods and systems for declarative testing using dependency injection are described. In one embodiment, a computing system inspects a first annotation that declares an injection point in source code of a test subject and a second annotation that declares a set of test values to be injected at the injection point. The first and second annotations are metadata in an input domain and are added in a designated place in the source code. The computing system executes a test runner that creates a set of one or more tests during a configuration phase based on the inspection of the source code, including the first and second annotations. Each of the set of tests includes one of the test values injected at the injected point as declaratively provided by the second annotation. The set of tests are to be executed during a run phase.
申请公布号 US9208064(B2) 申请公布日期 2015.12.08
申请号 US201113206283 申请日期 2011.08.09
申请人 Red Hat, Inc. 发明人 Fry{hacek over (c)} Luká{hacek over (s)};Pitonak Pavol
分类号 G06F11/36 主分类号 G06F11/36
代理机构 Lowenstein Sandler LLP 代理人 Lowenstein Sandler LLP
主权项 1. A method comprising: inspecting, by a processing device executing a test runner, source code of a test subject, the source code comprising first, second, third, and fourth annotations, wherein the first annotation to declare an injection point in the source code, the second annotation to declare a set of test values to be injected at the injection point, the third annotation to declare a second injection point in the source code, and the fourth annotation to declare a second set of test values to be injected at the second injection point, wherein the first, second, third, and fourth annotations are metadata in an input domain and are added at designated places in the source code; and creating, by the test runner, a set of one or more combination tests during a configuration phase in view of said inspection, wherein each of the set of combination tests comprises a combination of one of the set of test values injected at the injection point as declaratively provided by the second annotation and one of the second set of test values injected at the second injection point as declaratively provided by the fourth annotation, wherein the set of combination tests is to be executed during a run phase.
地址 Raleigh NC US
您可能感兴趣的专利