Package com.totalchange.jizz.data.entity

Examples of com.totalchange.jizz.data.entity.JizzDj


        JizzStation mockStation = new JizzStation();
        mockStation.setName("Test Station");
        mockStation.setUrl("http://test.jizz.com/test/");

        JizzDj mockDj = new JizzDj();
        mockDj.setStation(mockStation);
        mockDj.setName("DJ Teste");
        mockDj.setEmail("test@test.com");

        for (Locale locale : Locale.getAvailableLocales()) {
            JizzEmailResponse response = renderer.generateInviteEmail(locale,
                    mockStation, mockDj, "newbie@test.com");
View Full Code Here


        JizzEmailVelocityRenderer renderer = new JizzEmailVelocityRenderer();

        JizzStation mockStation = new JizzStation();
        mockStation.setName("Test Station");

        JizzDj mockDj = new JizzDj();
        mockDj.setStation(mockStation);
        mockDj.setName("DJ Teste");
        mockDj.setEmail("test@test.com");

        JizzSong mockSong = new JizzSong();
        mockSong.setStation(mockStation);
        mockSong.setDj(mockDj);
        mockSong.setArtist("Spittle Donkey");
View Full Code Here

        JizzStation mockStation = new JizzStation();
        mockStation.setName("Test Station");
        mockStation.setUrl("http://www.jizz.com/");

        JizzDj mockDj = new JizzDj();
        mockDj.setStation(mockStation);
        mockDj.setName("DJ Teste");
        mockDj.setEmail("test@test.com");

        JizzBroadcast mockBroadcast = new JizzBroadcast();
        mockBroadcast.setStation(mockStation);
        mockBroadcast.setEstimatedStart(new Date());
View Full Code Here

        JizzStation mockStation = new JizzStation();
        mockStation.setName("Test Station");
        mockStation.setUrl("http://www.jizz.com/");

        JizzDj mockDj = new JizzDj();
        mockDj.setStation(mockStation);
        mockDj.setName("DJ Teste");
        mockDj.setEmail("test@test.com");

        JizzBroadcast mockBroadcast = new JizzBroadcast();
        mockBroadcast.setStation(mockStation);
        mockBroadcast.setEstimatedStart(new Date());
View Full Code Here

        JizzStation mockStation = new JizzStation();
        mockStation.setName("Test Station");
        mockStation.setUrl("http://www.jizz.com/");

        JizzDj mockDj = new JizzDj();
        mockDj.setStation(mockStation);
        mockDj.setName("DJ Teste");
        mockDj.setEmail("test@test.com");

        for (Locale locale : Locale.getAvailableLocales()) {
            try {
                if (true) {
                    throw new RuntimeException("Forced exception",
View Full Code Here

    @Override
    public String executeAction(HttpServletRequest request,
            List<FileItem> sessionFiles) throws UploadActionException {
        logger.trace("#executeAction(HttpServletRequest, List<FileItem>), "
                + "first up grabbing the current DJ");
        JizzDj dj = jizzDjServices.getCurrentDj();

        logger.trace("Grabbing the next braodcast");
        JizzBroadcast broadcast = jizzBroadcastServices.getNextBroadcast(dj
                .getStation());

        for (FileItem fileItem : sessionFiles) {
            if (!(fileItem instanceof JizzFileItem)) {
                logger.error("Somehow got a non-JizzFileItem instance");
                throw new UploadActionException("Only JizzFileItem's "
                        + "supported");
            }

            JizzFileItem jizzFileItem = (JizzFileItem) fileItem;

            logger.trace("Uploading song using blob {}", jizzFileItem.getBlob());
            jizzSongServices.uploadSong(dj.getStation(), dj, broadcast,
                    jizzFileItem.getBlob());
        }

        // This is as per what we're told to do by GWT Upload
        logger.trace("Removing session file items");
View Full Code Here

            throw new FatalTaskException("Cannot execute sending of song "
                    + "reminder message: Broadcast with ID " + broadcastId
                    + " could not be found");
        }

        JizzDj dj = jizzDjServices.findDjById(djId);
        if (dj == null) {
            throw new FatalTaskException("Cannot execute sending of song "
                    + "reminder message: DJ with ID " + djId
                    + " could not be found");
        }
View Full Code Here

                    }
                });

        replayAll();

        JizzDj jizzDj = jizzDjServices.getCurrentDj();
        assertNotNull(jizzDj);
        assertEquals(mockStation, jizzDj.getStation());
        assertEquals("Trevor McDonald", jizzDj.getLogins().iterator().next()
                .getLoginName());

        verifyAll();
    }
View Full Code Here

        verifyAll();
    }

    @Test
    public void testGetCurrentDj() {
        JizzDj mockDj = new JizzDj();

        expect(mockIdentityManager.getName()).andReturn("Trevor McDonald");
        expect(mockJizzDjDao.findDjByLoginName("Trevor McDonald")).andReturn(
                mockDj);

        replayAll();

        JizzDj jizzDj = jizzDjServices.getCurrentDj();
        assertEquals(mockDj, jizzDj);

        verifyAll();
    }
View Full Code Here

    @Test
    public void testIsInRole() {
        JizzDjRole mockRole = new JizzDjRole();
        mockRole.setRoleName(JizzDjRole.Roles.Administrator.name());

        JizzDj mockDj = new JizzDj();

        // Should handle null roles
        assertFalse(jizzDjServices.isInRole(mockDj,
                JizzDjRole.Roles.Administrator));

        mockDj.setRoles(new HashSet<JizzDjRole>());

        // Should handle empty roles
        assertFalse(jizzDjServices.isInRole(mockDj,
                JizzDjRole.Roles.Administrator));

        mockDj.getRoles().add(mockRole);
        assertTrue(jizzDjServices.isInRole(mockDj,
                JizzDjRole.Roles.Administrator));
    }
View Full Code Here

TOP

Related Classes of com.totalchange.jizz.data.entity.JizzDj

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.