<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_create_JUnit_testcases</id>
	<title>How to create JUnit testcases - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_create_JUnit_testcases"/>
	<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_create_JUnit_testcases&amp;action=history"/>
	<updated>2026-04-06T15:23:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.infinite-erp.co.id/index.php?title=How_to_create_JUnit_testcases&amp;diff=1147&amp;oldid=prev</id>
		<title>Wikiadmin: /* Run test located in external module locally */</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_create_JUnit_testcases&amp;diff=1147&amp;oldid=prev"/>
		<updated>2021-09-14T00:52:47Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Run test located in external module locally&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 00:52, 14 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l311&quot; &gt;Line 311:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 311:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;900px-Before&lt;/del&gt;.png | 900px | center]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Before_900px&lt;/ins&gt;.png | 900px | center]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l328&quot; &gt;Line 328:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 328:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;900px-After&lt;/del&gt;.png | 900px | center]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;After_900px&lt;/ins&gt;.png | 900px | center]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:HowTo]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:HowTo]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.infinite-erp.co.id/index.php?title=How_to_create_JUnit_testcases&amp;diff=1144&amp;oldid=prev</id>
		<title>Wikiadmin: /* Run test located in external module locally */</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_create_JUnit_testcases&amp;diff=1144&amp;oldid=prev"/>
		<updated>2021-09-14T00:46:36Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Run test located in external module locally&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 00:46, 14 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l311&quot; &gt;Line 311:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 311:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Before.png | 900px | center]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;900px-&lt;/ins&gt;Before.png | 900px | center]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l328&quot; &gt;Line 328:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 328:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:After.png | 900px | center]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;900px-&lt;/ins&gt;After.png | 900px | center]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:HowTo]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:HowTo]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.infinite-erp.co.id/index.php?title=How_to_create_JUnit_testcases&amp;diff=1140&amp;oldid=prev</id>
		<title>Wikiadmin: Created page with &quot;== Objective == This how-to will focus on creating a testcase making use of the Openbravo test base classes. The testcase will check that our system has at least one User with...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_create_JUnit_testcases&amp;diff=1140&amp;oldid=prev"/>
		<updated>2021-09-14T00:26:47Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Objective == This how-to will focus on creating a testcase making use of the Openbravo test base classes. The testcase will check that our system has at least one User with...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Objective ==&lt;br /&gt;
This how-to will focus on creating a testcase making use of the Openbravo test base classes. The testcase will check that our system has at least one User with password. For this, we'll use the new DAL approach to access the database.&lt;br /&gt;
&lt;br /&gt;
In computer programming, '''unit testing''' is a software design and development method where the programmer gains confidence that individual units of source code are fit for use. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure, etc., while in object-oriented programming, the smallest unit is a method, which may belong to a base/super class, abstract class or derived/child class.&amp;lt;ref name=&amp;quot;unittesting&amp;quot;&amp;gt;http://en.wikipedia.org/wiki/Unit_testing&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All new developments must belong to a module that is not the ''core'' module. Please follow the [[How_To_Create_and_Package_a_Module | How to create and package a module]] section to create a new module.&lt;br /&gt;
 &lt;br /&gt;
==  Preparing development environment ==&lt;br /&gt;
First of all you need to import src-test components of the Openbravo ERP. Follow the instructions described below.&lt;br /&gt;
===  Import into Eclipse IDE ===&lt;br /&gt;
Launch Eclipse.&lt;br /&gt;
&lt;br /&gt;
{{(!) | After Eclipse has started  go to ''Project'' menu and '''disable''' ''Build Automatically'' option there. }}&lt;br /&gt;
Now one new project need to be imported in the workspace (by menu ''File''=&amp;gt;''Import'' and then ''General''=&amp;gt;''Existing Projects into Workspace''). Here they are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OpenbravoTest    XXX\opensource\openbravo\erp\devel\main\src-test&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you are ready to work with test cases.&lt;br /&gt;
&lt;br /&gt;
== Creating the testcase ==&lt;br /&gt;
=== Just before starting ===&lt;br /&gt;
==== Test cases in OpenbravoTest ====&lt;br /&gt;
OpenbravoTest provides a set of unit tests, often called 'test cases' for things such as: runtime model consistency, data access layer features, webservices features, etc. This test cases are based on [http://www.junit.org/ JUnit] testing framework.&lt;br /&gt;
&lt;br /&gt;
The set of tests you can find and study them in the project ''OpenbravoTest'':&lt;br /&gt;
&lt;br /&gt;
 openbravo&lt;br /&gt;
  |- ...&lt;br /&gt;
 OpenbravoCore&lt;br /&gt;
  |- ...&lt;br /&gt;
 OpenbravoTest&lt;br /&gt;
  |- src                &amp;lt;-- source of the testcases&lt;br /&gt;
 OpenbravoTrl&lt;br /&gt;
  |- ...&lt;br /&gt;
 OpenbravoWAD&lt;br /&gt;
  |- ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a direct link to the testcases in the code repository: [https://code.openbravo.com/erp/devel/pi/file/8051c8a30e72/src-test/org/openbravo/test Openbravo test cases].&lt;br /&gt;
&lt;br /&gt;
==== Inheriting from OB BaseTest ====&lt;br /&gt;
All the core testcases are subclasses from OBBaseTest (org.openbravo.test.base.OBBaseTest). This class handles all the necessary steps to initialize the Data Access Layer, takes care of transaction handling and provides a set of utilities (methods) for working with the Openbravo context (OBContext).&lt;br /&gt;
&lt;br /&gt;
==== Execution order of test methods ====&lt;br /&gt;
Until now, the methods were simply invoked in the order returned by the reflection API. However, using the JVM order is unwise since the Java platform does not specify any particular order, and in fact JDK 7 returns a more or less random order. Of course, well-written test code would not assume any order, but some does, and a predictable failure is better than a random failure on certain platforms.&lt;br /&gt;
&lt;br /&gt;
=== Creating the Java class ===&lt;br /&gt;
* Open your Eclipse IDE.&lt;br /&gt;
* Create a new folder structure under the ''modules'' folder: ''modules/org.openbravo.test.examples/src-test/org/openbravo/test/examples''.&lt;br /&gt;
* Add the newly created '''src-test''' folder to the ''Java sources'' on the project.&lt;br /&gt;
* Create a new Java class on the org.openbravo.test.examples package with the following content:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 package org.openbravo.test.examples;&lt;br /&gt;
&lt;br /&gt;
 import static org.junit.Assert.assertTrue;&lt;br /&gt;
&lt;br /&gt;
 import java.util.List;&lt;br /&gt;
&lt;br /&gt;
 import org.junit.Test;&lt;br /&gt;
 import org.openbravo.dal.service.OBCriteria;&lt;br /&gt;
 import org.openbravo.dal.service.OBDal;&lt;br /&gt;
 import org.openbravo.model.ad.access.User;&lt;br /&gt;
 import org.openbravo.test.base.OBBaseTest;&lt;br /&gt;
&lt;br /&gt;
 public class ExampleTest extends OBBaseTest {&lt;br /&gt;
&lt;br /&gt;
  @Test&lt;br /&gt;
  public void testUsersCount() {&lt;br /&gt;
    setSystemAdministratorContext();&lt;br /&gt;
    final OBCriteria&amp;lt;User&amp;gt; uCriteria = OBDal.getInstance().createCriteria(User.class);&lt;br /&gt;
    final List&amp;lt;User&amp;gt; uList = uCriteria.list();&lt;br /&gt;
    int userCount = 0;&lt;br /&gt;
    for (User u : uList) {&lt;br /&gt;
      if (u.getPassword().length() &amp;gt; 0)&lt;br /&gt;
        userCount++;&lt;br /&gt;
    }&lt;br /&gt;
    assertTrue(userCount &amp;gt; 0);&lt;br /&gt;
    System.out.println(&amp;quot;Total of users with password: &amp;quot; + (userCount));&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Understanding the class ====&lt;br /&gt;
You have just created a new class named Example that extends from the [https://code.openbravo.com/erp/devel/pi/file/8051c8a30e72/src-test/org/openbravo/test/base/OBBaseTest.java OBBaseTest] class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public void testUsersCount() {}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This class has a testUsersCount function. Note that all testing methods ''must'' start with test in the function name. e.g. testAllWarehouses(), testMyFirstTest(), etc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
setSystemAdministratorContext();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sets the context as if a System Administrator is logged in the application.&lt;br /&gt;
&lt;br /&gt;
{{(!)|There is a setUserContext(...) method to select running as another user, this method can be called in the middle of a testcase to switch user (if required) }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
final OBCriteria&amp;lt;User&amp;gt; uCriteria = OBDal.getInstance().createCriteria(User.class);&lt;br /&gt;
final List&amp;lt;User&amp;gt; uList = uCriteria.list();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uses the [https://code.openbravo.com/erp/devel/pi/file/3d195dab015c/src/org/openbravo/dal/service/OBDal.java OBDal] instance to create a new [https://code.openbravo.com/erp/devel/pi/file/3d195dab015c/src/org/openbravo/dal/service/OBCriteria.java OBCriteria] object, and uses it for listing all (since we are not filtering) the Users in the database.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
int userCount = 0;&lt;br /&gt;
 for (User u : uList) {&lt;br /&gt;
   if (u.getPassword().length() &amp;gt; 0)&lt;br /&gt;
     userCount++;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We loop trough the uList collection, and we increment the userCount variable if the user has a password length &amp;gt; 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
assertTrue(userCount &amp;gt; 0);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We assert that the userCount is more than 0. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 System.out.println(&amp;quot;Total of users with password: &amp;quot; + (userCount));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally we print a total of users with password just for the record.&lt;br /&gt;
&lt;br /&gt;
=== Transaction Handling ===&lt;br /&gt;
A question which might pop-up when looking at the above code: where is the database transaction handling done? The answer is that this is handled by the [https://code.openbravo.com/erp/devel/pi/file/8051c8a30e72/src-test/org/openbravo/test/base/OBBaseTest.java OBBaseTest] class and the Openbravo data access layer:&lt;br /&gt;
&lt;br /&gt;
* a transaction is automatically started at first database access in the test cases. This is done by the Data Access Layer.&lt;br /&gt;
* a transaction is either committed (when no exception happened) or rolled-back (when an exception happened).&lt;br /&gt;
&lt;br /&gt;
The OBBaseTest class detects automatically if an exception happened or not. &lt;br /&gt;
&lt;br /&gt;
There are certainly cases whereby it makes sense to have more control over the database transactions. There are a number of relevant methods which can be useful then:&lt;br /&gt;
&lt;br /&gt;
* OBBaseTest.commitTransaction: a convenience method which commits the transaction for you. This can be useful if you want to check if certain database actions result in exceptions in the database.&lt;br /&gt;
* OBDal.getInstance().flush(): flushes the update/insert queries in hibernate to the database.&lt;br /&gt;
* OBDal.getInstance().commitAndClose(): commits the transaction and closes the session. A new session/transaction is automatically started at the next database access.&lt;br /&gt;
* OBDal.getInstance().rollbackAndClose(): rolls back and closes the transactions. A new session/transaction is automatically started at the next database access.&lt;br /&gt;
&lt;br /&gt;
{{(warn!)|[[How_to_implement_a_business_event_handler|DAL event observers]] are not triggered within test cases extending &amp;lt;code&amp;gt;OBBaseTest&amp;lt;/code&amp;gt; class. They to work require of test cases extending &amp;lt;code&amp;gt;WeldBaseTest&amp;lt;/code&amp;gt;. See [[#DAL_event_observers|this section]] for more information.}}&lt;br /&gt;
&lt;br /&gt;
=== Side-Effect Free ===&lt;br /&gt;
A test case will often change the data in the underlying database. Most of the time it is not feasible to setup a completely new test database for each test run. Therefore test-cases should be developed such that they are side effect free. This means:&lt;br /&gt;
&lt;br /&gt;
* When the test-case changes data then it should have a test method which is run as the last test method which cleans up/repairs the data.&lt;br /&gt;
* This clean-up method should also clean up data which is left from previous test runs.For this common issue should be used @AfterClass notation. This method runs automatically at the end of the class. More info in: [http://junit.sourceforge.net/javadoc/org/junit/AfterClass.html AfterClass-Notation].&lt;br /&gt;
&lt;br /&gt;
This last point is important because there can be always reasons why during a test the clean-up step is not performed. For example because the test run is stopped before the clean-up is done.&lt;br /&gt;
&lt;br /&gt;
=== Approach to new features of JUnit 4.11 ===&lt;br /&gt;
==== Parameterized Tests ====&lt;br /&gt;
More info in: [https://github.com/junit-team/junit/wiki/Parameterized-tests Parameterized-Test]&lt;br /&gt;
&lt;br /&gt;
==== Rules ====&lt;br /&gt;
More info in: [https://github.com/junit-team/junit/wiki/Rules Rules]&lt;br /&gt;
&lt;br /&gt;
==== Assertions and Hamcrest 1.13 ====&lt;br /&gt;
Hamcrest is a framework for writing matcher objects allowing 'match' rules to be defined declaratively. There are a number of situations where matchers are invaluble, such as UI validation, or data filtering, but it is in the area of writing flexible tests that matchers are most commonly used. &lt;br /&gt;
&lt;br /&gt;
When writing tests it is sometimes difficult to get the balance right between overspecifying the test, and not specifying enough (making the test less valuable). Having a tool that allows you to pick out precisely the aspect under test and describe the values it should have, to a controlled level of precision, helps greatly in writing tests. &lt;br /&gt;
&lt;br /&gt;
More info in: [http://code.google.com/p/hamcrest/ Hamcrest]&lt;br /&gt;
&lt;br /&gt;
=== Ant Test Tasks ===&lt;br /&gt;
Openbravo has a number of ant tasks which run the test cases:&lt;br /&gt;
&lt;br /&gt;
* run.tests: the default, it runs the suite: ''org.openbravo.test.AntTaskTests''. These tests are side effect free and can be run multiple times, after the run the database should be in the same state as before. &lt;br /&gt;
* run.quick.tests: this task runs test cases which are fast and which test the most important parts of the system. It runs the test suite: ''org.openbravo.test.AllQuickAntTaskTests''.&lt;br /&gt;
* run.all.tests: runs the suite ''org.openbravo.test.AllAntTaskTests''. This suite contains all the test cases, also tests which can change the database.&lt;br /&gt;
&lt;br /&gt;
All the test cases are based on the Small Bazaar default data.&lt;br /&gt;
&lt;br /&gt;
When adding new test classes to Openbravo ERP the developer has to always add the test class to the AllAntTaskTests test suite and if it is side effect free and quick to the AllQuickAntTaskTests and if it is side effect free but takes a bit more time to the AntTaskTests test suite.&lt;br /&gt;
&lt;br /&gt;
==== Skipping test cases ====&lt;br /&gt;
{{AvailableFrom|3.0PR17Q2}}&lt;br /&gt;
It's possible to define a list of test cases to be skipped. This is done  by creating a file named &amp;lt;code&amp;gt;disabled-tests&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;config&amp;lt;/code&amp;gt; directory. This file can contain a list of either fully qualified class names to be completely skipped and/or fully qualified class names followed by a &amp;quot;.&amp;quot; and method name to skip individual test cases.&lt;br /&gt;
&lt;br /&gt;
== The Result ==&lt;br /&gt;
To be able to execute your testcases:&lt;br /&gt;
&lt;br /&gt;
* Right click on the ExampleTest class.&lt;br /&gt;
* Select ''Run AS &amp;gt; JUnit Test'' (Eclipse recognizes the class as a JUnit test because inherits from the JUnit OBBaseTest class).&lt;br /&gt;
&lt;br /&gt;
[[Image:Testcases1.png|center]]&lt;br /&gt;
&lt;br /&gt;
* You can check the result of the test case on the JUnit view:&lt;br /&gt;
&lt;br /&gt;
[[Image:Testcases2.png|center]]&lt;br /&gt;
&lt;br /&gt;
* And the output of your tests in the Console view:&lt;br /&gt;
&lt;br /&gt;
[[Image:Testcases3.png|center]]&lt;br /&gt;
&lt;br /&gt;
== Testing Requests ==&lt;br /&gt;
&lt;br /&gt;
In general unit tests don't require of an Openbravo instance running in Tomcat to be executed. But in some cases, how requests work is wanted to be tested. Depending on the request to be tested, different classes should be extended:&lt;br /&gt;
&lt;br /&gt;
*'''REST Webservices'''. &amp;lt;code&amp;gt;BaseWSTest&amp;lt;/code&amp;gt; should be extended, it deals with authentication and provides methods to execute requests, parse xml results, etc.&lt;br /&gt;
*'''Other Requests''' (such as datasources). &amp;lt;code&amp;gt;BaseDataSourceTestNoDal&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;BaseDataSourceTestDal&amp;lt;/code&amp;gt; classes can be extended (depending if the test case requires or not DAL). Similarly to webservices it provides authentication handling as well as utility methods to perform requests.&lt;br /&gt;
&lt;br /&gt;
== Testing CDI ==&lt;br /&gt;
&lt;br /&gt;
{{(!)|This feature is available since '''PR15Q4'''}}&lt;br /&gt;
&lt;br /&gt;
Default test cases extending &amp;lt;code&amp;gt;org.openbravo.test.base.OBBaseTest&amp;lt;/code&amp;gt; class cannot make use of dependency injection. In order to use it &amp;lt;code&amp;gt;org.openbravo.base.weld.test.WeldBaseTest&amp;lt;/code&amp;gt; class needs to be extended instead. This is also a subclass of &amp;lt;code&amp;gt;OBBaseTest&amp;lt;/code&amp;gt;, so it makes available all DAL infrastructure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;OBBaseTest&amp;lt;/code&amp;gt; uses internally [http://arquillian.org/ Arquillian] runner to create a Weld container.&lt;br /&gt;
&lt;br /&gt;
Example of a test case injecting dependencies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class CdiInfrastructure extends WeldBaseTest {&lt;br /&gt;
&lt;br /&gt;
  @Inject&lt;br /&gt;
  private ApplicationScopedBean applicationBean;&lt;br /&gt;
&lt;br /&gt;
  @Inject&lt;br /&gt;
  private SessionScopedBean sessionBean;&lt;br /&gt;
&lt;br /&gt;
  @Inject&lt;br /&gt;
  private RequestScopedBean requestBean;&lt;br /&gt;
&lt;br /&gt;
  /** beans are correctly injected */&lt;br /&gt;
  @Test&lt;br /&gt;
  public void beansAreInjected() {&lt;br /&gt;
    assertThat(&amp;quot;application bean is injected&amp;quot;, applicationBean, notNullValue());&lt;br /&gt;
    assertThat(&amp;quot;session bean is injected&amp;quot;, sessionBean, notNullValue());&lt;br /&gt;
    assertThat(&amp;quot;request bean is injected&amp;quot;, requestBean, notNullValue());&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scopes ===&lt;br /&gt;
&lt;br /&gt;
Application and session scopes are shared among all test cases in the same class whereas a new request scope is created for each test case method. Application scope is reset for each new class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 /** starts application and session scopes */&lt;br /&gt;
  @Test&lt;br /&gt;
  @InSequence(1)&lt;br /&gt;
  public void start() {&lt;br /&gt;
    applicationBean.setValue(&amp;quot;application&amp;quot;);&lt;br /&gt;
    sessionBean.setValue(&amp;quot;session&amp;quot;);&lt;br /&gt;
    requestBean.setValue(&amp;quot;request&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    assertThat(applicationBean.getValue(), equalTo(&amp;quot;application&amp;quot;));&lt;br /&gt;
    assertThat(sessionBean.getValue(), equalTo(&amp;quot;session&amp;quot;));&lt;br /&gt;
    assertThat(requestBean.getValue(), equalTo(&amp;quot;request&amp;quot;));&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /** application and session scopes are preserved but not request scope */&lt;br /&gt;
  @Test&lt;br /&gt;
  @InSequence(2)&lt;br /&gt;
  public void applicationAndSessionShouldBeKept() {&lt;br /&gt;
    assertThat(applicationBean.getValue(), equalTo(&amp;quot;application&amp;quot;));&lt;br /&gt;
    assertThat(sessionBean.getValue(), equalTo(&amp;quot;session&amp;quot;));&lt;br /&gt;
    assertThat(requestBean.getValue(), nullValue());&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameterization ===&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;code&amp;gt;CdiInfrastructure&amp;lt;/code&amp;gt; class uses &amp;lt;code&amp;gt;org.jboss.arquillian.junit.Arquillian&amp;lt;/code&amp;gt; runner, it is not possible to use other runners, which also includes &amp;lt;code&amp;gt;org.junit.runners.Parameterized&amp;lt;/code&amp;gt; runner.&lt;br /&gt;
&lt;br /&gt;
This limitation can be workarounded by adding a field annotated as &amp;lt;code&amp;gt;@Rule&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;org.openbravo.base.weld.test.ParameterCdiTestRule&amp;lt;/code&amp;gt; type created with the list of the values for parameters and another field annotated as &amp;lt;code&amp;gt;@ParameterCdiTest&amp;lt;/code&amp;gt; which will take those values. In this case each test case will be executed as many times as number of items the parameter list contains each of them the parameter field will take a different item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class ParameterizedCdi extends WeldBaseTest {&lt;br /&gt;
  public static final List&amp;lt;String&amp;gt; PARAMS = Arrays.asList(&amp;quot;param1&amp;quot;, &amp;quot;param2&amp;quot;, &amp;quot;param3&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  /** defines the values the parameter will take. */&lt;br /&gt;
  @Rule&lt;br /&gt;
  public ParameterCdiTestRule&amp;lt;String&amp;gt; parameterValuesRule = new ParameterCdiTestRule&amp;lt;String&amp;gt;(&lt;br /&gt;
      PARAMS);&lt;br /&gt;
&lt;br /&gt;
  /** this field will take the values defined by parameterValuesRule field. */&lt;br /&gt;
  private @ParameterCdiTest String parameter;&lt;br /&gt;
&lt;br /&gt;
  private static int counterTest1 = 0;&lt;br /&gt;
&lt;br /&gt;
  /** Test case to be executed once per parameter value */&lt;br /&gt;
  @Test&lt;br /&gt;
  public void test1() {&lt;br /&gt;
    assertThat(&amp;quot;parameter value&amp;quot;, parameter, equalTo(PARAMS.get(counterTest1)));&lt;br /&gt;
    counterTest1++;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example &amp;lt;code&amp;gt;test1&amp;lt;/code&amp;gt; test case will be executed 3 times having &amp;lt;code&amp;gt;parameter&amp;lt;/code&amp;gt; field &amp;quot;param1&amp;quot;, &amp;quot;param2&amp;quot; and &amp;quot;param3&amp;quot; value in each of these executions.&lt;br /&gt;
&lt;br /&gt;
Unlike when using &amp;lt;code&amp;gt;Parameterized.class&amp;lt;/code&amp;gt; runner, all these 3 executions are seen as a single execution (&amp;lt;code&amp;gt;Parameterized.class&amp;lt;/code&amp;gt; would show 3 independent executions), this causes that if, for example, first execution fails the rest will not be run.&lt;br /&gt;
&lt;br /&gt;
=== DAL event observers ===&lt;br /&gt;
&lt;br /&gt;
Because [[How_to_implement_a_business_event_handler|DAL event observers]] make use of CDI to work, they are not executed in standard test cases extending &amp;lt;code&amp;gt;OBBaseTest&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This limitation does not apply when using &amp;lt;code&amp;gt;WeldBaseTest&amp;lt;/code&amp;gt; tests.&lt;br /&gt;
&lt;br /&gt;
== Run test located in external module locally ==&lt;br /&gt;
&lt;br /&gt;
When a test is created in an external module (external of OpenbravoTest project) some problems are found to execute the testcase in Eclipse. See an example of a test located in '''org.openbravo.client.myob''' module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Before.png | 900px | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As we can see in the previous picture, it is not possible to execute MyOpenbravoTest.java. The following actions will be done to be able to execute in local your testcase located in other module (external module of OpenbravoTest project):&lt;br /&gt;
* First of all, OpenbravoTest project should be configured properly. Steps:&lt;br /&gt;
** Copy classpahttp://wiki.openbravo.com/wiki/How_to_create_JUnit_testcases#Run_test_located_in_external_module_locallyth: ~/pi/src-test$ cp .classpath.template  .classpath&lt;br /&gt;
** Import in eclipse project folder ~/src-test&lt;br /&gt;
** Full documentation can be found in the previous sections of this page.&lt;br /&gt;
* Right click on OpenbravoTest project.&lt;br /&gt;
* Select Properties  &amp;gt; Java Build Path.&lt;br /&gt;
* Click on ‘Link Source’ button.&lt;br /&gt;
* Fill the ‘Linked folder location’ field with the src-test folder of the target module. (e.g. openbravo-path/modules/org.openbravo.client.myob/src-test). &lt;br /&gt;
* Click on ‘Apply’ button.&lt;br /&gt;
&lt;br /&gt;
Now it is possible to execute a test located in external module locally. See the image below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:After.png | 900px | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
</feed>