Package org.sete.domain

Examples of org.sete.domain.Attachment


    public void testLoadAllProjectFilesForOneFileOnly(){
        int toTestID = 2;
        ScienceProject p = new ScienceProject();
        Set<Attachment> f  = new HashSet<Attachment>();
        p.setForms(f);
        Attachment a = new Attachment();
        a.setId(toTestID);
        p.getForms().add(a);
        p.setId(toTestID);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
        EasyMock.expect(mockScienceProjectDao.getAllScienceProjects()).andReturn(l);
View Full Code Here


        int toTestID = 2;
        ScienceProject p = new ScienceProject();
        p.setId(toTestID);
        Set<Attachment> f  = new HashSet<Attachment>();
        p.setForms(f);
        Attachment a = new Attachment();
        a.setId(1);
        p.getForms().add(a);
        Attachment b = new Attachment();
        b.setId(2);
        p.getForms().add(b);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
        EasyMock.expect(mockScienceProjectDao.getAllScienceProjects()).andReturn(l);
        EasyMock.replay(mockScienceProjectDao);
View Full Code Here

        int formID = 5;
        String name = "form";
        ScienceProject p = new ScienceProject();
        p.setId(toTestID);
        Set<Attachment> f  = new HashSet<Attachment>();
        Attachment a = new Attachment();
        a.setId(formID);
        a.setName(name);
        f.add(a);
        p.setForms(f);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
        EasyMock.expect(mockScienceProjectDao.getAllScienceProjects()).andReturn(l);
View Full Code Here

        int badformID = 9;
        String badname = "badform";
        ScienceProject p = new ScienceProject();
        p.setId(toTestID);
        Set<Attachment> f  = new HashSet<Attachment>();
        Attachment a = new Attachment();
        a.setId(formID);
        a.setName(name);
        f.add(a);
        Attachment bada = new Attachment();
        bada.setId(badformID);
        bada.setName(badname);
        f.add(bada);
        p.setForms(f);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
        EasyMock.expect(mockScienceProjectDao.getAllScienceProjects()).andReturn(l);
View Full Code Here

  //derive the AttachmentType
  String key = ufvo.getMyFileTypeId();
  AttachmentType type = TypeUtil.forKey(AttachmentType.class,key )
 
  //create a new Attachment for insertion.
  Attachment att = new Attachment();
  att.setName(ufvo.getMyFile().getFileName());
  att.setDescription(type.getDescription());
  att.setType(type);
  try {
    att.setContents(ufvo.getMyFile().getFileData());
  } catch (IOException e) {
    e.printStackTrace();
  }
 
  //determine the student uploading the file
View Full Code Here

    public void testLoadAllProjectFilesForOneFileOnly(){
        int toTestID = 2;
        ScienceProject p = new ScienceProject();
        Set<Attachment> f  = new HashSet<Attachment>();
        p.setForms(f);
        Attachment a = new Attachment();
        a.setId(toTestID);
        p.getForms().add(a);
        p.setId(toTestID);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
        EasyMock.expect(mockScienceProjectDao.getAllScienceProjects()).andReturn(l);
View Full Code Here

        int toTestID = 2;
        ScienceProject p = new ScienceProject();
        p.setId(toTestID);
        Set<Attachment> f  = new HashSet<Attachment>();
        p.setForms(f);
        Attachment a = new Attachment();
        a.setId(1);
        p.getForms().add(a);
        Attachment b = new Attachment();
        b.setId(2);
        p.getForms().add(b);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
        EasyMock.expect(mockScienceProjectDao.getAllScienceProjects()).andReturn(l);
        EasyMock.replay(mockScienceProjectDao);
View Full Code Here

        int formID = 5;
        String name = "form";
        ScienceProject p = new ScienceProject();
        p.setId(proejctID);
        Set<Attachment> f  = new HashSet<Attachment>();
        Attachment a = new Attachment();
        a.setId(formID);
        a.setName(name);
        f.add(a);
        p.setForms(f);
        primeProjectWithStudentandSponsor(p);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
View Full Code Here

        int formID = 5;
        String name = "form";
        ScienceProject p = new ScienceProject();
        p.setId(toTestID);
        Set<Attachment> f  = new HashSet<Attachment>();
        Attachment a = new Attachment();
        a.setId(formID);
        a.setName(name);
        f.add(a);
        p.setForms(f);
        primeProjectWithStudentandSponsor(p);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
View Full Code Here

        String badname = "badform";
        ScienceProject p = new ScienceProject();
        p.setId(toTestID);
        primeProjectWithStudentandSponsor(p);
        Set<Attachment> f  = new HashSet<Attachment>();
        Attachment a = new Attachment();
        a.setId(formID);
        a.setName(name);
        f.add(a);
        Attachment bada = new Attachment();
        bada.setId(badformID);
        bada.setName(badname);
        f.add(bada);
        p.setForms(f);
        List<ScienceProject> l = new ArrayList<ScienceProject>();
        l.add(p);
        EasyMock.expect(mockScienceProjectDao.getAllScienceProjects()).andReturn(l);
View Full Code Here

TOP

Related Classes of org.sete.domain.Attachment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.