Package webapp.model

Examples of webapp.model.Resume


    private static Resume R1, R2, R3;

    @BeforeClass
    public static void beforeClass() {
        R1 = new Resume(UUID.randomUUID().toString(), "fullName1", "homePage1", "location1");
        R1.addContact(ContactType.MAIL, "mail1@ya.ru");
        R1.addContact(ContactType.PHONE, "11111");

/*
        R1.addSection(SectionType.ACHIEVEMENT, "Achivment11", "Achivment12");
        R1.addSection(SectionType.OBJECTIVE, "Objective1");
        R1.addSection(SectionType.EXPERIENCE,
                new Organization("Organization11", null,
                        new Period(2005, Calendar.JANUARY, 2008, Calendar.DECEMBER, "position1", "content1"),
                        new Period(2001, Calendar.MARCH, 2005, Calendar.JANUARY,"position2", "content2")),
                new Organization("Organization12", "Url11"));
*/

        R2 = new Resume(UUID.randomUUID().toString(), "fullName2", null, null);
        R2.addContact(ContactType.SKYPE, "skype2");
        R2.addContact(ContactType.PHONE, "22222");

        R3 = new Resume(UUID.randomUUID().toString(), "fullName3", "homePage3", null);
    }
View Full Code Here


        storage.save(R1);
    }

    @Test(expected = WebAppException.class)
    public void testUpdateMissed() throws Exception {
        Resume resume = new Resume("dummy", "fullName_U1", "homePage_U1", "location_U1");
        storage.update(resume);
    }
View Full Code Here

        storage.update(resume);
    }

    @Test
    public void testUpdate() throws Exception {
        Resume resume = new Resume(R2.getUuid(), "fullName_U2", "homePage_U2", "location_U2");
        storage.update(resume);
        Resume loaded = storage.load(R2.getUuid());
        Assert.assertEquals(resume, loaded);
    }
View Full Code Here

                    @Override
                    public Resume execute(PreparedStatement st) throws SQLException {
                        st.setString(1, uuid);
                        try (ResultSet rs = st.executeQuery()) {
                            if (rs.next()) {
                                Resume resume = new Resume(uuid, rs.getString("full_name"), rs.getString("home_page"), rs.getString("location"));
                                addContact(rs, resume);
                                while (rs.next()) {
                                    addContact(rs, resume);
                                }
                                return resume;
View Full Code Here

        return read(file);
    }

    protected Resume read(File file) {
        try {
            Resume r = doRead(new FileInputStream(file));
            r.setUuid(file.getName());
            return r;
        } catch (IOException e) {
            throw new WebAppException("Couldn't read file " + file.getAbsolutePath(), e);
        }
    }
View Full Code Here

                    public Collection<Resume> execute(PreparedStatement st) throws SQLException {
                        ResultSet rs = st.executeQuery();
                        Map<String, Resume> map = new HashMap<>();
                        while (rs.next()) {
                            String uuid = rs.getString("uuid");
                            Resume resume = map.get(uuid);
                            if (resume == null) {
                                resume = new Resume(uuid, rs.getString("full_name"), rs.getString("home_page"), rs.getString("location"));
                                map.put(uuid, resume);
                            }
                            addContact(rs, resume);
                        }
                        return map.values();
View Full Code Here

TOP

Related Classes of webapp.model.Resume

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.