Package org.cedj.geekseek.domain.conference.model

Examples of org.cedj.geekseek.domain.conference.model.Conference


    @Test
    @ShouldMatchDataSet(value = { "conference.yml", "session.yml" }, excludeColumns = { "*id" })
    public void shouldBeAbleToCreateConferenceWithSession() {

        Conference conference = createConference();
        conference.addSession(createSession());

        repository.store(conference);
    }
View Full Code Here


    @Test
    @UsingDataSet("conference.yml")
    @ShouldMatchDataSet(value = { "conference.yml", "session.yml" }, excludeColumns = { "*id" })
    public void shouldBeAbleToAddSessionToConference() {

        Conference conference = repository.get("CA");
        conference.addSession(createSession());

        repository.store(conference);
    }
View Full Code Here

    @Test
    @UsingDataSet("conference.yml")
    @ShouldMatchDataSet("conference_empty.yml")
    public void shouldBeAbleToRemoveConference() {

        Conference conference = repository.get("CA");

        repository.remove(conference);
        Assert.assertTrue(removedEventFired);
    }
View Full Code Here

    @Test
    @UsingDataSet({ "conference.yml", "session.yml" })
    @ShouldMatchDataSet({ "conference.yml", "session_empty.yml" })
    public void shouldBeAbleToRemoveConferenceWithSession() {

        Conference conference = repository.get("CA");
        Session session = conference.getSessions().toArray(new Session[0])[0];
        conference.removeSession(session);

        repository.store(conference);
    }
View Full Code Here

    @Test
    @UsingDataSet("conference.yml")
    @ShouldMatchDataSet(value = { "conference_updated.yml" })
    public void shouldBeAbleToChangeConference() {

        Conference conference = repository.get("CA");
        conference.setName("UPDATED");

        repository.store(conference);
    }
View Full Code Here

    @Test
    @UsingDataSet({ "conference.yml", "session.yml" })
    @ShouldMatchDataSet(value = { "conference.yml", "session_updated.yml" })
    public void shouldBeAbleToChangeSession() {

        Conference conference = repository.get("CA");
        conference.getSessions().toArray(new Session[0])[0].setTitle("UPDATED");

        repository.store(conference);
    }
View Full Code Here

        return session;
    }

    @Override
    public void remove(Session entity) {
        Conference conf = conferenceRepository.getConferenceBySessionId(entity.getId());
        if(conf != null) {
            conf.removeSession(entity);
        }
        sessions.remove(entity);
    }
View Full Code Here

        return "conference";
    }

    @Override
    protected Conference createDomainObject() {
        return new Conference("Name", "TagLine", new Duration(new Date(), new Date()));
    }
View Full Code Here

        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }

    public static Conference createConference() {
        Conference conference = new Conference(
            "Devoxx Belgium 2013",
            "We Code In Peace",
            new Duration(toDate(2013, 11, 11), toDate(2013, 11, 15)));
        return conference;
    }
View Full Code Here

    @POST
    @Path("/{c_id}/session")
    @Consumes({ BASE_JSON_MEDIA_TYPE, BASE_XML_MEDIA_TYPE })
    public Response createSession(@PathParam("c_id") String conferenceId, SessionRepresentation sessionRepresentation) {
        Conference conference = getRepository().get(conferenceId);
        if (conference == null) {
            return Response.status(Status.BAD_REQUEST).build(); // TODO: Need Business Exception type to explain why?
        }

        Session session = sessionConverter.to(getUriInfo(), sessionRepresentation);
        conference.addSession(session);
        getRepository().store(conference);

        return Response.created(
            UriBuilder.fromResource(
                SessionResource.class).segment("{id}")
View Full Code Here

TOP

Related Classes of org.cedj.geekseek.domain.conference.model.Conference

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.