Package com.totalchange.jizz.data.entity

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


                    + "', isFormField '" + isFormField + "' and fileName '"
                    + fileName + "'");
        }

        logger.trace("Finding the current station");
        JizzStation station = jizzStationDao.getPrimaryStation();
        if (station == null) {
            // null = this instance of Jizz hasn't been set up yet - the admin
            // needs to go through the welcome to Jizz process
            logger.error("Cannot upload a song to an unitialised station");
            throw new IllegalStateException("Cannot upload a song to an "
View Full Code Here


    public GetSettingsResult execute(GetSettingsAction action,
            ExecutionContext context) throws DispatchException {
        logger.trace("Fetching server settings");
        ServerSettings settings;

        JizzStation station = jizzStationDao.getPrimaryStation();
        if (station == null) {
            settings = makeNewServerSettings();
        } else {
            settings = new ServerSettings();
            settings.setStationName(station.getName());
            settings.setStationLocale(station.getLocale());
            settings.setStationUrl(station.getUrl());
            settings.setBroadcastSchedule(station.getBroadcastSchedule());
            settings.setSmtpServerHost(station.getSmtpServerHost());
            settings.setSmtpServerPort(station.getSmtpServerPort());
        }

        GetSettingsResult result = new GetSettingsResult();
        result.setSettings(settings);
        logger.trace("Returning server settings {}", result);
View Full Code Here

        if (dj == null) {
            logger.debug("Creating new DJ with identity {}", loginName);

            dj = new JizzDj();

            JizzStation station = jizzStationDao.getPrimaryStation();
            if (station == null) {
                throw new RuntimeException("No primary station - a DJ cannot "
                        + "be created until Jizz has been initialised");
            }
            dj.setStation(station);

            // Set DJ's defaults
            dj.setLocale(station.getLocale());

            // Make up a new name for this DJ
            String djName = JizzDjNameMaker.getInstance().newNamePlease(
                    JizzServiceUtils.forLanguageTag(dj.getLocale()));
            dj.setName(djName);
View Full Code Here

        verifyAll();
    }
   
    @Test
    public void testExecute() throws DispatchException {
        JizzStation mockStation = new JizzStation();
        JizzDj mockDj = new JizzDj();
        mockDj.setName("DJ Pukka Pie");
       
        expect(mockJizzStationDao.getPrimaryStation()).andReturn(mockStation);
        expect(mockJizzDjServices.getCurrentDj()).andReturn(mockDj);
View Full Code Here

    }

    @Test
    public void testExecuteNewInstall() throws DispatchException {
        JizzDj mockDj = new JizzDj();
        JizzStation mockStation = new JizzStation();

        expect(mockJizzStationDao.getPrimaryStation()).andReturn(null);
        expect(
                mockJizzStationDao
                        .createOrUpdateStation(anyObject(JizzStation.class)))
View Full Code Here

        verifyAll();
    }

    @Test
    public void testExecute() throws DispatchException {
        JizzStation mockStation = new JizzStation();

        expect(mockJizzStationDao.getPrimaryStation()).andReturn(mockStation);
        expect(mockJizzStationDao.createOrUpdateStation(mockStation))
                .andReturn(mockStation);

        replayAll();

        SetSettingsAction action = new SetSettingsAction();
        ServerSettings mockSettings = new ServerSettings();
        mockSettings.setStationName("Awesome Station");
        mockSettings.setStationUrl("http://awesome/");
        mockSettings.setBroadcastSchedule("30 0 * * * Mon");
        action.setSettings(mockSettings);

        setSettingsHandler.execute(action, null);
        assertEquals(mockSettings.getStationName(), mockStation.getName());
        assertEquals(mockSettings.getStationUrl(), mockStation.getUrl());
        assertEquals(mockSettings.getBroadcastSchedule(),
                mockStation.getBroadcastSchedule());

        verifyAll();
    }
View Full Code Here

        verify(mockJizzStationDao);
    }

    @Test
    public void testExecute() throws DispatchException {
        JizzStation mockStation = new JizzStation();
        mockStation.setName("Station Awesome");
        mockStation.setBroadcastSchedule("0 * * * *");
        mockStation.setUrl("http://awesome/");

        expect(mockJizzStationDao.getPrimaryStation()).andReturn(mockStation);
        replay(mockJizzStationDao);

        GetSettingsResult result = getSettingsHandler.execute(
                new GetSettingsAction(), null);

        assertEquals(mockStation.getName(), result.getSettings()
                .getStationName());
        assertEquals(mockStation.getBroadcastSchedule(), result.getSettings()
                .getBroadcastSchedule());
        assertEquals(mockStation.getUrl(), result.getSettings().getStationUrl());

        verify(mockJizzStationDao);
    }
View Full Code Here

TOP

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

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.