Examples of JizzStation


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

        assertContainsSongs(songsB2D2, new int[] { songB2D2.getId() });
    }

    @Test
    public void testDeleteSong() {
        JizzStation station = JizzStationJpaDaoTest
                .createDefaultStation(jizzStationDao);

        JizzBroadcast broadcast1 = newBroadcast(station);

        JizzDj dj1 = newDj(station);
View Full Code Here

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

    @Test
    public void testWithoutMetadata() throws IOException {
        int bitRate = 160;

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

        ShoutcastStreamer streamer = new ShoutcastStreamer(mockStation, bitRate);

        List<BroadcastStreamer.Header> headers = new ArrayList<>();
        headers.add(new Header("icy-notice1", "<BR>This stream requires "
                + "<a href=\"http://www.winamp.com/\">Winamp</a><BR>", true));

        // Look up version from META-INF/manifest
        headers.add(new Header("icy-notice2", "SHOUTcast Distributed Network "
                + "Audio Server/jizz v1.0.0-SNAPSHOT<BR>", true));

        headers.add(new Header("icy-name", mockStation.getName(), true));
        headers.add(new Header("icy-genre", "Various", true));
        headers.add(new Header("icy-url", mockStation.getUrl(), true));
        headers.add(new Header("Content-Type", "audio/mpeg", true));
        headers.add(new Header("icy-pub", Integer.valueOf(1), true));
        headers.add(new Header("icy-br", bitRate, true));

        assertArrayEquals(headers.toArray(), streamer.getResponseHeaders()
View Full Code Here

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

    @Test
    public void testWithMetadata() throws IOException {
        int bitRate = 192;

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

        ShoutcastStreamer streamer = new ShoutcastStreamer(mockStation, bitRate);

        Vector<String> headerValues = new Vector<>();
        headerValues.add("true");
        streamer.setRequestHeader("icy-metadata", headerValues.elements());

        List<BroadcastStreamer.Header> headers = new ArrayList<>();
        headers.add(new Header("icy-notice1", "<BR>This stream requires "
                + "<a href=\"http://www.winamp.com/\">Winamp</a><BR>", true));

        // Look up version from META-INF/manifest
        headers.add(new Header("icy-notice2", "SHOUTcast Distributed Network "
                + "Audio Server/jizz v1.0.0-SNAPSHOT<BR>", true));

        headers.add(new Header("icy-name", mockStation.getName(), true));
        headers.add(new Header("icy-genre", "Various", true));
        headers.add(new Header("icy-url", mockStation.getUrl(), true));
        headers.add(new Header("Content-Type", "audio/mpeg", true));
        headers.add(new Header("icy-pub", Integer.valueOf(1), true));
        headers.add(new Header("icy-br", bitRate, true));
        headers.add(new Header("icy-metaint", 8192, true));
View Full Code Here

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

    @Test
    public void testGenerateConfirmAddressEmail() {
        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");
View Full Code Here

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

    @Test
    public void testGenerateInviteEmail() {
        JizzEmailVelocityRenderer renderer = new JizzEmailVelocityRenderer();

        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");
View Full Code Here

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

    @Test
    public void testGenerateUnsupportedSongTypeEmail() {
        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");
View Full Code Here

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

    @Test
    public void testGenerateNewBroadcastEmail() {
        JizzEmailVelocityRenderer renderer = new JizzEmailVelocityRenderer();

        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");
View Full Code Here

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

    @Test
    public void testGenerateSongReminderEmail() {
        JizzEmailVelocityRenderer renderer = new JizzEmailVelocityRenderer();

        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");
View Full Code Here

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

    @Test
    public void testGenerateErrorEmail() {
        JizzEmailVelocityRenderer renderer = new JizzEmailVelocityRenderer();

        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");
View Full Code Here

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

            throws ServletException, IOException {
        logger.debug("New request");

        // In the future may make this multi-tenanted and make it possible to
        // specify which station to use. For now just using the default.
        JizzStation station = jizzStationDao.getPrimaryStation();
        if (station == null) {
            throw new ServletException("Jizz needs to be initialised");
        }

        // Find the current broadcast
        JizzBroadcast broadcast = jizzBroadcastServices
                .getNextBroadcast(station);

        // If the current broadcast isn't finalised yet then need to throw an
        // error
        if (!broadcast.isFinalised()) {
            String msg = Messages.getMessage(station.getLocale(),
                    MSG_ERR_BROADCAST_NOT_FINALISED);

            DateFormat df = DateFormat.getDateInstance(DateFormat.LONG,
                    JizzServiceUtils.forLanguageTag(station.getLocale()));
            df.setTimeZone(station.getTimeZone());
            msg = MessageFormat.format(msg,
                    df.format(broadcast.getEstimatedStart()));

            logger.debug("Returning SC_NOT_FOUND with message {}", msg);
            response.sendError(HttpServletResponse.SC_NOT_FOUND, msg);
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.