Fitnesse Plugin Works with SLIM

The migration of Adempiere modules to iDempiere

Fitnesse Plugin Works with SLIM

Postby red1 » Thu Oct 03, 2013 6:36 am

There are two test systems provided by Fitnesse which is FIT and SLIM. Carlos Ruiz has made a pretty good code-free framework with FIT as seen here http://wiki.idempiere.org/en/Fitnesse.HowTo.
It allows you to just configure the WIKI text without entering a single line into the core plugin code. So it is very super fast to work on and deploy your tests!

Now, i used to work with my SLIM system and still have old scripts to test old projects such as Libero Manufacturing. Now with the new Libero Mfg plugin conversion i like to run those tests again to confirm or see what still works or has broken or changed. I have some great code i did such as the Accounting Consequence black box and the Query List that dumps rows of records according to a certain criteria. I don't want that go to waste. After all they worked fine before.

So I played around with the Fitnesse plugin and noted that it does cater for SLIM system also. So question is how did i get it to work?

Firstly, i place all my old Fixture code into a new plugin project. Find it here in my bitbucket. The plugin is dependent on both idempiere fitnesse plugins and also my LiberoMfg code.

Screen Shot 2013-10-03 at 7.20.19 AM.png
Screen Shot 2013-10-03 at 7.20.19 AM.png (47.44 KiB) Viewed 8868 times

But i found a bug in the idempiere.fitnesse.server's web.xml and have submitted a ticket with patch and Carlos Ruis has just taken it in. I also need the fixture plugin to export out its package for me to reuse its nice Util @Ref feature done by Carlos Ruiz. He has also committed my patch for that.

Once these two small fixes are out of the way, i can run.sh Fitnesse to setup my Root page:

Code: Select all
!define TEST_SYSTEM {slim}
!define SLIM_HOST (localhost)
!define SLIM_PORT (62123)
!define fitnesse_home {/Applications/fitnesse}
!path ${fitnesse_home}/fitnesse.jar:${fitnesse_home}/lib/*.jar:${fitnesse_home}/bin
!define TEST_RUNNER {fitnesse.client.SlimServerServletInvoker}
!define COMMAND_PATTERN {java -Xms32m -Xmx512m -DLOG4J_LEVEL=CONFIG -cp %p %m http://localhost:8080/fitnesse/SlimServlet}

When saved it will look like this:

Screen Shot 2013-10-03 at 6.27.24 AM.png
Screen Shot 2013-10-03 at 6.27.24 AM.png (60.97 KiB) Viewed 8875 times

Then i just put in a sample SLIM script:

Code: Select all
!|ADempiere Login|
|User     | Password|Client|Role|execute?|
|GardenAdmin| GardenAdmin |GardenWorld|GardenWorld Admin|true|

!|User Setup |
| Business Partner |Organisation| Warehouse | Product |Forward Backward|Accounting Schema |Costing Method|Master Data?|Accounts Posting?|
|Joe Block | Furniture|Furniture | PatioSet |F|GardenWorld US/A/US Dollar |Standard |true |I|

ASSUMPTIONS FOR PATIO SET
!|User Setup|
|PatioSet Bom Type|Chair Safety Stock|Issue Method|Customer Delivery Rule|
|Make To Kit|20|Back Flush|Complete Line|

!|Manufacturing Steps For|
|Product|Available Storage?|
|PChair||
|PTable||
|Screen||
|PatioSet||

!|Manufacturing Steps For|
|Promise Days|Qty|Price|Transaction Type|Activity Measure|Activity Duration|Execute Transaction?|
|10  |1|500|Sales Order|Day|3|true|

Then press Test and voila!

Screen Shot 2013-10-03 at 6.32.43 AM.png
Screen Shot 2013-10-03 at 6.32.43 AM.png (128.2 KiB) Viewed 8875 times

If you click on the Output Captured it confirms that it is a SLIM.

Screen Shot 2013-10-03 at 6.34.57 AM.png
Screen Shot 2013-10-03 at 6.34.57 AM.png (56.13 KiB) Viewed 8875 times
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Fitnesse Plugin Works with SLIM

Postby red1 » Sat Oct 12, 2013 9:49 am

The test plugin can also be run in deployed iDempiere. Fetch here or install directly by pasting the script below inside your iDempiere console:

Code: Select all
install http://downloads.sourceforge.net/project/red1/p2/LiberoMFG/org.idempiere.fitnesse.Mfg_1.0.0.201310160013.jar

The core idempiere project also need to update some changes i fixed in order for Slim to work. If you cannot update those plugins you can do so manually:
FitnesseFixture - http://jenkins.idempiere.com/job/iDempi ... p*/jar.zip
FitnesseServer - http://jenkins.idempiere.com/job/iDempi ... p*/jar.zip

You can read further from the README at the SF repo: http://sourceforge.net/projects/red1/fi ... LiberoMFG/
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Fitnesse Plugin Works with SLIM

Postby red1 » Wed Oct 16, 2013 12:44 pm

THE FULL SCRIPT IS BELOW: (You can fetch the ROOT script above which remains unchanged mostly).
Code: Select all
!|ADempiere Login|
|User|Password|Client|Role|execute?|
|GardenAdmin|GardenAdmin|GardenWorld|GardenWorld Admin|true|

!|User Setup|
|Business Partner|Organisation|Warehouse|Product|Forward Backward|Accounting Schema|Costing Method|Master Data?|Accounts Posting?|
|Joe Block | Furniture|Furniture | PatioSet |F|GardenWorld US/A/US Dollar |Standard |true |I|

!|User Setup|
|PatioSet Bom Type|Chair Safety Stock|Issue Method|Customer Delivery Rule|
|Make To Kit|20|Back Flush|Complete Line|

Check Storage
!|Manufacturing Steps For|
|Product|Storage On Hand?|Storage Reserved?|Available Storage?|
|PChair|30|0|30|
|PTable|12|0|12|
|Screen|15|0|15|
|PatioSet|0|0|0|

ISSUE SALES ORDER FOR A BOM - PATIO CHAIR
!|Manufacturing Steps For|
|Promise Days|Qty|Price|Transaction Type|Activity Measure|Activity Duration|Execute Transaction?|
|10|1|500|Sales Order|Day|3|true|

!|Manufacturing Steps For|
|Product|Storage On Hand?|Storage Reserved?|Available Storage?|
|PChair|30 |0 |30|
|PTable|12 |0 |12|
|Screen|15 |0 |15|
|PatioSet|0 |1 |-1|

!|Query:Check MRP|
|Name|PP_MRP_ID|Doc Status|Order Type|Warehouse|Product|Qty|Start Schedule|Finish Schedule|OrderBomLine|PP_Order|
|MRP||CO|SOO||||||||
|80000||IP|MOP||||||||
|80000||IP|MOP||||||||
|80000||IP|MOP||||||||
|80000||IP|MOP||||||||

!|Process Handling|
|Calculate Material Plan?|
|true|

!|Query:Check Manufacturing Order|
|Document No|Product|Doc Status|Qty Ordered|Qty Reserved|Qty Delivered|Date Promised|Date Start Schedule|Date Finish Schedule|
|80000|MProduct[145-PatioSet]|IP|1|1|0||||

!|Query:Check MRP|
|Name|PP_MRP_ID|Doc Status|Order Type|Warehouse|Product|Qty|Start Schedule|Finish Schedule|OrderBomLine|PP_Order|
|MRP||CO|||||||||
|80000||IP|||||||||
|80000||IP|||||||||
|80000||IP|||||||||
|80000||IP|||||||||
|MRP||DR|||||||||
|MRP||DR|||||||||
|MRP||DR|||||||||
|MRP||DR|||||||||

!|Query:Check Requisition|
|Product|Qty|Price|Org ID|Doc Status|
|MProduct[133-PChair]|||||
|MProduct[134-PTable]|||||
|MProduct[135-Screen]|||||
|MProduct[133-PChair]|||||

!|Query:Check Manufacturing Order BOM|
|Name|Document No|Product|Mfg Order|
|Patio Furniture Set||||

!|Query:Check Manufacturing Order Node|
|Name|Doc Status|Node|Workflow|Qty Delivered|Setup Time|
|Assembly|DR|||||

!|Query:Check Manufacturing Order WorkFlow|
|Name|Workflow|Resource|
|Patio Furniture Set|||

!|Process Handling|
|Calculate Requirements Plan?|
|true|

!|Query:Check Manufacturing Order|
|Document No|Product|Doc Status|Qty Ordered|Qty Reserved|Qty Delivered|Date Promised|Date Start Schedule|Date Finish Schedule|OrderLine|
|80000|MProduct[145-PatioSet]|IP|1|1|0|||||

!|Manufacturing Steps For|
|Product|Qty|Transaction Type|Location From|Location To|Execute Transaction?|
|PChair|29|Inventory Movement|Default HQ Locator|Furniture|true|
|PTable|2|Inventory Movement|Default HQ Locator|Furniture|true|
|Screen|2|Inventory Movement|Default HQ Locator|Furniture|true|

!|Manufacturing Steps For|
|Transaction Type|Execute Transaction?|Get Account?|
|Create Issue|true  |true|

!|Query:Check Cost Collector|
|Product |Type |Doc Status |Locator |Serial No |Movement Date |Finish |Movement Qty|
|MProduct[145-PatioSet] |100 |CO |Furniture |   ||               |1|
|MProduct[134-PTable] |110 |CO |Furniture |X_M_AttributeSetInstance[0] |||1|
|MProduct[133-PChair] |110 |CO |Furniture |X_M_AttributeSetInstance[0] |||4|
|MProduct[135-Screen] |110 |CO |Furniture |X_M_AttributeSetInstance[0] |||1|
|MProduct[134-PTable] |140 |CO |Furniture |X_M_AttributeSetInstance[0] |||1|
|MProduct[133-PChair] |140 |CO |Furniture |X_M_AttributeSetInstance[0] |||4|
|MProduct[135-Screen] |140 |CO |Furniture |X_M_AttributeSetInstance[0] |||1|

!|Manufacturing Steps For|
|Product|Storage On Hand?|Storage Reserved?|Available Storage?|
|PChair|26||26|
|PTable|11||11|
|Screen|14||14|
|PatioSet|1|1||

!|Manufacturing Steps For|
|Transaction Type|Action|Execute Transaction?|
|Process Mfg Order|Complete|true  |

!|Manufacturing Steps For|
|Product|Storage On Hand?|Storage Reserved?|Available Storage?|
|PChair|26||26|
|PTable|11||11|
|Screen|14||14|
|PatioSet|1|1||

!|Query:Check Manufacturing Order|
|Document No|Product|Doc Status|Qty Ordered|Qty Reserved|Qty Delivered|Date Promised|Date Start Schedule|Date Finish Schedule|OrderLine|
|80000|MProduct[145-PatioSet]|CO|1|0|1|||||

!|Manufacturing Steps For|
|Transaction Type|Action|Execute Transaction?|
|Process Mfg Order|Close|true|

!|Query:Check Manufacturing Order|
|Document No|Product|Doc Status|Qty Ordered|Qty Reserved|Qty Delivered|Date Promised|Date Start Schedule|Date Finish Schedule|OrderLine|
|80000|MProduct[145-PatioSet]|CL|1|0|1|||||

!|Query:Check Manufacturing Order Node|
|Name|Doc Status|Node|Workflow|Qty Delivered|Setup Time|
|Assembly|CL|||||

!|Query:Check MRP|
|Name|PP_MRP_ID|Doc Status|Order Type|Warehouse|Product|Qty|Start Schedule|Finish Schedule|OrderBomLine|PP_Order|
|MRP||CO|||||||||
|80000||CL|||||||||
|80000||CL|||||||||
|80000||CL|||||||||
|80000||CL|||||||||
|MRP||DR|||||||||
|MRP||DR|||||||||
|MRP||DR|||||||||
|MRP||DR|||||||||

!|Manufacturing Steps For|
|Product|Storage On Hand?|Storage Reserved?|Available Storage?|
|PChair  |26||26|
|PTable |11||11|
|Screen |14||14|
|PatioSet |1|1||

!|Query:Check Notes|
|Reference|Note ID|Message|Other Info|
|PChair Patio Chair||||
|PChair Patio Chair||||
|PatioSet Patio Furniture Set||||

!|User Setup|
|Roll Back?|
|true|
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Fitnesse Plugin Works with SLIM

Postby red1 » Wed Oct 16, 2013 12:59 pm

Below are the screenshots from a successful run of the above test script, after the LiberoMfg and fitnesse.mfg plugins are installed and activated. Later i will post a YouTube movie on how to get this going.

Screen Shot 2013-10-16 at 11.05.42 AM.png
Screen Shot 2013-10-16 at 11.05.42 AM.png (92.05 KiB) Viewed 8774 times
Screen Shot 2013-10-16 at 11.06.11 AM.png
Screen Shot 2013-10-16 at 11.06.11 AM.png (127.32 KiB) Viewed 8774 times
Screen Shot 2013-10-16 at 11.06.43 AM.png
Screen Shot 2013-10-16 at 11.06.43 AM.png (157.17 KiB) Viewed 8774 times
Screen Shot 2013-10-16 at 11.07.06 AM.png
Screen Shot 2013-10-16 at 11.07.06 AM.png (110.63 KiB) Viewed 8774 times
Screen Shot 2013-10-16 at 11.07.23 AM.png
Screen Shot 2013-10-16 at 11.07.23 AM.png (115.66 KiB) Viewed 8774 times
Screen Shot 2013-10-16 at 11.07.45 AM.png
Screen Shot 2013-10-16 at 11.07.45 AM.png (93.78 KiB) Viewed 8774 times
Screen Shot 2013-10-16 at 11.09.41 AM.png
Screen Shot 2013-10-16 at 11.09.41 AM.png (161.83 KiB) Viewed 8774 times
Screen Shot 2013-10-16 at 11.54.00 AM.png
Screen Shot 2013-10-16 at 11.54.00 AM.png (77.99 KiB) Viewed 8774 times
red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Fitnesse Plugin Works with SLIM

Postby red1 » Thu Oct 17, 2013 7:59 am

Below are two movies i created to help you understand iDempiere FitNesse FIT setup and testing. The other is the actual SliM testing as described above.



red1
Site Admin
 
Posts: 2759
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia


Return to iDempiere

Who is online

Users browsing this forum: No registered users and 2 guests

cron