• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • Last Change
  • Annotate
  • Revision Log

root/trunk/components/model/test/ome/model/utests/ScreenPlateWellTest.java

Revision 3075, 3.7 kB (checked in by andrew, 2 months ago)

Update to September 2008 Data Model
Major update to the data model mapping files.
Minor updates to other files to fix the resulting errors / warnings.
Temporary fix for removal of Color object - replaced with ColorFix? until it can be removed completely.

Line 
1/*
2 *   $Id$
3 *
4 *   Copyright 2008 Glencoe Software, Inc. All rights reserved.
5 *   Use is subject to license terms supplied in LICENSE.txt
6 */
7package ome.model.utests;
8
9import junit.framework.TestCase;
10import ome.model.core.Image;
11import ome.model.screen.Plate;
12import ome.model.screen.Reagent;
13import ome.model.screen.Screen;
14import ome.model.screen.ScreenAcquisition;
15import ome.model.screen.Well;
16import ome.model.screen.WellSample;
17
18import org.testng.annotations.Test;
19
20public class ScreenPlateWellTest extends TestCase {
21
22    // Public since used by integration test for simple save
23
24    public Screen screen = new Screen("s");
25
26    public Plate plate1 = new Plate("p1"), plate2 = new Plate("p2");
27
28    public Well well1_1 = new Well(), well1_2 = new Well(),
29            well2_1 = new Well(), well2_2 = new Well();
30
31    public WellSample ws1_1a = new WellSample(), ws1_1b = new WellSample(),
32            ws1_2a = new WellSample(), ws1_2b = new WellSample(),
33            ws2_1a = new WellSample(), ws2_1b = new WellSample(),
34            ws2_2a = new WellSample(), ws2_2b = new WellSample();
35
36    public ScreenAcquisition acq1 = new ScreenAcquisition(),
37            acq2 = new ScreenAcquisition(), acq3 = new ScreenAcquisition(),
38            acq4 = new ScreenAcquisition();
39
40    public Reagent reagentA = new Reagent(), reagentB = new Reagent(),
41            reagentC = new Reagent();
42    {
43        reagentA.setName("A");
44        reagentB.setName("B");
45        reagentC.setName("C");
46    }
47
48    private java.sql.Timestamp testTimestamp = new java.sql.Timestamp(System.currentTimeMillis());
49    public Image i1_1a = new Image(testTimestamp, "i1_1a");
50    public Image i1_1b = new Image(testTimestamp, "i1_1b");
51    public Image i1_2a = new Image(testTimestamp, "i1_2a");
52    public Image i1_2b = new Image(testTimestamp, "i1_2b");
53    public Image i2_1a = new Image(testTimestamp, "i2_1a");
54    public Image i2_1b = new Image(testTimestamp, "i2_1b");
55    public Image i2_2a = new Image(testTimestamp, "i2_2a");
56    public Image i2_2b = new Image(testTimestamp, "i2_2b");
57
58    @Test
59    public void testBuildingAScreen() {
60
61        screen.setName("screen-name");
62        screen.setDescription("screen-description");
63
64        screen.linkPlate(plate1);
65        screen.linkPlate(plate2);
66
67        plate1.addWell(well1_1);
68        plate1.addWell(well1_2);
69
70        plate2.addWell(well2_1);
71        plate2.addWell(well2_2);
72
73        well1_1.addWellSample(ws1_1a);
74        well1_1.addWellSample(ws1_1b);
75
76        well1_2.addWellSample(ws1_2a);
77        well1_2.addWellSample(ws1_2b);
78
79        well2_1.addWellSample(ws2_1a);
80        well2_1.addWellSample(ws2_1b);
81
82        well2_2.addWellSample(ws2_2a);
83        well2_2.addWellSample(ws2_2b);
84
85        i1_1a.addWellSample(ws1_1a);
86        i1_1b.addWellSample(ws1_1b);
87        i1_2a.addWellSample(ws1_2a);
88        i1_2b.addWellSample(ws1_2b);
89        i2_1a.addWellSample(ws2_1a);
90        i2_1b.addWellSample(ws2_1b);
91        i2_2a.addWellSample(ws2_2a);
92        i2_2b.addWellSample(ws2_2b);
93
94        screen.addScreenAcquisition(acq1);
95        screen.addScreenAcquisition(acq2);
96        screen.addScreenAcquisition(acq3);
97        screen.addScreenAcquisition(acq4);
98
99        acq1.linkWellSample(ws1_1a);
100        acq1.linkWellSample(ws1_1b);
101        acq1.linkWellSample(ws1_2a);
102        acq1.linkWellSample(ws1_2b);
103        acq2.linkWellSample(ws2_1a);
104        acq2.linkWellSample(ws2_1b);
105        acq3.linkWellSample(ws2_2a);
106        acq4.linkWellSample(ws2_2b);
107
108        reagentA.setScreen(screen);
109        reagentB.setScreen(screen);
110        reagentC.setScreen(screen);
111
112        reagentA.linkWell(well1_1);
113        reagentA.linkWell(well2_2);
114        reagentB.linkWell(well2_1);
115        reagentC.linkWell(well1_2);
116
117    }
118}
Note: See TracBrowser for help on using the browser.

Download in other formats:

  • Plain Text
  • Original Format

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/