Package com.dodo.blog.request

Examples of com.dodo.blog.request.ArticlesRequest


        private static final long serialVersionUID = 1L;

        @Override
        public List<Article> getRows( int firstRow, int maxRows, String orderBy, OrderDirection direction )
        {
            ArticlesRequest request = new ArticlesRequest( firstRow, maxRows );
            request.addSort( orderBy, direction );
            return articleService.getArticles( request );
        }
View Full Code Here


        private String tag;

        @Override
        public List<Article> getRows( int firstRow, int maxRows, String orderBy, OrderDirection direction )
        {
            ArticlesRequest request = new ArticlesRequest( firstRow, maxRows );

            request.addSort( orderBy, direction );
            request.setCategory( category );
            request.setTag( tag );
            request.setYear( year );
            request.setMonth( month );
            request.setDay( day );
            request.setPublished( true );

            return articleService.getArticles( request );
        }
View Full Code Here

        Article article = new Article();
        article.setCategory( category.getId() );
        articleService.saveArticle( article );

        ArticlesRequest request = new ArticlesRequest( -1, -1 );
        request.setCategory( "backend" );
        List<Article> articles = articleService.getArticles( request );
        Assert.assertEquals( Long.valueOf( 1 ), articles.get( 0 ).getCategory() );
    }
View Full Code Here

            article = new Article();
            article.setTag_2( tag.getId() );
            articleService.saveArticle( article );
        }

        ArticlesRequest request = new ArticlesRequest( -1, 20 );
        request.setTag( "google-app-engine" );
        List<Article> articles = articleService.getArticles( request );
        Assert.assertEquals( Long.valueOf( 1 ), articles.get( 0 ).getTag_2() );
        Assert.assertEquals( Long.valueOf( 1 ), articles.get( 1 ).getTag_1() );
    }
View Full Code Here

        Format format = new DecimalFormat( "00" );
        String year = Integer.valueOf( calendar.get( Calendar.YEAR ) ).toString();
        String month = format.format( calendar.get( Calendar.MONTH ) + 1 );
        String day = format.format( calendar.get( Calendar.DAY_OF_MONTH ) );

        ArticlesRequest request = new ArticlesRequest( -1, -1 );
        request.setYear( year );
        request.setMonth( month );
        request.setDay( day );

        List<Article> articles = articleService.getArticles( request );
        Assert.assertEquals( year, articles.get( 0 ).getYear() );
        Assert.assertEquals( month, articles.get( 0 ).getMonth() );
        Assert.assertEquals( day, articles.get( 0 ).getDay() );
View Full Code Here

TOP

Related Classes of com.dodo.blog.request.ArticlesRequest

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.