Index: lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/AttachmentTest.java =================================================================== diff -u -raae2aa32e2608e2c0ea3cef109a4c5991f6ed0ae -r5edaf254d29d3d54d418c18ffff0ffe84f7e8572 --- lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/AttachmentTest.java (.../AttachmentTest.java) (revision aae2aa32e2608e2c0ea3cef109a4c5991f6ed0ae) +++ lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/AttachmentTest.java (.../AttachmentTest.java) (revision 5edaf254d29d3d54d418c18ffff0ffe84f7e8572) @@ -23,8 +23,6 @@ //Populate an Attachment entity for test purposes AttachmentDao attachmentDao = (AttachmentDao) GenericObjectFactoryImpl.getInstance().lookup(AttachmentDao.class); Attachment instructions = new Attachment(); - instructions.setName("instructions"); - instructions.setType(false); attachmentDao.saveOrUpdate(instructions); AttachmentDao dao = (AttachmentDao) GenericObjectFactoryImpl.getInstance().lookup(AttachmentDao.class); @@ -34,8 +32,6 @@ //load Attachment reloaded = (Attachment) dao.getById(instructions.getId()); - assertEquals("persisted and reloaded byte array should be equal", "instructions", instructions.getName()); - //find List values = dao.findByNamedQuery("allAttachments"); assertTrue("find all result not containing object", values.contains(instructions)); Index: lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/ForumTest.java =================================================================== diff -u -raae2aa32e2608e2c0ea3cef109a4c5991f6ed0ae -r5edaf254d29d3d54d418c18ffff0ffe84f7e8572 --- lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/ForumTest.java (.../ForumTest.java) (revision aae2aa32e2608e2c0ea3cef109a4c5991f6ed0ae) +++ lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/ForumTest.java (.../ForumTest.java) (revision 5edaf254d29d3d54d418c18ffff0ffe84f7e8572) @@ -35,24 +35,10 @@ AttachmentDao attachmentDao = (AttachmentDao) GenericObjectFactoryImpl.getInstance().lookup(AttachmentDao.class); Attachment instructions = new Attachment(); - instructions.setName("instructions"); - instructions.setType(true); + //instructions.setType(true); attachments.add(instructions); attachmentDao.saveOrUpdate(instructions); - /* - Attachment onLineInstructions = new Attachment(); - onLineInstructions.setData("on line instructions byte array".getBytes()); - instructions.setType("ONLINEINSTRUCTIONS"); - attachments.add(onLineInstructions); - attachmentDao.saveOrUpdate(onLineInstructions); - - Attachment offLineInstructions = new Attachment(); - offLineInstructions.setData("off line instructions byte array".getBytes()); - instructions.setType("OFFLINEINSTRUCTIONS"); - attachments.add(offLineInstructions); - attachmentDao.saveOrUpdate(offLineInstructions);*/ - entity.setAttachments(attachments); //save @@ -78,8 +64,6 @@ assertTrue("reloaded set does not contain instructions attachment", reloadedSet.contains(instructions)); Attachment[] child = (Attachment[]) reloadedSet.toArray(new Attachment[0]); - assertEquals("attachments type should be same", instructions.getType(), child[0].getType()); - assertEquals("attachment bytes should be the same", new String(instructions.getName()), new String(child[0].getName())); //find List values = dao.findByNamedQuery("allForums"); Index: lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/ForumManagerImplTest.java =================================================================== diff -u -raae2aa32e2608e2c0ea3cef109a4c5991f6ed0ae -r5edaf254d29d3d54d418c18ffff0ffe84f7e8572 --- lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/ForumManagerImplTest.java (.../ForumManagerImplTest.java) (revision aae2aa32e2608e2c0ea3cef109a4c5991f6ed0ae) +++ lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/ForumManagerImplTest.java (.../ForumManagerImplTest.java) (revision 5edaf254d29d3d54d418c18ffff0ffe84f7e8572) @@ -28,8 +28,6 @@ public void testCreateAndDeleteForum() throws PersistenceException { Map attachments = new HashMap(); Attachment attachment = new Attachment(); - attachment.setName("test"); - attachment.setType(Attachment.TYPE_ONLINE); attachments.put("test file", attachment); Forum forum = forumManager.createForum(this.getForum("TEST", new Long("1002"), true, true, false, "TEST INSTRUCTIONS", "TEST ONLINEINSTRUCTIONS", "TEST OFFLINEINSTRUCTIONS"), attachments, null); @@ -45,9 +43,6 @@ assertEquals(reloadedForum.getOfflineInstructions(), "TEST OFFLINEINSTRUCTIONS"); Set reloadedAttachments = reloadedForum.getAttachments(); Attachment reloadedAttachment = (Attachment) (reloadedAttachments.toArray(new Attachment[0]))[0]; - assertEquals(reloadedAttachment.getType(), attachment.getType()); - assertEquals(new String(reloadedAttachment.getName()), new String(attachment.getName())); - assertTrue("Forum should contains attachment", reloadedAttachments.contains(attachment)); forumManager.deleteForum(forum.getId());