Changeset 4625
- Timestamp:
- Nov 4, 2008, 4:45:36 PM (15 years ago)
- Location:
- trunk/src/test/net/sf/basedb/test/roles
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/test/net/sf/basedb/test/roles/AdminTest.java
r4514 r4625 47 47 import net.sf.basedb.plugins.PrintMapFlatFileImporter; 48 48 import net.sf.basedb.plugins.ReporterMapFlatFileImporter; 49 import net.sf.basedb.plugins.batchimport.ArrayBatchImporter; 50 import net.sf.basedb.plugins.batchimport.ArrayDesignImporter; 51 import net.sf.basedb.plugins.batchimport.ArraySlideImporter; 52 import net.sf.basedb.plugins.batchimport.BioSourceImporter; 53 import net.sf.basedb.plugins.batchimport.ExtractImporter; 54 import net.sf.basedb.plugins.batchimport.HybridizationImporter; 55 import net.sf.basedb.plugins.batchimport.LabeledExtractImporter; 56 import net.sf.basedb.plugins.batchimport.RawBioAssayImporter; 57 import net.sf.basedb.plugins.batchimport.SampleImporter; 58 import net.sf.basedb.plugins.batchimport.ScanImporter; 49 59 import net.sf.basedb.test.AffymetrixData; 50 60 import net.sf.basedb.test.FileUtil; … … 98 108 plugins.add(PluginDefinition.getByClassName(dc, ReporterMapFlatFileImporter.class.getName())); 99 109 plugins.add(PluginDefinition.getByClassName(dc, PrintMapFlatFileImporter.class.getName())); 110 111 plugins.add(PluginDefinition.getByClassName(dc, ArrayDesignImporter.class.getName())); 112 plugins.add(PluginDefinition.getByClassName(dc, ArrayBatchImporter.class.getName())); 113 plugins.add(PluginDefinition.getByClassName(dc, ArraySlideImporter.class.getName())); 100 114 addPermissions(dc, powerUser, plugins, USE); 115 116 plugins.clear(); 117 plugins.add(PluginDefinition.getByClassName(dc, BioSourceImporter.class.getName())); 118 plugins.add(PluginDefinition.getByClassName(dc, SampleImporter.class.getName())); 119 plugins.add(PluginDefinition.getByClassName(dc, ExtractImporter.class.getName())); 120 plugins.add(PluginDefinition.getByClassName(dc, LabeledExtractImporter.class.getName())); 121 plugins.add(PluginDefinition.getByClassName(dc, HybridizationImporter.class.getName())); 122 plugins.add(PluginDefinition.getByClassName(dc, ScanImporter.class.getName())); 123 plugins.add(PluginDefinition.getByClassName(dc, RawBioAssayImporter.class.getName())); 124 addPermissions(dc, user, plugins, USE); 101 125 dc.commit(); 102 126 -
trunk/src/test/net/sf/basedb/test/roles/Run.java
r4514 r4625 43 43 boolean all = cmds.contains("all"); 44 44 boolean logMemoryUsage = cmds.contains("-m"); 45 boolean useBatchImporters = cmds.contains("-b"); 45 46 46 47 int tests = 0; … … 61 62 { 62 63 TestUtil.begin(logMemoryUsage, true); 63 ok = PowerUserTest.run();64 ok = useBatchImporters ? PowerUserBatchImporterTest.run() : PowerUserTest.run(); 64 65 tests++; 65 66 } … … 67 68 { 68 69 TestUtil.begin(logMemoryUsage, true); 69 ok = UserTest.run();70 ok = useBatchImporters ? UserBatchImporterTest.run() : UserTest.run(); 70 71 tests++; 71 72 } … … 88 89 { 89 90 TestUtil.write( 90 "test.sh roles [ -m] <cmds>\n" +91 "test.sh roles [OPTION] <cmds>\n" + 91 92 " -m = log memory usage to file memory.log\n" + 93 " -b = use the batch importers to insert items into BASE.\n" + 92 94 " cmds = list of tests to run; all, root, admin, power, user, guest\n\n"); 93 95 -
trunk/src/test/net/sf/basedb/test/roles/Util.java
r4548 r4625 32 32 import net.sf.basedb.core.ArraySlide; 33 33 import net.sf.basedb.core.BioAssaySet; 34 import net.sf.basedb.core.BioSource; 34 35 import net.sf.basedb.core.DbControl; 35 36 import net.sf.basedb.core.Experiment; … … 47 48 import net.sf.basedb.core.Protocol; 48 49 import net.sf.basedb.core.Quota; 50 import net.sf.basedb.core.RawBioAssay; 49 51 import net.sf.basedb.core.RawDataType; 50 52 import net.sf.basedb.core.Role; 53 import net.sf.basedb.core.Sample; 51 54 import net.sf.basedb.core.Software; 52 55 import net.sf.basedb.core.Unit; … … 270 273 return query.list(dc).get(0); 271 274 } 272 275 276 /** 277 Returns the first raw bioassay that was found with a certain name 278 */ 279 public static RawBioAssay findRawBioAssay(DbControl dc, String name) 280 { 281 ItemQuery<RawBioAssay> query = RawBioAssay.getQuery(); 282 query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name))); 283 return query.list(dc).get(0); 284 } 285 286 /** 287 Returns the first sample that was found with a certain name 288 */ 289 public static Sample findSample(DbControl dc, String name) 290 { 291 ItemQuery<Sample> query = Sample.getQuery(); 292 query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name))); 293 return query.list(dc).get(0); 294 } 295 296 /** 297 Returns the first biosource that was found with a certain name 298 */ 299 public static BioSource findBioSource(DbControl dc, String name) 300 { 301 ItemQuery<BioSource> query = BioSource.getQuery(); 302 query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name))); 303 return query.list(dc).get(0); 304 } 273 305 }
Note: See TracChangeset
for help on using the changeset viewer.