cv.setId("cv_" + i);
qcmlExpected.addCv(cv);
}
// add RunQuality's
for(int i = 0; i < 5; i++) {
QualityAssessment runQuality = new QualityAssessment("run_" + i);
// add MetaDataParameters
for(int j = 0; j < (i+1) * 2; j++) {
MetaDataParameter param = new MetaDataParameter();
param.setName("metadata parameter " + i + "-" + j);
param.setId("mp_run" + i + "_param" + j);
param.setCvRef(qcmlExpected.getCv("cv_" + (i+j) % qcmlExpected.getNumberOfCvs()));
param.setAccession("QC:00000" + j);
param.setValue(Integer.toString((int)(Math.random()*1000)));
runQuality.addMetaDataParameter(param);
}
// add QualityParameters
for(int j = 0; j < (i+1) * 3; j++) {
QualityParameter param = new QualityParameter();
param.setName("quality parameter " + i + "-" + j);
param.setId("qp_run" + i + "_param" + j);
param.setCvRef(qcmlExpected.getCv("cv_" + (i+j) % qcmlExpected.getNumberOfCvs()));
param.setAccession("QC:00000" + j);
param.setValue(Integer.toString((int)(Math.random()*1000)));
runQuality.addQualityParameter(param);
}
// add AttachmentParameters
for(int j = 0; j < (i+1) * 2; j++) {
AttachmentParameter param = new AttachmentParameter();
param.setName("attachment parameter " + i + "-" + j);
param.setId("ap_run" + i + "_param" + j);
param.setCvRef(qcmlExpected.getCv("cv_" + (i+j) % qcmlExpected.getNumberOfCvs()));
param.setAccession("QC:00000" + j);
param.setQualityParameterRef(runQuality.getQualityParameter("qp_run" + i + "_param" + j));
param.setBinary(DatatypeConverter.printBase64Binary(new BigInteger(1024, random).toByteArray()));
runQuality.addAttachmentParameter(param);
}
qcmlExpected.addRunQuality(runQuality);
}
// add SetQuality's
for(int i = 0; i < 2; i++) {
QualityAssessment setQuality = new QualityAssessment("set_" + i);
// add MetaDataParameters
for(int j = 0; j < (i+1) * 2; j++) {
MetaDataParameter param = new MetaDataParameter();
param.setName("metadata parameter " + i + "-" + j);
param.setId("mp_set" + i + "_param" + j);
param.setCvRef(qcmlExpected.getCv("cv_" + (i+j) % qcmlExpected.getNumberOfCvs()));
param.setAccession("QC:00000" + j);
param.setValue(Integer.toString((int)(Math.random()*1000)));
setQuality.addMetaDataParameter(param);
}
// add QualityParameters
for(int j = 0; j < (i+1) * 5; j++) {
QualityParameter param = new QualityParameter();
param.setName("quality parameter " + i + "-" + j);
param.setId("qp_set" + i + "_param" + j);
param.setCvRef(qcmlExpected.getCv("cv_" + (i+j) % qcmlExpected.getNumberOfCvs()));
param.setAccession("QC:00000" + j);
param.setValue(Integer.toString((int)(Math.random()*1000)));
setQuality.addQualityParameter(param);
}
// add AttachmentParameters
for(int j = 0; j < (i+1) * 3; j++) {
AttachmentParameter param = new AttachmentParameter();
param.setName("attachment parameter " + i + "-" + j);
param.setId("ap_set" + i + "_param" + j);
param.setCvRef(qcmlExpected.getCv("cv_" + (i+j) % qcmlExpected.getNumberOfCvs()));
param.setAccession("QC:00000" + j);
param.setQualityParameterRef(setQuality.getQualityParameter("qp_set" + i + "_param" + j));
param.setBinary(DatatypeConverter.printBase64Binary(new BigInteger(1024, random).toByteArray()));
setQuality.addAttachmentParameter(param);
}
qcmlExpected.addSetQuality(setQuality);
}
qcmlExpected.addCv(new Cv("cv item 5", "/path/to/cv/5", "cv_5"));
qcmlExpected.addCv(new Cv("cv item 6", "/path/to/cv/6", "cv_6"));