Index: lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/AttachmentTest.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/Attic/AttachmentTest.java,v diff -u -r1.1 -r1.2 --- lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/AttachmentTest.java 17 Jun 2005 04:41:04 -0000 1.1 +++ lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/AttachmentTest.java 5 Jul 2005 02:46:13 -0000 1.2 @@ -23,7 +23,7 @@ //Populate an Attachment entity for test purposes AttachmentDao attachmentDao = (AttachmentDao) GenericObjectFactoryImpl.getInstance().lookup(AttachmentDao.class); Attachment instructions = new Attachment(); - instructions.setData("instructions byte array".getBytes()); + instructions.setName("instructions"); instructions.setType(false); attachmentDao.saveOrUpdate(instructions); @@ -34,7 +34,7 @@ //load Attachment reloaded = (Attachment) dao.getById(instructions.getId()); - assertEquals("persisted and reloaded byte array should be equal", "instructions byte array", new String(instructions.getData())); + assertEquals("persisted and reloaded byte array should be equal", "instructions", instructions.getName()); //find List values = dao.findByNamedQuery("allAttachments"); Index: lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/ForumTest.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/Attic/ForumTest.java,v diff -u -r1.2 -r1.3 --- lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/ForumTest.java 29 Jun 2005 06:33:38 -0000 1.2 +++ lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/persistence/ForumTest.java 5 Jul 2005 02:46:13 -0000 1.3 @@ -35,7 +35,7 @@ AttachmentDao attachmentDao = (AttachmentDao) GenericObjectFactoryImpl.getInstance().lookup(AttachmentDao.class); Attachment instructions = new Attachment(); - instructions.setData("instructions byte array".getBytes()); + instructions.setName("instructions"); instructions.setType(true); attachments.add(instructions); attachmentDao.saveOrUpdate(instructions); @@ -79,7 +79,7 @@ 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.getData()), new String(child[0].getData())); + 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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/Attic/ForumManagerImplTest.java,v diff -u -r1.3 -r1.4 --- lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/ForumManagerImplTest.java 29 Jun 2005 06:33:38 -0000 1.3 +++ lams_tool_forum/test/java/org/lamsfoundation/lams/tool/forum/service/ForumManagerImplTest.java 5 Jul 2005 02:46:13 -0000 1.4 @@ -28,7 +28,7 @@ public void testCreateAndDeleteForum() throws PersistenceException { Map attachments = new HashMap(); Attachment attachment = new Attachment(); - attachment.setData("test data".getBytes()); + attachment.setName("test"); attachment.setType(Attachment.TYPE_ONLINE); attachments.put("test file", attachment); @@ -46,7 +46,7 @@ Set reloadedAttachments = reloadedForum.getAttachments(); Attachment reloadedAttachment = (Attachment) (reloadedAttachments.toArray(new Attachment[0]))[0]; assertEquals(reloadedAttachment.getType(), attachment.getType()); - assertEquals(new String(reloadedAttachment.getData()), new String(attachment.getData())); + assertEquals(new String(reloadedAttachment.getName()), new String(attachment.getName())); assertTrue("Forum should contains attachment", reloadedAttachments.contains(attachment));