我已经看到了很多这方面的变化,但没有什么能与我想要完成的完全匹配.
我有一张表,TableA其中包含用户给出的可配置调查问卷的答案.列是member_id, quiz_num, question_num, answer_num.
不知何故,一些成员得到了两次提交的答案.所以我需要删除重复的记录,但要确保留下一行.
没有主列,因此可能有两行或三行都具有完全相同的数据.
是否有查询删除所有重复项?
我使用Java,Selenium,Junit,Maven开发了一整套自动化测试.
对于每个测试,它们都有一个或多个@Category注释,描述每个测试涵盖的软件区域.例如:
@Test
@Category({com.example.core.categories.Priority1.class,
com.example.core.categories.Export.class,
com.example.core.categories.MemberData.class})
@Test
@Category({com.example.core.categories.Priority1.class,
com.example.core.categories.Import.class,
com.example.core.categories.MemberData.class})
@Test
@Ignore
@Category({com.example.core.categories.Priority2.class,
com.example.core.categories.Import.class,
com.example.core.categories.MemberData.class})
Run Code Online (Sandbox Code Playgroud)
我正在尝试做的是找到一种方法来计算包含任何给定类别的测试数量.所有可能的类别都是文件//com/example/core/categories夹中的文件名作为源列表.
我已经尝试构建一个shell脚本来进行单词计数,这似乎工作正常,但我认为会有更多"内置"来处理@Category.
我最大的问题是,即使我得到正确的计数,很可能一个或多个测试被标记为@Ignore,这应该使测试@ Category的无效但没有大量使用标志并逐行读取每个文件为了它丢掉正确的计数.
是否有一个很好的方法来逐项列出@Ignore中的@ Category?
示例输出
| Category | Count |
|----------------------------------------------|------:|
| com.example.core.categories.Export.class | 1 |
| com.example.core.categories.Import.class | 1 |
| com.example.core.categories.MemberData.class | 2 |
| com.example.core.categories.Priority1.class | 2 |
| com.example.core.categories.Priority2.class | 0 |
| com.example.core.categories.Priority3.class | 0 |
Run Code Online (Sandbox Code Playgroud)