Examples of JizzStation


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

    public void testFindDjByLoginName() {
        JizzDj dj = jizzDjJpaDao.findDjByLoginName("DJ@TEST");
        assertNull("DJ shouldn't exist yet", dj);

        // Need a station in otherwise empty database to use on DJ
        JizzStation station = JizzStationJpaDaoTest
                .createDefaultStation(jizzStationJpaDao);
        createDefaultDj(jizzDjJpaDao, station);

        dj = jizzDjJpaDao.findDjByLoginName("DJ@TEST");
        assertNotNull(dj);
View Full Code Here

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

        }
    }

    @Test
    public void testFindDjsByStation() {
        JizzStation station1 = JizzStationJpaDaoTest
                .createDefaultStation(jizzStationJpaDao);
        JizzStation station2 = JizzStationJpaDaoTest
                .createDefaultStation(jizzStationJpaDao);
        JizzDj dj1 = createDefaultDj(jizzDjJpaDao, station1);
        JizzDj dj2 = createDefaultDj(jizzDjJpaDao, station1);
        JizzDj dj3 = createDefaultDj(jizzDjJpaDao, station1);
        JizzDj dj4 = createDefaultDj(jizzDjJpaDao, station2);
View Full Code Here

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

        assertContains(station2Djs, dj5);
    }

    @Test
    public void testCreateOrUpdateDj() {
        JizzStation station = JizzStationJpaDaoTest
                .createDefaultStation(jizzStationJpaDao);
        createDefaultDj(jizzDjJpaDao, station);

        JizzDj dj = jizzDjJpaDao.findDjByLoginName("DJ@TEST");
        assertEquals("Test DJ", dj.getName());
View Full Code Here

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

    public SetSettingsResult execute(SetSettingsAction action,
            ExecutionContext context) throws DispatchException {
        logger.trace("Saving server settings {}", action);

        ServerSettings settings = action.getSettings();
        JizzStation station = jizzStationDao.getPrimaryStation();

        boolean isNewInstall = false;
        if (station == null) {
            logger.debug("Creating new station");
            station = new JizzStation();
            station.setKey(UUID.randomUUID().toString());
            isNewInstall = true;
        }

        station.setName(settings.getStationName());
        station.setLocale(settings.getStationLocale());
        station.setUrl(settings.getStationUrl());
        station.setBroadcastSchedule(settings.getBroadcastSchedule());
        station.setSmtpServerHost(settings.getSmtpServerHost());
        station.setSmtpServerPort(settings.getSmtpServerPort());
        station = jizzStationDao.createOrUpdateStation(station);

        if (isNewInstall) {
            logger.info("New install - making current user an admin of this "
                    + "new station");
View Full Code Here

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

            throws DispatchException {
        logger.trace("Jizz Home execution underway");
        HomeResult result = new HomeResult();

        // Look for the station - if nothing there then this is a new install
        JizzStation station = jizzStationDao.getPrimaryStation();
        if (station == null) {
            result.setNewInstall(true);
            logger.info("New install detected by virtue of no primary "
                    + "station.  Returning result {}", result);
            return result;
        }
        result.setStationName(station.getName());

        // Look for the DJ based on their login name
        JizzDj dj = jizzDjServices.getCurrentDj();
        result.setName(dj.getName());
        result.setEmail(dj.getEmail());
View Full Code Here

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

        verifyAll();
    }

    @Test
    public void testGetNewCurrentDj() {
        JizzStation mockStation = new JizzStation();

        expect(mockIdentityManager.getName()).andReturn("Trevor McDonald");
        expect(mockJizzDjDao.findDjByLoginName("Trevor McDonald")).andReturn(
                null);
        expect(mockJizzStationDao.getPrimaryStation()).andReturn(mockStation);
View Full Code Here

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

                mockJizzDjDao, mockJizzEmailServices, mockJizzTaskQueue);
    }

    @Test
    public void testGetNextBroadcastCronParsing() {
        JizzStation mockStation = new JizzStation();
        mockStation.setBroadcastSchedule("30 17 * * Fri");
        mockStation.setNewBroadcastMessageSchedule("30 10 * * Mon");

        expect(mockJizzBroadcastDao.findNearestBroadcast(mockStation))
                .andReturn(null);
        expect(
                mockJizzBroadcastDao
View Full Code Here

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

        verifyAll();
    }

    @Test
    public void testSendNewBroadcastMessages() {
        JizzStation mockStation = new JizzStation();
        mockStation.setSongReminderMessageSchedule("30 10 * * Wed,Thu");

        JizzBroadcast mockBroadcast = new JizzBroadcast();
        JizzDj mockDj1 = new JizzDj();
        JizzDj mockDj2 = new JizzDj();
        JizzDj mockDj3 = new JizzDj();
View Full Code Here

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

        verifyAll();
    }

    @Test
    public void testInvalidBroadcastFinaleCron() {
        JizzStation mockStation = new JizzStation();
        mockStation.setLocale("EN");
        mockStation.setBroadcastSchedule("No likey, no lighty");

        expect(mockJizzBroadcastDao.findNearestBroadcast(mockStation))
                .andReturn(null);
        mockJizzErrorServices.reportErrorToAdmins(eq(mockStation), eq("The "
                + "cron trigger 'No likey, no lighty' is not valid, can't "
View Full Code Here

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

        verifyAll();
    }

    @Test
    public void testInvalidNewBroadcastMessagesCron() {
        JizzStation mockStation = new JizzStation();
        mockStation.setLocale("EN");
        mockStation.setBroadcastSchedule("30 17 * * Fri");
        mockStation.setNewBroadcastMessageSchedule("Hammertime");

        expect(mockJizzBroadcastDao.findNearestBroadcast(mockStation))
                .andReturn(null);
        expect(
                mockJizzBroadcastDao
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.