Ignore:
Timestamp:
Jan 28, 2011, 12:30:39 PM (8 years ago)
Author:
robert@…
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/nl/tno/metagenomics/integration/TrashServiceTests.groovy

    r7 r9  
    4747               
    4848                // Create four samples
    49                 Sample sa1 = new Sample( id: 1, name: "Sample 1a", sampleToken: "sample1a", study: s );
    50                 Sample sa2 = new Sample( id: 2, name: "Sample 1b", sampleToken: "sample1b", study: s );
    51                 Sample sa3 = new Sample( id: 3, name: "Sample 2a", sampleToken: "sample2a", study: s );
    52                 Sample sa4 = new Sample( id: 4, name: "Sample 2b", sampleToken: "sample2b", study: s );
    53                 Sample sa5 = new Sample( id: 5, name: "Sample 3a", sampleToken: "sample3a", study: s );
     49                Sample sa1 = new Sample( id: 1, name: "Sample 1a", subject: "S1", event: "event", sampleToken: "sample1a", study: s );
     50                Sample sa2 = new Sample( id: 2, name: "Sample 1b", subject: "S2", event: "event", sampleToken: "sample1b", study: s );
     51                Sample sa3 = new Sample( id: 3, name: "Sample 2a", subject: "S3", event: "event", sampleToken: "sample2a", study: s );
     52                Sample sa4 = new Sample( id: 4, name: "Sample 2b", subject: "S4", event: "event", sampleToken: "sample2b", study: s );
     53                Sample sa5 = new Sample( id: 5, name: "Sample 3a", subject: "S5", event: "event", sampleToken: "sample3a", study: s );
    5454                def samples = [sa1, sa2, sa3, sa4, sa5]
    5555               
     
    6464                // Create desired combinations of samples and assays
    6565                // Such that: assay1 has 2 samples with data, assay2 has 1 sample with data and assay3 has no samples with data
    66            AssaySample as1a = new AssaySample( oligoNumber: "123", tagSequence: "abc", sample: sa1, assay: a1 );
    67            AssaySample as1b = new AssaySample( oligoNumber: "200", tagSequence: "def", sample: sa2, assay: a1 );
    68            AssaySample as2a = new AssaySample( oligoNumber: "300", tagSequence: "ghi", sample: sa3, assay: a2 );
     66           AssaySample as1a = new AssaySample( oligoNumber: "123", tagSequence: "abc", tagName: "L391", sample: sa1, assay: a1 );
     67           AssaySample as1b = new AssaySample( oligoNumber: "200", tagSequence: "def", tagName: "L397", sample: sa2, assay: a1 );
     68           AssaySample as2a = new AssaySample( oligoNumber: "300", tagSequence: "ghi", tagName: "L421", sample: sa3, assay: a2 );
    6969           AssaySample as2b = new AssaySample( id: 12, sample: sa4, assay: a2);
    7070           AssaySample as3a = new AssaySample( sample: sa5, assay: a3);
     
    118118               
    119119                // Create three samples, two originally also present in assay 1, the other one isn't
    120                 Sample sa1 = new Sample( id: 101, name: "Sample 1a", sampleToken: "tsample1a", study: trash );
    121                 Sample sa2 = new Sample( id: 102, name: "Sample 1b", sampleToken: "tsample1b", study: trash );
    122                 Sample sa3 = new Sample( id: 103, name: "Sample 2a", sampleToken: "tsample2a", study: trash );
     120                Sample sa1 = new Sample( id: 101, name: "Sample 1a", sampleToken: "tsample1a", subject: "fromtrash: S1", event: "fromtrash: event", study: trash );
     121                Sample sa2 = new Sample( id: 102, name: "Sample 1b", sampleToken: "tsample1b", subject: "fromtrash: S2", event: "fromtrash: event", study: trash );
     122                Sample sa3 = new Sample( id: 103, name: "Sample 2a", sampleToken: "tsample2a", subject: "fromtrash: S3", event: "fromtrash: event", study: trash );
    123123                def samples = [sa1, sa2, sa3]
    124124               
     
    192192                assert assaySample.oligoNumber == "123"
    193193                assert assaySample.tagSequence == "abc"
     194                assert assaySample.sample.subject == "S1"
     195                assert assaySample.sample.event == "event"
    194196                assert assaySample.sequenceData.size() == 2
    195197
     
    198200                assert assaySample.oligoNumber == "200"
    199201                assert assaySample.tagSequence == "def"
     202                assert assaySample.sample.subject == "S2"
     203                assert assaySample.sample.event == "event"
    200204                assert assaySample.sequenceData.size() == 1
    201205
     
    204208                assert assaySample.oligoNumber == "300"
    205209                assert assaySample.tagSequence == "ghi"
     210                assert assaySample.sample.subject == "S3"
     211                assert assaySample.sample.event == "event"
    206212                assert !assaySample.sequenceData || assaySample.sequenceData.size() == 0
    207213
     
    281287                assert assaySample.oligoNumber == "123"
    282288                assert assaySample.tagSequence == "abc"
     289                assert assaySample.sample.subject == "S1"
     290                assert assaySample.sample.event == "event"
    283291                assert assaySample.sequenceData.size() == 2
    284292
     
    287295                assert assaySample.oligoNumber == "200"
    288296                assert assaySample.tagSequence == "def"
     297                assert assaySample.sample.subject == "S2"
     298                assert assaySample.sample.event == "event"
    289299                assert assaySample.sequenceData.size() == 1
    290300
     
    364374                assert assaySample.oligoNumber == "123"
    365375                assert assaySample.tagSequence == "abc"
     376                assert assaySample.sample.subject == "S1"
     377                assert assaySample.sample.event == "event"
    366378                assert assaySample.sequenceData.size() == 2
    367379
     
    419431                assert s.oligoNumber == "fromtrash: 1";
    420432                assert s.tagSequence == "fromtrash: abc";
     433               
     434                // Sample data shouldn't be copied, so remains the same
     435                assert s.sample.subject == "S1"
     436                assert s.sample.event == "event"
     437               
    421438                assert s.sequenceData?.size() == 4
    422439               
     
    468485                assert restoredTo.sequenceData?.size() == 2
    469486               
     487                // Sample data shouldn't be copied, so remains the same
     488                assert restoredTo.sample.subject == "S4"
     489                assert restoredTo.sample.event == "event"
     490               
    470491                assert restoredTo.numSequences() == 600
    471492                def sequenceFiles = restoredTo.sequenceData.sequenceFile;
Note: See TracChangeset for help on using the changeset viewer.