Changeset 6214


Ignore:
Timestamp:
05/03/10 11:00:25 (10 years ago)
Author:
callan
Message:

Updated test cases from Andrew and a couple more passing with some changes from me.

Location:
trunk/components/ome-xml/test/ome/xml/utests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/ome-xml/test/ome/xml/utests/IMetadataBasedOMEModelMock.java

    r6211 r6214  
    3636 
    3737import ome.xml.OMEXMLMetadataImpl; 
     38import ome.xml.r201004.Arc; 
    3839import ome.xml.r201004.BinaryFile; 
    3940import ome.xml.r201004.BooleanAnnotation; 
     
    4344import ome.xml.r201004.DoubleAnnotation; 
    4445import ome.xml.r201004.External; 
     46import ome.xml.r201004.Filament; 
    4547import ome.xml.r201004.Filter; 
    4648import ome.xml.r201004.FilterSet; 
     
    4850import ome.xml.r201004.Instrument; 
    4951import ome.xml.r201004.Laser; 
     52import ome.xml.r201004.LightEmittingDiode; 
    5053import ome.xml.r201004.LongAnnotation; 
    5154import ome.xml.r201004.MetadataOnly; 
     
    8386    store.createRoot(); 
    8487    makeImage(); 
     88    makeInstrument(); 
     89    store.resolveReferences(); 
    8590  } 
    8691 
     
    9398    store.setImageID(InOut201004Test.IMAGE_ID, 0); 
    9499    store.setBooleanAnnotationID(InOut201004Test.IMAGE_ANNOTATION_ID, 0); 
     100    store.setBooleanAnnotationNamespace( 
     101        InOut201004Test.GENERAL_ANNOTATION_NAMESPACE, 0); 
    95102    store.setBooleanAnnotationValue(InOut201004Test.IMAGE_ANNOTATION_VALUE, 0); 
    96103    store.setImageAnnotationRef(InOut201004Test.IMAGE_ANNOTATION_ID, 0, 0); 
     
    107114    store.setXMLAnnotationID( 
    108115        InOut201004Test.CHANNEL_ANNOTATION_ID, 0); 
     116    store.setXMLAnnotationNamespace( 
     117        InOut201004Test.GENERAL_ANNOTATION_NAMESPACE, 0); 
    109118    store.setXMLAnnotationValue( 
    110119        InOut201004Test.CHANNEL_ANNOTATION_VALUE, 0); 
     
    119128    store.setDoubleAnnotationID( 
    120129        InOut201004Test.PIXELS_ANNOTATION_ID, 0); 
     130    store.setDoubleAnnotationNamespace( 
     131        InOut201004Test.GENERAL_ANNOTATION_NAMESPACE, 0); 
    121132    store.setDoubleAnnotationValue( 
    122133        InOut201004Test.PIXELS_ANNOTATION_VALUE, 0); 
     
    124135  } 
    125136 
    126   private Instrument makeInstrument() { 
     137  private void makeInstrument() { 
    127138    // Create <Instrument/> 
    128     Instrument instrument = new Instrument(); 
    129     instrument.setID(InOut201004Test.INSTRUMENT_ID); 
     139    store.setInstrumentID(InOut201004Test.INSTRUMENT_ID, 0); 
     140 
    130141    // Create <Detector/> under <Instrument/> 
    131     Detector detector = new Detector(); 
    132     detector.setID(InOut201004Test.DETECTOR_ID); 
    133     detector.setModel(InOut201004Test.DETECTOR_MODEL); 
    134     instrument.addDetector(detector); 
     142    store.setDetectorID(InOut201004Test.DETECTOR_ID, 0, 0); 
     143    store.setDetectorModel(InOut201004Test.DETECTOR_MODEL, 0, 0); 
     144 
    135145    // Create <Laser/> under <Instrument/> 
    136     Laser laser = new Laser(); 
    137     laser.setID(InOut201004Test.LIGHTSOURCE_ID); 
    138     laser.setModel(InOut201004Test.LIGHTSOURCE_MODEL); 
    139     laser.setType(InOut201004Test.LASER_TYPE); 
    140     laser.setPower(InOut201004Test.LIGHTSOURCE_POWER); 
    141     instrument.addLightSource(laser); 
     146    store.setLaserID(InOut201004Test.LIGHTSOURCE_LASER_ID, 0, 0); 
     147    store.setLaserModel(InOut201004Test.LIGHTSOURCE_LASER_MODEL, 0, 0); 
     148    store.setLaserType(InOut201004Test.LASER_TYPE, 0, 0); 
     149    store.setLaserPower(InOut201004Test.LIGHTSOURCE_LASER_POWER, 0, 0); 
     150 
     151    // with a Pump> 
     152    store.setLaserID(InOut201004Test.LIGHTSOURCE_PUMP_ID, 0, 1); 
     153    store.setLaserModel(InOut201004Test.LIGHTSOURCE_PUMP_MODEL, 0, 1); 
     154    store.setLaserType(InOut201004Test.LASER_TYPE, 0, 1); 
     155    store.setLaserPower(InOut201004Test.LIGHTSOURCE_PUMP_POWER, 0, 1); 
     156    // and link them 
     157    store.setLaserPump(InOut201004Test.LIGHTSOURCE_PUMP_ID, 0, 0); 
     158 
     159    // Create <Arc/> under <Instrument/> 
     160    store.setArcID(InOut201004Test.LIGHTSOURCE_ARC_ID, 0, 2); 
     161    store.setArcModel(InOut201004Test.LIGHTSOURCE_ARC_MODEL, 0, 2); 
     162    store.setArcType(InOut201004Test.ARC_TYPE, 0, 2); 
     163    store.setArcPower(InOut201004Test.LIGHTSOURCE_ARC_POWER, 0, 2); 
     164 
     165    // Create <Filament/> under <Instrument/> 
     166    store.setFilamentID(InOut201004Test.LIGHTSOURCE_FILAMENT_ID, 0, 3); 
     167    store.setFilamentModel(InOut201004Test.LIGHTSOURCE_FILAMENT_MODEL, 0, 3); 
     168    store.setFilamentType(InOut201004Test.FILAMENT_TYPE, 0, 3); 
     169    store.setFilamentPower(InOut201004Test.LIGHTSOURCE_FILAMENT_POWER, 0, 3); 
     170 
     171    // Create <LightEmittingDiode/> under <Instrument/> 
     172    store.setLightEmittingDiodeID(InOut201004Test.LIGHTSOURCE_LED_ID, 0, 4); 
     173    store.setLightEmittingDiodeModel(InOut201004Test.LIGHTSOURCE_LED_MODEL, 0, 4); 
     174    store.setLightEmittingDiodePower(InOut201004Test.LIGHTSOURCE_LED_POWER, 0, 4); 
    142175 
    143176    // Create <Dichroic/> under <Instrument/> 
    144     Dichroic dichroic = new Dichroic(); 
    145     dichroic.setID(InOut201004Test.DICHROIC_ID); 
    146     dichroic.setSerialNumber(InOut201004Test.DICHROIC_SN); 
    147     // Create <FilterSet/> under <Dichroic/> 
    148     FilterSet filterSet = new FilterSet(); 
    149     filterSet.setID(InOut201004Test.FILTERSET_ID); 
    150     filterSet.setLotNumber(InOut201004Test.FILTERSET_LOT); 
    151     filterSet.linkDichroic(dichroic); 
    152  
    153     Filter emFilter = new Filter(); 
    154     Filter exFilter = new Filter(); 
    155     OTF otf = new OTF(); 
     177    store.setDichroicID(InOut201004Test.DICHROIC_ID, 0, 0); 
     178    store.setDichroicSerialNumber(InOut201004Test.DICHROIC_SN, 0, 0); 
     179 
     180    // Create <FilterSet/> under <Instrument/> 
     181    store.setFilterSetID(InOut201004Test.FILTERSET_ID, 0, 0); 
     182    store.setFilterSetLotNumber(InOut201004Test.FILTERSET_LOT, 0, 0); 
     183    store.setFilterSetDichroicRef(InOut201004Test.DICHROIC_ID, 0, 0); 
     184    store.setFilterSetEmissionFilterRef(InOut201004Test.EM_FILTER_ID, 0, 0, 0); 
     185    store.setFilterSetExcitationFilterRef(InOut201004Test.EX_FILTER_ID, 0, 0, 0); 
     186     
     187    // Create <Filter/>s under <Instrument/> 
     188    store.setFilterID(InOut201004Test.EM_FILTER_ID, 0, 0); 
     189    store.setFilterType(InOut201004Test.EM_FILTER_TYPE, 0, 0); 
     190     
     191    store.setFilterID(InOut201004Test.EX_FILTER_ID, 0, 1); 
     192    store.setFilterType(InOut201004Test.EX_FILTER_TYPE, 0, 1); 
     193 
    156194    // Create <Objective/> under <Instrument/> 
    157     Objective objective = new Objective(); 
    158     objective.setID(InOut201004Test.OBJECTIVE_ID); 
    159     objective.setModel(InOut201004Test.OBJECTIVE_MODEL); 
    160  
    161     emFilter.setID(InOut201004Test.EM_FILTER_ID); 
    162     emFilter.setType(InOut201004Test.EM_FILTER_TYPE); 
    163     exFilter.setID(InOut201004Test.EX_FILTER_ID); 
    164     exFilter.setType(InOut201004Test.EX_FILTER_TYPE); 
    165     otf.setID(InOut201004Test.OTF_ID); 
    166     otf.setType(InOut201004Test.OTF_PIXELTYPE); 
    167     otf.setSizeX(new PositiveInteger(InOut201004Test.OTF_SIZE_X)); 
    168     otf.setSizeY(new PositiveInteger(InOut201004Test.OTF_SIZE_Y)); 
    169     otf.setOpticalAxisAveraged(InOut201004Test.OTF_OPTICAL_AXIS_AVERAGED); 
     195    store.setObjectiveID(InOut201004Test.OBJECTIVE_ID, 0, 0); 
     196    store.setObjectiveModel(InOut201004Test.OBJECTIVE_MODEL, 0, 0); 
     197     
     198    // Create <OFT/> under <Instrument/> 
     199    store.setOTFID(InOut201004Test.OTF_ID, 0, 0); 
     200    store.setOTFType(InOut201004Test.OTF_PIXELTYPE, 0, 0); 
     201    store.setOTFSizeX(new PositiveInteger(InOut201004Test.OTF_SIZE_X), 0, 0); 
     202    store.setOTFSizeY(new PositiveInteger(InOut201004Test.OTF_SIZE_Y), 0, 0); 
     203    store.setOTFOpticalAxisAveraged(InOut201004Test.OTF_OPTICAL_AXIS_AVERAGED, 0, 0); 
     204     
    170205    // Create <ObjectiveSettings/> under <OTF/> 
    171     ObjectiveSettings otfObjectiveSettings = new ObjectiveSettings(); 
    172     otfObjectiveSettings.setID(objective.getID()); 
    173     otf.setObjectiveSettings(otfObjectiveSettings); 
     206    store.setOTFObjectiveSettingsID(InOut201004Test.OBJECTIVE_ID, 0, 0); 
     207 
    174208    // Create <BinaryFile/> under <OTF/> 
    175     BinaryFile otfBinaryFile = new BinaryFile(); 
    176     otfBinaryFile.setFileName(InOut201004Test.OTF_BINARY_FILE_NAME); 
    177     otfBinaryFile.setSize(InOut201004Test.OTF_BINARY_FILE_SIZE); 
    178     External otfBinaryFileExternal = new External(); 
    179     otfBinaryFileExternal.sethref(InOut201004Test.OTF_BINARY_FILE_EXTERNAL_HREF); 
    180     otfBinaryFileExternal.setSHA1(InOut201004Test.OTF_BINARY_FILE_EXTERNAL_SHA1); 
    181     otfBinaryFile.setExternal(otfBinaryFileExternal); 
    182     otf.setBinaryFile(otfBinaryFile); 
    183     otf.linkFilterSet(filterSet); 
    184  
    185     instrument.addFilter(emFilter); 
    186     instrument.addFilter(exFilter); 
    187     instrument.addOTF(otf); 
    188     instrument.addObjective(objective); 
    189  
    190     filterSet.linkEmissionFilter(emFilter); 
    191     filterSet.linkExcitationFilter(exFilter); 
    192     filterSet.linkDichroic(dichroic); 
    193     instrument.addFilterSet(filterSet); 
    194     instrument.addDichroic(dichroic); 
     209    store.setOTFBinaryFileFileName(InOut201004Test.OTF_BINARY_FILE_NAME, 0, 0); 
     210    store.setOTFBinaryFileSize(InOut201004Test.OTF_BINARY_FILE_SIZE, 0, 0); 
     211     
     212//    External otfBinaryFileExternal = new External(); 
     213//    otfBinaryFileExternal.sethref(InOut201004Test.OTF_BINARY_FILE_EXTERNAL_HREF); 
     214//    otfBinaryFileExternal.setSHA1(InOut201004Test.OTF_BINARY_FILE_EXTERNAL_SHA1); 
     215//    otfBinaryFile.setExternal(otfBinaryFileExternal); 
     216//    otf.setBinaryFile(otfBinaryFile); 
     217//    otf.linkFilterSet(filterSet); 
    195218 
    196219    // link Instrument to the first Image 
    197     //Image image = ome.getImage(0); 
    198     //image.linkInstrument(instrument); 
    199  
    200     return instrument; 
     220    store.setImageInstrumentRef(InOut201004Test.INSTRUMENT_ID, 0); 
    201221  } 
    202222 
  • trunk/components/ome-xml/test/ome/xml/utests/InOut201004Test.java

    r6213 r6214  
    376376    assertEquals(DIMENSION_ORDER, pixels.getDimensionOrder()); 
    377377    assertEquals(PIXEL_TYPE, pixels.getType()); 
    378     assertNotNull(pixels.getMetadataOnly()); 
    379378  } 
    380379 
Note: See TracChangeset for help on using the changeset viewer.