Examples of NewsGroup


Examples of org.jnode.nntp.model.NewsGroup

    @Override
    public Collection<String> process(Collection<String> params, Long id, Long selectedArticleId, Auth auth) {

        String groupName = params.iterator().next();
        NewsGroup group = dataProvider.newsGroup(groupName, auth);
        if (group == null) {
            return responseNotFound();
        }

        Notifier.INSTANSE.notify(new GroupSelectedEvent(group));
View Full Code Here

Examples of org.objectweb.speedo.pobjects.inheritance.query.NewsGroup

 
    public void notContainsInheritanceABuilder() {
      PersistenceManager pm = pmf.getPersistenceManager();
      pm.currentTransaction().begin();
      //add newsgroup_0 -> [user_0and2]
      NewsGroup ng0 = new NewsGroup("newsgroup_0");
        Collection users = ng0.getUsers();
        users.add(commonUser);
        pm.makePersistent(ng0);
        //add newsgroup_1 -> [user_1]
        NewsGroup ng1 = new NewsGroup("newsgroup_1");
        users = ng1.getUsers();
        users.add(new GroupUser("user_1"));
        pm.makePersistent(ng1);
        pm.currentTransaction().commit();
        pm.close();
    }
View Full Code Here

Examples of org.objectweb.speedo.pobjects.inheritance.query.NewsGroup

   
    public void notContainsInheritanceBBuilder() {
        notContainsInheritanceABuilder();
      PersistenceManager pm = pmf.getPersistenceManager();
      //add newsgroup_2 -> [user_0and2]
      NewsGroup ng = new NewsGroup("newsgroup_2");
      Collection users = ng.getUsers();
      users.add(commonUser);
      pm.makePersistent(ng);
      pm.close();
    }
View Full Code Here

Examples of org.objectweb.speedo.pobjects.inheritance.query.NewsGroup

   
    public void notContainsInheritanceCBuilder() {
        notContainsInheritanceBBuilder();
      PersistenceManager pm = pmf.getPersistenceManager();
      //add newsgroup_3 -> [empty]
      NewsGroup ng = new NewsGroup("newsgroup_3");
      pm.makePersistent(ng);
        pm.close();
    }
View Full Code Here

Examples of org.objectweb.speedo.pobjects.inheritance.query.NewsGroup

        q.declareVariables("GroupUser u");
        q.setFilter("!(this.users.contains(u)) && (u.name == p1)");
        Collection c = (Collection) q.execute(parameter);
        Collection founds = new ArrayList(c.size());
        for (Iterator iter = c.iterator(); iter.hasNext();) {
            NewsGroup ng = (NewsGroup) iter.next();
            founds.add(ng.getName());
        }
        q.closeAll();
        pm.close();
        assertSameCollection("Bad group found",
                Arrays.asList(resultExpected),
View Full Code Here

Examples of pygmy.nntp.NewsGroup

        }
    }

    public void testCreateNewsgroup() throws Exception {
        String name = "comp.lang.java";
        NewsGroup group = forum.createNewsgroup(name);
        assertEquals( name, group.getName() );

        NewsGroup sameGroup = forum.getNewsgroup( group.getName() );
        assertEquals( group.getName(), sameGroup.getName() );
        assertEquals( group.getFirstIndex(), sameGroup.getFirstIndex() );
        assertEquals( group.getLastIndex(), sameGroup.getLastIndex() );
        assertEquals( group.size(), sameGroup.size() );
    }
View Full Code Here

Examples of pygmy.nntp.NewsGroup

        assertEquals( group.size(), sameGroup.size() );
    }

    public void testAddArticle() throws Exception {
        String name = "comp.lang.java.programmer";
        NewsGroup group = forum.createNewsgroup(name);
        Article article = NntpTestUtil.createArticle("test.eml");
        forum.addArticle( article, "foo");
        File repository = forum.getArticleRepository();

        File[] list = repository.listFiles();
        assertEquals( NntpUtil.base64Encode( article.getMessageId() ), list[0].getName() );
        assertEquals( 1, group.size() );
    }
View Full Code Here

Examples of pygmy.nntp.NewsGroup

    }

    public void testGetMessageSince() {
        String groups[] = createSomeNewsGroups();

        NewsGroup group = forum.getNewsgroup( groups[0] );
        group.getDirectory().setLastModified( 1L );

        List list = forum.getNewsgroups( new Date(0), null );
        assertEquals( "Assert we get all the groups", groups.length, list.size() );

        list = forum.getNewsgroups( new Date(2), null );
        assertEquals( "Assert we get all the groups but the first", groups.length - 1, list.size() );
        for (int it = 0; it < list.size(); it++) {
            NewsGroup newsgroup = (NewsGroup) list.get(it);
            assertNewsGroupContained(groups, newsgroup);
        }

        list = forum.getNewsgroups( new Date(2), new String[] { "comp." } );
        assertEquals( "Assert we get only comp.lang.ada", 1, list.size() );
View Full Code Here

Examples of pygmy.nntp.NewsGroup

        buffer.append("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" border=\"0\" >\n");
        addTableRow( "navigationbar" );
        addTableColumn( "<b><font class=\"title\">Forums</font></b>", null, "align=\"left\" colspan=\"2\"" );
        tableRowEnd();
        for( Iterator i = forum.newsgroupIterator(); i.hasNext(); ) {
            NewsGroup t = (NewsGroup) i.next();
            addTableRow( "tableheader" );
            buffer.append( "\n<td align=\"center\" valign=\"top\">" );
            buffer.append( createIcon( request.createUrl("/linkOpaque.gif"), 6, 11 ) );
            buffer.append( "</td>\n" );
            buffer.append( "\n<td nowrap align=\"left\"><p><small>");
//            createLink( t.getName(), getForumUrl( t.getUrl() ), null );
            buffer.append( "<br>&nbsp;&nbsp;created by ");
//            buffer.append( t.getCreator() );
            buffer.append( "<br>&nbsp;&nbsp;");
            buffer.append( t.size() );
            buffer.append( " Messages" );
            buffer.append( "<br>&nbsp;&nbsp;last modified (" );
            buffer.append( t.getLastModified() );
            buffer.append( ")" );
            buffer.append( "</small></p></td>\n" );
            tableRowEnd();
        }
        buffer.append("</table>\n");
View Full Code Here

Examples of pygmy.nntp.NewsGroup

            System.out.println("Directory was not deleted!: " + directory.getAbsolutePath() );
        }
    }

    public static NewsGroup createNewsGroup( String name ) {
        NewsGroup group = new NewsGroup( new File( System.getProperty("nntp.root"), name ), name );
        return group;
    }
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.