wiki:WikiOutputStreamPlugin

Publish output directly into Trac

Description

This plugin is an OutputStream for Java, which lets you easily publish direcly into Trac as a wiki page. This is accomplished running trac-admin over an ssh-pki-authenticated-remote-shell-connection. It also contains goodies for hyperlinking class names directly into Trac's source browser.

Key features:

  • Integrate either JUnit or CruiseControl into Trac.
  • Publish your test reports directly into Trac's wiki.
  • Hyperlink your Java class names directly into the source browser.

Bugs/Feature Requests

Existing bugs and feature requests for WikiOutputStreamPlugin are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out WikiOutputStreamPlugin from here using Subversion, or browse the source with Trac.

License

   Copyright 2006 Aldrin Leal, aldrin at leal dot eng dot bee arr

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

It uses Java Secure Channel (JSch) from JCraft, which itself is BSD licensed.

Example

Suppose you have test results you would like to publish directly into Trac. Or perhaps you want to create a Log4J Logging Module publish their results into Trac. This plugin usage is fairly simple: once you configure it (by creating a simple 'trac.properties' file in your classpath, or by doing the hardcoded-way), you can easily create a new and start using:

import junit.framework.TestCase;
import br.eng.leal.trac.WikiPageOutputStream;

public class MyTestCaseWhichReportsAsAWiki extends TestCase {
  private PrintStream printStream;
  
  /**
   * Try to setup an WikiOutputStream, resorting do System.out as a fallback measure
   */
  protected void setUp() {
    try {
      this.printStream = new PrintStream(new WikiPageOutputStream(this.getName().substring("test";.length()), true);
    } catch (Exception exc) {
      this.printStream = System.out;
    }
  }

  /**
   * Somewhere later...
   */
  protected void tearDown() {
    this.printStream.close();
  }

  /**
   *  On Sucessfull connection, this must create a page named "Something" over on trac's Wiki
   */
  public void testSomething() {
    this.printStream("[[br]]Hello, Trac![[br]]");
  }
}

Recent Changes

1446 by aldrinleal on 2006-10-24 02:51:51

WikiOutputStreamPlugin:

  • Added mode for complete Disabling of WikiPageOutputStream
1413 by aldrinleal on 2006-10-20 18:11:25

WikiOutputStreamPlugin:

  • JSch LICENSE.JSch added;
1411 by aldrinleal on 2006-10-20 10:51:11

WikiOutputStreamPlugin:

  • Sample trac.properties added, sourcefolder also
(more)

Author/Contributors

Author: aldrinleal
Maintainer: aldrinleal
Contributors:

Last modified 6 months ago Last modified on Nov 26, 2015, 10:48:37 AM