首页 \ 问答 \ 测试Java数据库实体类(Testing Java database entity classes)

测试Java数据库实体类(Testing Java database entity classes)

目前,我们正在通过为每个实体编写java servlet来测试实体类和“工人”类,并为每个实体执行插入,更新,删除,查找...以确保其正常工作。 工作者类只是一个接口的实现,它使用JDBC将实体持久化到数据库,他们为实体执行DB工作。

我想知道的是,在Java中测试实体类的最佳方法是什么?

我正在寻找一种自动化的方法,而不是基本上写一个模拟应用程序,该应用程序调用我试图为每个创建的新实体测试的所有函数。


Currently we are testing out entity classes and "worker" classes by writing java servlets for each entity and doing Insert,update,delete,find... for each entity to ensure that it works. The worker classes are simply implementations of an interface that persists the entity to the database using JDBC, they do the DB work for the entity.

What I'm wondering is, what is the best way to test entity classes in Java?

I'm looking for an automated approach rather than writing, basically, a mock application that calls all of the functions that I'm trying to test for each new entity that is created.


原文:https://stackoverflow.com/questions/1208023
更新时间:2024-01-13 17:01

最满意答案

尝试添加

vertical-align: top

到背景选择

.background-choice {
    vertical-align: top
}

这是人们使用显示内联块元素遇到的常见问题


Try adding

vertical-align: top

to 'background-choice'

.background-choice {
    vertical-align: top
}

This is a common issue people run into with display inline-block elements because the default alignment is baseline

相关问答

更多
  • 检查jsfiddle: http : //jsfiddle.net/x08j29m5/1 .a1, .a5, .a6 {clear:right;} 我补充说:对; 到a1,a5和a6,但我不知道你想要做什么,所以可能有一个更合适的解决方案。 check the jsfiddle: http://jsfiddle.net/x08j29m5/1 .a1, .a5, .a6 {clear:right;} I added clear:right; to a1, a5 and a6, but I don't kn ...
  • 您的代码很接近,您只需要使用parseInt()将您要比较的值转换为整数。 当.leased值更高时,您还需要反转比较以隐藏#next 。 尝试这个: $("#next").toggle(parseInt($(".leased").text(), 10) < parseInt($(".limit").text(), 10)); < ...
  • just modify .header class : .header { background-color:#044584; height:10%; margin-left: 2%; margin-right: 2%; text-align: center; float: left; width:96%; margin-top: 3%; } 的jsfiddle just modify .header class : .header { ...
  • 首先,不是将卡片和它们的附件分开,而是将它们分开组合在一起。
    Dammage:
    Health:
  • 尝试添加 vertical-align: top 到背景选择 .background-choice { vertical-align: top } 这是人们使用显示内联块元素遇到的常见问题 Try adding vertical-align: top to 'background-choice' .background-choice { vertical-align: top } This is a common issue people run into with display ...
  • 因为内联元素的默认垂直对齐方式是基线。 请参阅https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align 要更改它,请将图像上的vertical-align属性设置为默认值以外的值。 img{ height: 2em; top: 0px; vertical-align:top; } div div { width: 5em; display: inline-block; }
  • 这是因为您必须指定元素的vertical-align以更改对齐方式。 默认值为baseline但您可以更改它,例如top , middle , bottom 喜欢这个 在这里查看对此的更大解释: 为什么这个内联块元素被推下? It's because you have to specify the vertical-align of the element to change the alignment. The default value is baseline but you can change it ...
  • 我认为添加display inline-flex会起作用。 .section10 { width:100%; height:320px; vertical-align: middle; background-color:#222222; display: inline-flex; } I think that adding display inline-flex would work. .section10 { width:100%; height: ...
  • 只要这样做,它应该工作: .non { width:400px; background-color:#d20000; position: relative; } .info { position:absolute; top: 0px; right: 0px; background-color:#efefef; } 我知道你想避免使用top和right,但是如果你这样做,.info类就位于.non类div的右上角,而不是整个页面:) Just do this, it should work: .non { ...
  • 要创建化身所在的文本左侧的列,并且下面没有任何文本...... .posttext{ word-wrap: break-word; display:block; // change to block padding-right:5px; width:auto; padding-left: 120px; // pad left } 演示 To create the column left of the text where the avatar will lie, ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)