pm = new ProfileManager(os, userProfileOS);
pm = new ProfileManager(os, userProfileOSW);
    public void setUp() throws Exception {        super.setUp();        osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest");        os = osw.getObjectStore();        userProfileOS =  ObjectStoreWriterFactory.getObjectStoreWriter("osw.userprofile-test");        pm = new ProfileManager(os, userProfileOS);        XmlBinding binding = new XmlBinding(osw.getModel());        InputStream is =            getClass().getClassLoader().getResourceAsStream("testmodel_data.xml");        List objects = (List) binding.unmarshal(is);        osw.beginTransaction();        Iterator iter = objects.iterator();        int i = 1;        while (iter.hasNext()) {            InterMineObject o = (InterMineObject) iter.next();            o.setId(new Integer(i++));            osw.store(o);        }        osw.commitTransaction();        PathQuery query = new PathQuery(Model.getInstanceByName("testmodel"));        Date date = null;        SavedQuery sq = new SavedQuery("query1", date, query);        InterMineBag bag = new InterMinePrimitiveBag();        bag.add("foo1");        bag.add("foo2");        bag.add("foo3");        bag.add(new Integer(100));        bag.add(new Boolean(true));        bag.add(new Float(1.1));        TemplateQuery template =            new TemplateQuery("template", "tdesc",                              new PathQuery(Model.getInstanceByName("testmodel")),                              false, "");        bobProfile = new Profile(pm, "bob", "pass",                                 new HashMap(), new HashMap(), new HashMap());        bobProfile.saveQuery("query1", sq);        bobProfile.saveBag("bag1", bag);        bobProfile.saveTemplate("template", template);        query = new PathQuery(Model.getInstanceByName("testmodel"));        bag = new InterMinePrimitiveBag();        sq = new SavedQuery("query1", date, query);        InterMineBag otherBag = new InterMinePrimitiveBag();        bag.add("some value");        otherBag.add(new Integer(123));        InterMineIdBag objectBag = new InterMineIdBag();        // employees and managers        objectBag.add(10);        objectBag.add(11);        objectBag.add(12);        // a department - this will cause the department with ID 6 to be add to the Item XML output        // and will also implicitly add the Company of this department to the output because the        // primary key of the Department includes the company reference        objectBag.add(6);        template = new TemplateQuery("template", "some desc",                                     new PathQuery(Model.getInstanceByName("testmodel")), true,                                     "some_keyword");        sallyProfile = new Profile(pm, "sally", "sally_pass",                                   new HashMap(), new HashMap(), new HashMap());        sallyProfile.saveQuery("query1", sq);        sallyProfile.saveBag("sally_bag1", bag);        sallyProfile.saveBag("sally_bag2", otherBag);        sallyProfile.saveBag("sally_bag3", objectBag);        sallyProfile.saveTemplate("template", template);    }