Beispiel #1
0
  protected void showDetail() {
    Intent intent = new Intent(this, DetailActivity.class);

    String title = selectedFeed.getTitle();
    String description = selectedFeed.getDescription();
    String link = selectedFeed.getLink();

    intent.putExtra("title", title);
    intent.putExtra("description", description);
    intent.putExtra("link", link);

    startActivity(intent);
  }
  public void testWrite() throws Exception {
    FileWriter fw = null;
    File outFile = null;

    try {
      outFile = File.createTempFile("FeedTest", "tmp");
      filesToDelete.add(outFile);
      fw = new FileWriter(outFile);
      Feed feed = new Feed(tempFile);
      feed.write(fw);
      fw.close();

      // Feed feed2 = new Feed(outFile);
      assertEquals("CruiseControl Build Results", feed.getTitle());
      assertEquals("http://MyMachine.MyDomain.com/cruisecontrol/", feed.getLink());
      assertEquals(
          "Automated build results for CruiseControl project(s) VERSION_10", feed.getDescription());

      // validate the number of items and the contents of the first item.
      assertEquals(11, feed.getItems().size());
      Item item = (Item) feed.getItems().get(0);
      assertEquals("VERSION_10 build.7 Build Successful", item.getTitle());
      assertEquals(
          "http://MyMachine.MyDomain.com/cruisecontrol/buildresults/"
              + "VERSION_10?log=log20050817084109Lbuild.7",
          item.getLink());
      assertEquals(
          "<em>Build Time:</em> Wed Aug 17 08:41:09 MDT 2005<br/>"
              + "<em>Label:</em> build.7<br/><em>Modifications: </em>1<br/>"
              + "\n<ul><li>//depot/MyProduct/VERSION_10/dev/main/src/datacenter/"
              + "ApplicationServer/PlayTime/default.build"
              + "  by jefferson (deploy the mock object dll)</li></ul>",
          item.getDescription());
    } finally {
      IO.close(fw);
    }
  }
  public void testConstructors() {
    Feed feed = new Feed(tempFile);

    assertEquals("CruiseControl Build Results", feed.getTitle());
    assertEquals("http://MyMachine.MyDomain.com/cruisecontrol/", feed.getLink());
    assertEquals(
        "Automated build results for CruiseControl project(s) VERSION_10", feed.getDescription());

    // validate the number of items and the contents of the first item.
    assertEquals(11, feed.getItems().size());
    Item item = (Item) feed.getItems().get(0);
    assertEquals("VERSION_10 build.7 Build Successful", item.getTitle());
    assertEquals(
        "http://MyMachine.MyDomain.com/cruisecontrol/buildresults/"
            + "VERSION_10?log=log20050817084109Lbuild.7",
        item.getLink());
    assertEquals(
        "<em>Build Time:</em> Wed Aug 17 08:41:09 MDT 2005<br/>"
            + "<em>Label:</em> build.7<br/><em>Modifications: </em>1<br/>"
            + "\n<ul><li>//depot/MyProduct/VERSION_10/dev/main/src/datacenter/"
            + "ApplicationServer/PlayTime/default.build"
            + "  by jefferson (deploy the mock object dll)</li></ul>",
        item.getDescription());
  }