使用 TDD 进行 Eclipse 插件开发

发布于 2024-07-10 22:59:25 字数 314 浏览 5 评论 0原文

我想向透视图添加视图,而无需访问透视图的源代码。 这可能吗?

有没有使用 TDD 开发插件的好教程?

[编辑] 我认为我在插件开发方面有一个很好的 TDDing 起点 自动化 Eclipse 插件开发的单元测试 (junit)

[编辑02/17/09] 我能够下载该插件的源代码。 我可能会叉掉它。

I want to add a view to a perspective without having access to the source code of the perspective. Is this possible?

Is there a good tutorial for plug-in development using TDD?

[edit]
I think I have a good starting point with TDDing in plugin development
Automating unit tests (junit) for Eclipse Plugin development

[edit 02/17/09]
I was able to download the source for the plug-in. I'm just probably going to fork it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

尐籹人 2024-07-17 22:59:25

测试 GUI 是一件痛苦的事! 随着 GUI 设计的复杂性,痛苦呈指数级增长。 最好的选择是使用 MVC 模式尽可能将业务逻辑与 GUI 分开,并且在测试 GUI 时,将 GUI 连接到“模拟”应用程序。

请参阅 Object Mentor 的论文,Humble Dialog Box

Testing GUIs is a PAIN! And the pain grows exponentially with the complexity of the gui design. Your best bet is to keep the business logic separate from the GUI as much as possible with the MVC pattern and when testing the gui, hook the GUI up to a "mock" application.

See Object Mentor's paper, the Humble Dialog Box

旧伤慢歌 2024-07-17 22:59:25

您可能想查看 org.eclipse.ui.perspectiveExtensions 扩展点。

这里有一篇关于透视的好文章:在 Eclipse UI 中使用透视

抱歉,无法帮助您解决问题的 TDD 部分。

You might want to take a look at the org.eclipse.ui.perspectiveExtensions Extension Point.

And here is a nice article concerning Perspectives: Using Perspectives in the Eclipse UI

Sorry, can't help you with the TDD part of your question.

如果您的目标只是将视图添加到您自己的 Eclipse 实例中的透视图中,您只需在该透视图中打开它,然后选择“窗口”->“视图”即可。 将透视另存为...

对于单元测试插件,您基本上可以使用普通的 JUnit 测试来测试它们,您可以将其作为 JUnit 插件测试运行,而不是在 Eclipse 中运行普通的 JUnit 测试。 对于 GUI 测试,您可以查看 SWTBot

If your goal is to simply add the view to a perspective in your own Eclipse instance, you can just open it when being in that perspective, and choose Window -> Save Perspective As...

For unit testing plug-ins, you can basically test them using normal JUnit tests, which you run as JUnit plug-in tests instead of normal JUnit tests in Eclipse. For GUI testing you could check out SWTBot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文