wiki:WikiOutputStreamPlugin

Version 8 (modified by kap4020@…, 16 years ago) (diff)

fixed a typo: direcly != directly

WikiOutputStreamPlugin

Description

Do you love Continuous Integration? Want to better integrate either JUnit, CruiseControl along with Trac? Sometimes you want to either publish your test reports directly into Trac's Wiki (why not?). Perhaps you want to also let you directly hyperlink your Java class names directly into the source browser, right?

If you answered 'yes' to some of the questions, there is an answer right here!

WikiOutputStreamPlugin is a OutputStream for Java which lets you easily publish direcly into Trac as an Wiki Article. 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.

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 [download:wikioutputstreamplugin 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.

Since it uses Java Secure Channel (JSch) from JCraft, currently under BSD Licensing, their mandatory notice is given here:

Copyright (c) 2002,2003,2004,2005,2006 Atsuhiko Yamanaka, JCraft,Inc. 
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice,
     this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright 
     notice, this list of conditions and the following disclaimer in 
     the documentation and/or other materials provided with the distribution.

  3. The names of the authors may not be used to endorse or promote products
     derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Example

Suppose you have a testCase/suite you'd like to let you publish results directly into trac. Or perhaps you want to create a Log4J Logging Module publish their results into trac. WikiOutputStreamPlugin 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 00:51:51

WikiOutputStreamPlugin:

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

WikiOutputStreamPlugin:

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

WikiOutputStreamPlugin:

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

Author/Contributors

Author: aldrinleal
Contributors: