source: trunk/test/unit/dbnp/studycapturing/AssayControllerTests.groovy @ 1716

Last change on this file since 1716 was 1716, checked in by s.h.sikkema@…, 10 years ago

new gdtImporter; new jumpbar; excel export to webflow; fixed spelling errors on home page; added menu entry for new gdtImporter

  • Property svn:keywords set to Rev Author Date
File size: 2.1 KB
Line 
1package dbnp.studycapturing
2
3import grails.test.*
4
5/**
6 * AssayControllerTests Test
7 *
8 * @author  your email (+name?)
9 * @since       20101208
10 * @package     dbnp.studycapturing
11 *
12 * Revision information:
13 * $Rev: 1716 $
14 * $Author: s.h.sikkema@gmail.com $
15 * $Date: 2011-04-06 14:40:13 +0000 (wo, 06 apr 2011) $
16 */
17class AssayControllerTests extends ControllerUnitTestCase {
18    protected void setUp() {
19        super.setUp()
20        mockDomain(Assay, [new Assay(id:1)])
21    }
22
23    protected void tearDown() {
24        super.tearDown()
25    }
26
27
28// Disabled testing of controller since I made a webflow out of the excel export
29// testing might prove necessary later but tests need to be rewritten
30
31//    void testWrongAssayID() {
32//        mockFlash.assayId = 3
33//
34//        controller.compileExportData()
35//
36//        assertEquals 'Redirected action should match', [action: 'selectAssay'], redirectArgs
37//        assertEquals 'Error message', 'No assay found with id: 3', mockFlash.errorMessage
38//    }
39
40//    void testExceptionHandling() {
41//        mockFlash.assayId = 1
42//
43//        controller.metaClass.'grailsApplication' = [
44//                config: [modules: [metabolomics: [url: 'www.ab.com']]]
45//        ]
46//
47//        controller.assayService = [
48//
49//                collectAssayData:               {a, b, c -> throw new Exception('msg1') },
50//                convertColumnToRowStructure:    {a -> throw new Exception('msg2')},
51//                exportRowWiseDataToExcelFile:   {a, b -> throw new Exception('msg3') }
52//
53//        ]
54//
55//        controller.compileExportData()
56//
57//        assertEquals 'Redirected action should match', [action: 'selectAssay'], redirectArgs
58//        assertEquals 'Error message', 'msg1', mockFlash.errorMessage
59//
60//        controller.assayService.collectAssayData = {a, b, c -> true}
61//        controller.compileExportData()
62//
63//        assertEquals 'Redirected action should match', [action: 'selectAssay'], redirectArgs
64//        assertEquals 'Error message', 'msg2', mockFlash.errorMessage
65//
66//        controller.doExport()
67//
68//        assertEquals 'Redirected action should match', [action: 'selectAssay'], redirectArgs
69//        assertEquals 'Error message', 'msg3', mockFlash.errorMessage
70//
71//    }
72
73}
Note: See TracBrowser for help on using the repository browser.