Examples of Article


Examples of pygmy.nntp.Article

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public void testArticle() throws IOException {
        Article article = NntpTestUtil.createArticle("test.eml");

        assertEquals( "1.0", article.getHeader().get("Mime-Version") );
        assertEquals( "<blkdu9$pd8$1@hood.uits.indiana.edu>", article.getMessageId() );
        assertEquals( "Re: Static inner classes", article.getSubject() );
        String[] newsgroups = { "comp.lang.java.programmer" };
        for( int i = 0; i < newsgroups.length; i++ ) {
            assertEquals( newsgroups[i], article.getNewsgroups()[i] );
        }
    }
View Full Code Here

Examples of pygmy.nntp.Article

    public static Article createArticle(String filename) throws IOException {
        File file = new File( System.getProperty("nntp.root"), filename );
        NntpInputStream is = null;
        try {
            is = new NntpInputStream( new FileInputStream( file ) );
            Article article = new Article( is );
            return article;
        } finally {
            if( is != null ) {
                is.close();
            }
View Full Code Here

Examples of pygmy.nntp.Article

    public void testAddArticle() throws Exception {
        System.out.println("NewsGroupTest.testAddArticle");
        assertEquals( 0, group.size() );

        Article article = addTestArticle();
        assertEquals( 1, group.size() );
        assertEquals( group.getFirstIndex(), group.getLastIndex() );
        assertEquals( group.getLastIndex(), article.getArticleNumber() );

        Article article2 = NntpTestUtil.createArticle("test.eml");
        article2.setMessageId(null);
        String oldPath2 = article2.getHeader().get("Path");
        group.addArticle( article2, "localhost" );
        assertEquals( 2, group.size() );
        assertTrue( "Assert that first and last indexes are different after adding two articles.", group.getFirstIndex() != group.getLastIndex() );
        assertEquals( "Assert the first article is the firstIndex", group.getFirstIndex(), article.getArticleNumber() );
        assertEquals( "Assert the last article is the last index", group.getLastIndex(), article2.getArticleNumber() );
        assertTrue( "Assert the old path is contained with the new path, and it doesn't start at index 0.", article2.getHeader().get("Path").indexOf(oldPath2) > 0 );
        assertTrue( "Assert the old path starts with localhost.", article2.getHeader().get("Path").startsWith("localhost") );
        assertNotNull( "Assert messsage ID is not NULL.", article2.getMessageId() );
        assertNotNull( "Assert Date-Received is not NULL", article2.getHeader().get("Date-Received") );
    }
View Full Code Here

Examples of pygmy.nntp.Article

        assertNotNull( "Assert messsage ID is not NULL.", article2.getMessageId() );
        assertNotNull( "Assert Date-Received is not NULL", article2.getHeader().get("Date-Received") );
    }

    private Article addTestArticle() throws IOException {
        Article article = NntpTestUtil.createArticle("test.eml");
        group.addArticle( article, "localhost" );
        return article;
    }
View Full Code Here

Examples of pygmy.nntp.Article

    }

    public void testGetMessage() throws Exception {
        System.out.println("NewsGroupTest.testGetMessage");

        Article article = addTestArticle();
        Article sameArticle = group.getMessage( article.getArticleNumber() );

        assertEquals( "Assert that their message IDs are the same.  Assume the rest is the same.", sameArticle.getMessageId(), article.getMessageId() );
        assertEquals( "Assert that their article numbers are the same.  Assume the rest is the same.", sameArticle.getArticleNumber(), article.getArticleNumber() );
    }
View Full Code Here

Examples of springblog.pojo.Article

  }
 
 
  @RequestMapping(value = {"/{articleID}"})
  public String viewArticle(@PathVariable int articleID, Model model) {
    Article article = articleManager.getArticleByID(articleID);
    if (null == article) {
      model.addAttribute("message", "No such article.");
      return "message";
    }
    model.addAttribute("article", article);
View Full Code Here

Examples of uk.co.jemos.podam.test.dto.docs.example.Article

  }

  @Test
  public void testArticleSetup() {

    Article pojo = factory.manufacturePojo(Article.class);
    validateArticle(pojo);
  }
View Full Code Here

Examples of wblog.domain.Article

            article = qr.query("select * from Article where id=?", new BeanHandler<Article>(Article.class), this.article.id);
            if (article == null) {
                return new ErrorResult(404);
            }
        } else {
            article = new Article();
        }
        return new TemplateResult(this);
    }
View Full Code Here

Examples of wblog.domain.Article

                new ResultSetHandler<List<Article>>() {
                    @Override
                    public List<Article> handle(ResultSet rs) throws SQLException {
                        List<Article> list = new ArrayList<Article>();
                        while (rs.next()) {
                            Article article = new Article();
                            article.id = rs.getInt("id");
                            article.title = rs.getString("title");
                            article.content = rs.getString("content");
                            article.postDate = rs.getTimestamp("postDate");
                            article.tags = rs.getString("tags");
View Full Code Here

Examples of welcome.shared.store.Article

        Label amountLabel;
        IntegerBox amountTB;
        Button orderBt;

        Iterator<Article> it = result.iterator();
        Article currentArticle;

        // construct a new Grid with correct size (we can t add a row
        // dynamically...

        for (int i = 0; it.hasNext(); i++) {

          currentArticle = it.next();
          nameLabel = new Label(currentArticle.getName());
          amountLabel = new Label(String.valueOf(currentArticle
              .getAmount()));

          amountTB = new IntegerBox();
          amountTB.setValue(0);
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.