@@ -0,0 +1,1485 @@
+/**%0D%0A * %0D%0A */%0D%0A%0D%0Apackage edu.wustl.catissuecore.dbunit.test;%0D%0A%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport edu.wustl.catissuecore.dbunit.test.DefaultCatissueDBUnitTestCase;%0D%0Aimport edu.wustl.catissuecore.domain.Site;%0D%0Aimport edu.wustl.catissuecore.domain.User;%0D%0Aimport edu.wustl.common.exception.BizLogicException;%0D%0A%0D%0A/**%0D%0A * This class is specifically for the migration code required to move legacy data to %0D%0A * caTissueSuite with MSR functionality%0D%0A * %0D%0A * @author juberahamad_patel%0D%0A *%0D%0A */%0D%0Apublic class MSRMigrationTestCases extends DefaultCatissueDBUnitTestCase%0D%0A%7B%0D%0A%0D%0A%09/**%0D%0A%09 * 1. Get collection of all users in the database%0D%0A%09 * 2. Get collection of all sites in the database%0D%0A%09 * 3. Iterate over users, identify supervisors and technicians and add all sites to their site collection %0D%0A%09 * 4. We are not processing admins and scientists for the time being%0D%0A%09 */%0D%0A%09public void testMigrate()%0D%0A%09%7B%0D%0A%09%09List users = null;%0D%0A%09%09List sites = null;%0D%0A%0D%0A%09%09try%0D%0A%09%09%7B%0D%0A%09%09%09users = search(User.class);%0D%0A%09%09%09sites = search(Site.class);%0D%0A%09%09%7D%0D%0A%09%09catch (BizLogicException e)%0D%0A%09%09%7B%0D%0A%09%09%09fail(%22failed to retrieve all the users and sites%22);%0D%0A%09%09%7D%0D%0A%0D%0A%09%09for (Object o : users)%0D%0A%09%09%7B%0D%0A%09%09%09User user = (User) o;%0D%0A%09%09%09if (user.getRoleId().equals(%222%22) %7C%7C user.getRoleId().equals(%223%22))%0D%0A%09%09%09%7B%0D%0A%09%09%09%09user.getSiteCollection().addAll(sites);%0D%0A%09%09%09%09try%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09update(user);%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%09catch (BizLogicException e)%0D%0A%09%09%09%09%7B%0D%0A%09%09%09%09%09fail(%22failed to update User with email id %22 + user.getEmailAddress());%0D%0A%09%09%09%09%7D%0D%0A%09%09%09%7D%0D%0A%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

ADD dbunit test case