Package com.agiletec.plugins.jprss.aps.system.services.rss

Examples of com.agiletec.plugins.jprss.aps.system.services.rss.Channel


    String result = this.executeAction();
    assertEquals(Action.SUCCESS, result);
  }
 
  private Channel createTestChannel(String title, String descr, boolean active) {
    Channel channel = new Channel();
    channel.setActive(active);
    channel.setCategory("cat1");
    channel.setContentType("ART");
    channel.setDescription(descr);
    channel.setFeedType("rss_2.0");
    channel.setTitle(title);
    return channel;
  }
View Full Code Here


    String result = this.executeAction();
    assertEquals(Action.SUCCESS, result);
  }
 
  public void testList() throws Throwable {
    Channel channel1 = this.createTestChannel("t1", "d1", true);
    Channel channel2 = this.createTestChannel("t2", "d2", true);
    Channel channel3 = this.createTestChannel("t3", "d3", false);
    Channel channel4 = this.createTestChannel("t4", "d4", false);
    this.getRssManager().addChannel(channel1);
    this.getRssManager().addChannel(channel2);
    this.getRssManager().addChannel(channel3);
    this.getRssManager().addChannel(channel4);
   
View Full Code Here

    List<Channel> channels = action.getChannels();
    assertEquals(4, channels.size());
  }
 
  public void testEdit() throws Throwable {
    Channel channel1 = this.createTestChannel("t1", "d1", true);
    this.getRssManager().addChannel(channel1);
   
    this.setUserOnSession("admin");
    this.initAction(NAMESPACE, "edit");
    String result = this.executeAction();
    assertEquals(Action.INPUT, result);
    assertTrue(this.getAction().getActionErrors().size() == 1);
   
    this.initAction(NAMESPACE, "edit");
    String id = new Integer(channel1.getId()).toString();
    this.addParameter("id", id);
    result = this.executeAction();
    assertEquals(Action.SUCCESS, result);
    RssAction action = (RssAction) this.getAction();
    assertEquals(ApsAdminSystemConstants.EDIT, action.getStrutsAction());
View Full Code Here

    super.tearDown();
    List<Channel> channels = this.getRssManager().getChannels(Channel.STATUS_ALL);
    if (null != channels && !channels.isEmpty()) {
      Iterator<Channel> it = channels.iterator();
      while (it.hasNext()) {
        Channel current = it.next();
        this.getRssManager().deleteChannel(current.getId());
      }
    }
    channels = this.getRssManager().getChannels(Channel.STATUS_ALL);
    assertTrue(channels.isEmpty());
  }
View Full Code Here

    assertEquals("cat1", action.getCategory());
    assertEquals("rss_2.0", action.getFeedType());
  }
 
  public void testDelete() throws Throwable {
    Channel channel1 = this.createTestChannel("t1", "d1", true);
    this.getRssManager().addChannel(channel1);
   
    this.setUserOnSession("admin");
    this.initAction(NAMESPACE, "delete");
    String result = this.executeAction();
    assertEquals(Action.INPUT, result);
    assertTrue(this.getAction().getActionErrors().size() == 1);
   
    this.initAction(NAMESPACE, "delete");
    String id = new Integer(channel1.getId()).toString();
    this.addParameter("id", id);
    result = this.executeAction();
    assertEquals(Action.SUCCESS, result);
    List<Channel> channels = this.getRssManager().getChannels(Channel.STATUS_ALL);
    assertTrue(channels.isEmpty());
View Full Code Here

    List<Channel> channels = this.getRssManager().getChannels(Channel.STATUS_ALL);
    assertTrue(channels.isEmpty());
  }
 
  public void testSaveUpdate() throws Throwable {
    Channel channel1 = this.createTestChannel("t1", "d1", true);
    this.getRssManager().addChannel(channel1);
   
   
    this.setUserOnSession("admin");
    this.initAction(NAMESPACE, "save");
    this.addParameter("id", new Integer(channel1.getId()).intValue());
    this.addParameter("strutsAction", "2");
    this.addParameter("contentType", "ART");
    this.addParameter("title", "test rss title");
    this.addParameter("description", "test rss descr");
    this.addParameter("feedType", JpRssSystemConstants.FEED_TYPE_RSS_20);
    String result = this.executeAction();
    assertEquals(Action.SUCCESS, result);
   
    Channel upadated = this.getRssManager().getChannel(channel1.getId());
    assertFalse(upadated.isActive());
    assertEquals("test rss title", upadated.getTitle());
    assertEquals("test rss descr", upadated.getDescription());
  }
View Full Code Here

  public void testFilters() throws Throwable {
    //TODO da fare
  }
 
  private Channel createTestChannel(String title, String descr, boolean active) {
    Channel channel = new Channel();
    channel.setActive(active);
    channel.setCategory("cat1");
    channel.setContentType("ART");
    channel.setDescription(descr);
    channel.setFeedType("rss_2.0");
    channel.setTitle(title);
    return channel;
  }
View Full Code Here

    try {
      List<Channel> channels = this.getRssManager().getChannels(Channel.STATUS_ALL);
      if (null != channels && !channels.isEmpty()) {
        Iterator<Channel> it = channels.iterator();
        while (it.hasNext()) {
          Channel current = it.next();
          this.getRssManager().deleteChannel(current.getId());
        }
      }
      channels = this.getRssManager().getChannels(Channel.STATUS_ALL);
      assertTrue(channels.isEmpty());
      IContentManager contentManager = (IContentManager) this.getService(JacmsSystemConstants.CONTENT_MANAGER);
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jprss.aps.system.services.rss.Channel

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.