r248 - in jrst/trunk: . src/main/java/org/codelutin/jrst src/main/resources/i18n src/site src/test/java/org/codelutin/jrst src/test/resources
Author: chatellier Date: 2009-01-15 18:31:16 +0000 (Thu, 15 Jan 2009) New Revision: 248 Added: jrst/trunk/src/main/resources/i18n/jrst-en_GB.properties Removed: jrst/trunk/build-release.sh jrst/trunk/src/main/resources/i18n/jrst-en_US.properties Modified: jrst/trunk/changelog.txt jrst/trunk/pom.xml jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java jrst/trunk/src/main/resources/i18n/jrst-fr_FR.properties jrst/trunk/src/site/site_en.xml jrst/trunk/src/site/site_fr.xml jrst/trunk/src/test/java/org/codelutin/jrst/AdvancedReaderTest.java jrst/trunk/src/test/java/org/codelutin/jrst/Compare.java jrst/trunk/src/test/java/org/codelutin/jrst/GutterColor.java jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java jrst/trunk/src/test/java/org/codelutin/jrst/JRSTReaderTest.java jrst/trunk/src/test/java/org/codelutin/jrst/ThreadRedirection.java jrst/trunk/src/test/java/org/codelutin/jrst/XMLCaseTest.java jrst/trunk/src/test/resources/test2.rst jrst/trunk/src/test/resources/text.rst Log: Re add i18n plugin on build Reenable tests during maven build Move test to junit 4 Switch to lutinproject 3.3 Deleted: jrst/trunk/build-release.sh =================================================================== --- jrst/trunk/build-release.sh 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/build-release.sh 2009-01-15 18:31:16 UTC (rev 248) @@ -1,63 +0,0 @@ -#!/bin/sh - -APP_NAME=jrst - -# script pour la creation d'un zip de release - -if [ "$USER" = "poussin" ]; then - LABS_LOGIN=bpoussin -else - LABS_LOGIN=$USER -fi - -dir=$(dirname $0) -cd $dir - -VER=$(xmlstarlet sel -N "p=http://maven.apache.org/POM/4.0.0" -t -v "/p:project/p:version" pom.xml) -RELEASE=${APP_NAME}-$VER -echo "build release $RELEASE" - -# recuperation de tous les jar dans un r�pertoire -# target/${APP_NAME}-$VER/WEB-INF/lib/ -echo "prepare jar ..." -mvn -o compile jar:jar war:war - -# creation du repertoire cible -TARGET=/tmp/$RELEASE -mkdir -p $TARGET/lib - -echo "copy library ..." -cp target/$RELEASE/WEB-INF/lib/* $TARGET/lib -echo "copy ${APP_NAME} ..." -cp target/$RELEASE.jar $TARGET - -# creation du Class Path -echo "create classpath ..." -cd $TARGET -SEPW=";" -SEP=":" -CP=$RELEASE.jar -CPW=$RELEASE.jar -for f in lib/*; do - CP="$CP$SEP$f" - CPW="$CPW$SEPW$f" -done - -echo "create script ..." -cat << EOF > $TARGET/${APP_NAME}.bat -java -cp $CPW org.codelutin.jrst.JRST %1 %2 %3 %4 %5 %6 %7 %8 %9 -EOF - -cat << EOF > $TARGET/${APP_NAME}.sh -java -cp $CP org.codelutin.jrst.JRST \$* -EOF - -chmod +x $TARGET/${APP_NAME}.sh - -echo "create zip /tmp/$RELEASE.zip ..." -cd /tmp -zip -q -r $RELEASE.zip $RELEASE - -echo "copy zip to labs ..." -ssh $LABS_LOGIN@labs.libre-entreprise.org "mkdir -p /home/groups/${APP_NAME}/htdocs/download" -scp $RELEASE.zip $LABS_LOGIN@labs.libre-entreprise.org:/home/groups/${APP_NAME}/htdocs/download/ Modified: jrst/trunk/changelog.txt =================================================================== --- jrst/trunk/changelog.txt 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/changelog.txt 2009-01-15 18:31:16 UTC (rev 248) @@ -1,4 +1,12 @@ -ver-0.8 xxx xxx +ver-0.8.4 xxx 2009XXXX + + * Update xml2rst.xsl stylesheet + * Re add i18n plugin on build + * Reenable tests during maven build + * Move test to junit 4 + * switch to lutinproject 3.3 + +ver-0.8.3 chemit 20081009 * Add title property in xdoc xslt * Switch license to lgpl Modified: jrst/trunk/pom.xml =================================================================== --- jrst/trunk/pom.xml 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/pom.xml 2009-01-15 18:31:16 UTC (rev 248) @@ -31,9 +31,6 @@ <!-- nom du projet sur le labs --> <labs.project>jrst</labs.project> - - <!-- Test --> - <maven.test.skip>true</maven.test.skip> <!-- Site en et fr --> <maven.site.locales>fr,en</maven.site.locales> @@ -48,7 +45,21 @@ <build> <plugins> + <!-- i18n --> <plugin> + <groupId>org.codelutin</groupId> + <artifactId>maven-i18n-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>parserJava</goal> + <goal>gen</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.2</version> Modified: jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java =================================================================== --- jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/main/java/org/codelutin/jrst/DocumentWalker.java 2009-01-15 18:31:16 UTC (rev 248) @@ -15,18 +15,6 @@ * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/ -/* * - * DocumentWalker.java - * - * Created: 30 oct. 06 10:28:10 - * - * @author poussin - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - package org.codelutin.jrst; import org.apache.commons.logging.Log; @@ -39,10 +27,16 @@ import java.util.List; /** + * DocumentWalker. + * + * Created: 30 oct. 06 10:28:10 + * * @author poussin - * + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ */ - public class DocumentWalker { static private Log log = LogFactory.getLog(DocumentWalker.class); @@ -63,7 +57,6 @@ handler.endDocument(doc); } - @SuppressWarnings("unchecked") public void walk(Element elem) { handler.startElement(elem); for (Node node : (List<Node>) elem.content()) { Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java =================================================================== --- jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/main/java/org/codelutin/jrst/JRST.java 2009-01-15 18:31:16 UTC (rev 248) @@ -28,6 +28,33 @@ */ package org.codelutin.jrst; +import static org.codelutin.i18n.I18n._; + +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.Reader; +import java.io.StringReader; +import java.lang.reflect.Method; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.URIResolver; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.stream.StreamSource; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.fop.apps.FOUserAgent; @@ -41,37 +68,13 @@ import org.dom4j.Document; import org.dom4j.io.OutputFormat; import org.dom4j.io.XMLWriter; + import uk.co.flamingpenguin.jewel.cli.Cli; import uk.co.flamingpenguin.jewel.cli.CliFactory; import uk.co.flamingpenguin.jewel.cli.CommandLineInterface; import uk.co.flamingpenguin.jewel.cli.Option; import uk.co.flamingpenguin.jewel.cli.Unparsed; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.sax.SAXResult; -import javax.xml.transform.stream.StreamSource; -import java.awt.GraphicsDevice; -import java.awt.GraphicsEnvironment; -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.Reader; -import java.io.StringReader; -import java.lang.reflect.Method; -import java.net.URL; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.ResourceBundle; - /** * FIXME: 'JRST --help' doesn't work, but 'JRST --help toto' work :( FIXME: * 'JRST -c' doesn't work, but 'JRST -c toto' @@ -155,8 +158,12 @@ } static public void main(String[] args) throws Exception { - if (args.length == 0) + + I18n.init(); + + if (args.length == 0) { args = askOption(); + } if (args == null) { System.exit(0); } @@ -216,6 +223,7 @@ */ private static String[] askOptionGraph() throws SecurityException, NoSuchMethodException { + Method m = JRSTOption.class.getMethod("getOutType"); Option a = m.getAnnotation(Option.class); JRSTInterface graph = new JRSTInterface(a.pattern()); @@ -232,23 +240,24 @@ */ private static String[] askOptionText() throws IOException { // language - if (Locale.getDefault().getLanguage() == "fr") + /*if (Locale.getDefault().getLanguage() == "fr") I18n.init("fr", "FR"); else - I18n.init("en", "US"); - ResourceBundle bundle = ResourceBundle - .getBundle("org.codelutin.i18n.I18nBundleBridge"); - System.out.println(bundle.getString("help?")); + I18n.init("en", "US");*/ + + //I18n.init(); + + System.out.println(_("help?")); Boolean done = false; String cheminRST = ""; while (!done) { - System.out.println(bundle.getString("rstFile?")); + System.out.println(_("rstFile?")); cheminRST = lireFile(false, false); if (cheminRST.length() == 0) System.exit(0); File fileRST = new File(cheminRST); if (!fileRST.exists()) { - System.out.println(bundle.getString("dontExist")); + System.out.println(_("dontExist")); cheminRST = ""; } else done = true; @@ -257,7 +266,7 @@ String type = ""; while (!done) { type = ""; - System.out.println(bundle.getString("outputFormat?")); + System.out.println(_("outputFormat?")); type = lire(); if (type.matches("xhtml|docbook|xml|html|xdoc|rst|pdf|odt|rtf") || type.length() == 0) @@ -267,7 +276,7 @@ if (type.length() == 0) { done = false; while (!done) { - System.out.println(bundle.getString("xslFile?")); + System.out.println(_("xslFile?")); String cheminXSLtmp = lireFile(false, true); File fileRST = new File(cheminXSLtmp); @@ -278,12 +287,12 @@ done = true; } else { if (!fileRST.exists()) { - System.out.println(bundle.getString("dontExist")); + System.out.println(_("dontExist")); } else { cheminXSL += cheminXSLtmp; String other = ""; do { - System.out.println(bundle.getString("other?")); + System.out.println(_("other?")); other = lire(); } while (!other.matches("y|n|o")); if (other.equals("y") || other.equals("o")) @@ -303,14 +312,14 @@ done = false; String cheminSortie = ""; while (!done) { - System.out.println(bundle.getString("outputFile?")); + System.out.println(_("outputFile?")); cheminSortie = lireFile(true, true); File fileRST = new File(cheminSortie); if (fileRST.exists()) { String strEcraser = ""; do { - System.out.println(bundle.getString("overwrite?")); + System.out.println(_("overwrite?")); strEcraser = lire(); } while (!strEcraser.matches("y|n|o")); if (strEcraser.equals("y") || strEcraser.equals("o")) { @@ -415,6 +424,24 @@ throw new FileNotFoundException("Can't find stylesheet: " + xsl); } + + // add uri resolver + /*gen.setUriResolver(new URIResolver() { + public Source resolve(String href, String base) { + System.out.println("RESOLVING: href: "+href+" base: "+base); + + return null; + try { + System.out.println("RESOLVING: href: "+href+" base: "+base); + StreamSource ss = new StreamSource(new FileInputStream(new File(href))); + return ss; + } catch (FileNotFoundException e) { + e.printStackTrace(); + return null; + } + } + });*/ + doc = gen.transform(doc, stylesheet); } Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java =================================================================== --- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTInterface.java 2009-01-15 18:31:16 UTC (rev 248) @@ -18,6 +18,8 @@ */ package org.codelutin.jrst; +import static org.codelutin.i18n.I18n._; + import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; @@ -29,7 +31,6 @@ import java.io.File; import java.util.LinkedList; import java.util.Locale; -import java.util.ResourceBundle; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; @@ -106,24 +107,16 @@ private ImageIcon open = Resource.getIcon("icone/open.png"); private ImageIcon delete = Resource.getIcon("icone/cancel.png"); private ImageIcon more = Resource.getIcon("icone/more.gif"); - private ResourceBundle bundle = null; private LinkedList<Container> composantsXSL = null; /** * le parametre initialise les options disponibles * - * @param String - * o + * @param o */ public JRSTInterface(String o) { - // language - if (Locale.getDefault().getLanguage() == "fr") - I18n.init("fr", "FR"); - else - I18n.init("en", "US"); - bundle = ResourceBundle - .getBundle("org.codelutin.i18n.I18nBundleBridge"); + this.setFormats(o); this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); this.setTitle("JRST"); @@ -178,7 +171,7 @@ private JButton getBoutonConvertir() { if (boutonConvertir == null) { boutonConvertir = new JButton(); - boutonConvertir.setText(bundle.getString("btnConvert")); + boutonConvertir.setText(_("btnConvert")); boutonConvertir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { convert(); @@ -191,7 +184,7 @@ private JButton getBoutonAnnuler() { if (boutonAnnuler == null) { boutonAnnuler = new JButton(); - boutonAnnuler.setText(bundle.getString("btnCancel")); + boutonAnnuler.setText(_("btnCancel")); boutonAnnuler.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { annuler(); @@ -389,7 +382,7 @@ private JRadioButton getXslRadio() { if (xslRadio == null) { - xslRadio = new JRadioButton(bundle.getString("externalXSL")); + xslRadio = new JRadioButton(_("externalXSL")); } return xslRadio; } @@ -411,7 +404,7 @@ if (savePanel == null) { savePanel = new JPanel(); savePanel.setLayout(new FlowLayout()); - savePanel.add(new JLabel(bundle.getString("saveAs"))); + savePanel.add(new JLabel(_("saveAs"))); savePanel.add(getSaveText()); savePanel.add(getBoutonSaveLocation()); } @@ -436,7 +429,7 @@ if (openPanel == null) { openPanel = new JPanel(); openPanel.setLayout(new FlowLayout()); - openPanel.add(new JLabel(bundle.getString("open"))); + openPanel.add(new JLabel(_("open"))); openPanel.add(getOpenText()); openPanel.add(getBoutonOpenLocation()); } @@ -502,8 +495,7 @@ } public int askEcraser() { - int choix = JOptionPane.showConfirmDialog(this, bundle - .getObject("overwriteGraph?")); + int choix = JOptionPane.showConfirmDialog(this, _("overwriteGraph?")); return choix; } @@ -519,7 +511,7 @@ private void convert() { boolean exit = false; if (getOpenText().getText().equals("")) { - getErrorLabel().setText(bundle.getString("openEmpty?")); + getErrorLabel().setText(_("openEmpty?")); getErrorLabel().setForeground(Color.RED); this.pack(); } else { Modified: jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java =================================================================== --- jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/main/java/org/codelutin/jrst/JRSTReader.java 2009-01-15 18:31:16 UTC (rev 248) @@ -394,7 +394,7 @@ return result; } catch (Exception eee) { - log.error(_("JRST parsing error line {0} char {1}:\n{2}", lexer + log.error(_("JRST parsing error line %d char %s:\n%s", lexer .getLineNumber(), lexer.getCharNumber(), lexer .readNotBlanckLine())); throw eee; @@ -596,8 +596,7 @@ anonym.addAttribute("anonymous", "1"); idMax++; anonym.addAttribute("id", "id" + idMax); - anonym - .addAttribute("refuri", e.attributeValue("refuri") + anonym.addAttribute("refuri", e.attributeValue("refuri") .trim()); eTargetAnonymous.add(anonym); eTargetAnonymousCopy.add(anonym); Added: jrst/trunk/src/main/resources/i18n/jrst-en_GB.properties =================================================================== --- jrst/trunk/src/main/resources/i18n/jrst-en_GB.properties (rev 0) +++ jrst/trunk/src/main/resources/i18n/jrst-en_GB.properties 2009-01-15 18:31:16 UTC (rev 248) @@ -0,0 +1,20 @@ +JRST\ parsing\ error\ line\ %d\ char\ %s\:\\n%s=JRST parsing error line %d char %s\:\\n%s +annuler=.. to cancel or return to parent directory +btnCancel=Cancel +btnConvert=Convert +dontExist=Invalid file path +entrer=Enter to display file list, or to complete path +exit=Enter "\!q" to exit +externalXSL=External(s) XSL(s) +help?=JRST --help to display help +open=Open file \: +openEmpty?=This field must be fill in. +other?=Want you add an other XSL file ?(y/n) +outputFile?=Please enter outpout path (empty to display in console) +outputFormat?=Please enter output format (xhtml, docbook, xml(by default), html, xdoc, rst, pdf, odt ou rtf)\n(empty to enter XSL files to use) +overwrite?=This file exists, do you want to overwrite it ? (y/n) +overwriteGraph?=This file existe, do you want to overwrite it ? +rstFile?=Please enter reStructuredText file path (empty to exit) +save=Enter "\!s" in the end of the file name to save +saveAs=Save as \: +xslFile?=Please enter XSL file path (XML output if empty) Deleted: jrst/trunk/src/main/resources/i18n/jrst-en_US.properties =================================================================== --- jrst/trunk/src/main/resources/i18n/jrst-en_US.properties 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/main/resources/i18n/jrst-en_US.properties 2009-01-15 18:31:16 UTC (rev 248) @@ -1,19 +0,0 @@ -help?=JRST\ \-\-help\ to\ display\ help -rstFile?=Please\ enter\ reStructuredText\ file\ path\ \(empty\ to\ exit\) -dontExist=Invalid\ file\ path -outputFormat?=Please\ enter\ output\ format \(xhtml\,\ docbook\,\ xml\(by\ default\)\,\ html\,\ xdoc\,\ rst\,\ pdf\,\ odt\ ou\ rtf\)\n\(empty\ to\ enter\ XSL\ files\ to\ use\) -xslFile?=Please\ enter\ XSL\ file\ path\ \(XML\ output\ if\ empty\) -outputFile?=Please\ enter\ outpout\ path\ \(empty\ to\ display\ in\ console\) -overwrite?=This\ file\ exists\,\ do\ you\ want\ to\ overwrite\ it\ \?\ \(y\/n\) -btnConvert=Convert -btnCancel=Cancel -externalXSL=External(s) XSL\(s\) -saveAs=Save as \: -open=Open file \: -overwriteGraph?=This file existe, do you want to overwrite it \? -openEmpty?=This field must be fill in. -other?=Want you add an other XSL file \?\(y\/n\) -annuler=\.\.\ to\ cancel\ or\ return\ to\ parent\ directory -entrer=Enter\ to\ display\ file\ list\,\ or\ to\ complete\ path -save=Enter \"\!s\" in the end of the file name to save -exit=Enter \"\!q\" to exit \ No newline at end of file Modified: jrst/trunk/src/main/resources/i18n/jrst-fr_FR.properties =================================================================== --- jrst/trunk/src/main/resources/i18n/jrst-fr_FR.properties 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/main/resources/i18n/jrst-fr_FR.properties 2009-01-15 18:31:16 UTC (rev 248) @@ -1,19 +1,20 @@ +JRST\ parsing\ error\ line\ %d\ char\ %s\:\\n%s= +annuler=.. pour annuler ou pour revenir au repertoire precedent +btnCancel=Annuler +btnConvert=Convertir +dontExist=Ce fichier n'existe pas +entrer=Entrer pour afficher la liste des fichiers, ou pour completer le chemin +exit=Saisir "\!q" pour quitter +externalXSL=XSL(s) externe(s) help?=JRST --help pour afficher l'aide +open=Ouvrir le fichier \: +openEmpty?=Ce champ doit etre rempli. +other?=Voulez-vous ajouter un autre fichier XSL ?(o/n) +outputFile?=Veuillez saisir le chemin du fichier sortie (Laissez vide pour l'afficher dans la sortie standard) +outputFormat?=Veuillez saisir le format de sortie (xhtml, docbook, xml(par default), html, xdoc, rst, pdf, odt ou rtf)\n(Laissez vide pour specifier le ou les XSL de generations \u00E0 utiliser) +overwrite?=Ce fichier existe, etes-vous sur de vouloir ecraser le fichier ?(o/n) +overwriteGraph?=Ce fichier existe, etes-vous sur de vouloir ecraser le fichier ? rstFile?=Veuillez saisir le chemin du fichier reStructuredText (Laissez vide pour quitter) -dontExist=Ce fichier n'existe pas -outputFormat?=Veuillez saisir le format de sortie (xhtml, docbook, xml(par default), html, xdoc, rst, pdf, odt ou rtf)\n(Laissez vide pour specifier le ou les XSL de generations à utiliser) +save=Saisir "\!s" a la fin du nom de fichier pour l'enregistrer +saveAs=Enregistrer sous \: xslFile?=Veuillez saisir le chemin du fichier XSL (Sortie XML si vide) -outputFile?=Veuillez saisir le chemin du fichier sortie (Laissez vide pour l'afficher dans la sortie standard) -overwrite?=Ce fichier existe, etes-vous sur de vouloir ecraser le fichier \?\(o\/n\) -other?=Voulez-vous ajouter un autre fichier XSL \?\(o\/n\) -btnConvert=Convertir -btnCancel=Annuler -externalXSL=XSL\(s\) externe\(s\) -saveAs=Enregistrer sous \: -open=Ouvrir le fichier \: -overwriteGraph?=Ce fichier existe, etes-vous sur de vouloir ecraser le fichier \? -openEmpty?=Ce champ doit etre rempli. -annuler=\.\.\ pour\ annuler\ ou\ pour\ revenir\ au\ repertoire\ precedent -entrer=Entrer\ pour\ afficher\ la\ liste\ des\ fichiers\,\ ou\ pour\ completer\ le\ chemin -save=Saisir \"\!s\" a la fin du nom de fichier pour l\'enregistrer -exit=Saisir \"\!q\" pour quitter \ No newline at end of file Modified: jrst/trunk/src/site/site_en.xml =================================================================== --- jrst/trunk/src/site/site_en.xml 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/site/site_en.xml 2009-01-15 18:31:16 UTC (rev 248) @@ -4,11 +4,12 @@ <skin> <groupId>org.codelutin</groupId> <artifactId>maven-lutin-skin</artifactId> - <version>0.2</version> + <version>0.2.2</version> </skin> <bannerLeft> <name>Java ReStructuredText parser</name> + <href>/</href> </bannerLeft> <bannerRight> Modified: jrst/trunk/src/site/site_fr.xml =================================================================== --- jrst/trunk/src/site/site_fr.xml 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/site/site_fr.xml 2009-01-15 18:31:16 UTC (rev 248) @@ -4,11 +4,12 @@ <skin> <groupId>org.codelutin</groupId> <artifactId>maven-lutin-skin</artifactId> - <version>0.2</version> + <version>0.2.2</version> </skin> <bannerLeft> <name>Java ReStructuredText parser</name> + <href>/</href> </bannerLeft> <bannerRight> Modified: jrst/trunk/src/test/java/org/codelutin/jrst/AdvancedReaderTest.java =================================================================== --- jrst/trunk/src/test/java/org/codelutin/jrst/AdvancedReaderTest.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/java/org/codelutin/jrst/AdvancedReaderTest.java 2009-01-15 18:31:16 UTC (rev 248) @@ -1,5 +1,5 @@ /* *##% JRst - * Copyright (C) 2004 - 2008 CodeLutin + * Copyright (C) 2004 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -15,50 +15,47 @@ * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/ -/* * - * AdvancedReaderTest.java - * - * Created: 27 oct. 06 01:03:26 - * - * @author poussin - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - package org.codelutin.jrst; -import junit.framework.TestCase; - import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; +import java.io.IOException; import java.io.StringReader; import java.io.Writer; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + /** + * AdvancedReaderTest. + * + * Created: 27 oct. 06 01:03:26 + * * @author poussin - * + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ */ +public class AdvancedReaderTest { -public class AdvancedReaderTest extends TestCase { - - String text = "\t\t\n" + "1 toto tata tutu\n" + "2 toto tata tutu\n" + protected String text = "\t\t\n" + "1 toto tata tutu\n" + "2 toto tata tutu\n" + "3 toto tata tutu\n" + "4 toto tata tutu\n" + "5 toto tata tutu\n" + "6 toto tata tutu\n" + "7 toto tata tutu\n" + "8 toto tata tutu\n" + "9 toto tata tutu\n"; - File file = null; - - /* - * (non-Javadoc) - * - * @see junit.framework.TestCase#setUp() + protected File file; + + /** + * setUp - create test file. + * @throws IOException */ - public AdvancedReaderTest() throws Exception { + @Before + public void setUp() throws IOException { file = File.createTempFile("test-AdvancedReader", ".txt"); file.deleteOnExit(); @@ -69,211 +66,219 @@ /** * Test method for {@link org.codelutin.jrst.AdvancedReader#eof()}. + * @throws IOException */ - public void testEof() throws Exception { + @Test + public void testEof() throws IOException { AdvancedReader in = new AdvancedReader(new FileReader(file)); - assertFalse(in.eof()); + Assert.assertFalse(in.eof()); in.readAll(); - assertTrue(in.eof()); + Assert.assertTrue(in.eof()); in = new AdvancedReader(new StringReader(text)); - assertFalse(in.eof()); + Assert.assertFalse(in.eof()); in.readAll(); - assertTrue(in.eof()); + Assert.assertTrue(in.eof()); } /** * Test method for - * {@link org.codelutin.jrst.AdvancedReader#skip_blank_lines()}. + * {@link org.codelutin.jrst.AdvancedReader#skipBlankLines()}. + * @throws IOException */ - public void testSkipBlankLines() throws Exception { + public void testSkipBlankLines() throws IOException { { AdvancedReader in = new AdvancedReader(new FileReader(file)); in.skipBlankLines(); String line = in.readLine(); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals("1 toto tata tutu", line); } { AdvancedReader in = new AdvancedReader(new StringReader(text)); in.skipBlankLines(); String line = in.readLine(); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals("1 toto tata tutu", line); } } /** * Test method for {@link org.codelutin.jrst.AdvancedReader#readAll()}. + * @throws IOException */ - public void testReadAll() throws Exception { + public void testReadAll() throws IOException { { AdvancedReader in = new AdvancedReader(new FileReader(file)); String[] lines = in.readAll(); - assertEquals(10, lines.length); - assertEquals("\t\t", lines[0]); - assertEquals("1 toto tata tutu", lines[1]); - assertEquals("9 toto tata tutu", lines[9]); + Assert.assertEquals(10, lines.length); + Assert.assertEquals("\t\t", lines[0]); + Assert.assertEquals("1 toto tata tutu", lines[1]); + Assert.assertEquals("9 toto tata tutu", lines[9]); } { AdvancedReader in = new AdvancedReader(new StringReader(text)); String[] lines = in.readAll(); - assertEquals(10, lines.length); - assertEquals("\t\t", lines[0]); - assertEquals("1 toto tata tutu", lines[1]); - assertEquals("9 toto tata tutu", lines[9]); + Assert.assertEquals(10, lines.length); + Assert.assertEquals("\t\t", lines[0]); + Assert.assertEquals("1 toto tata tutu", lines[1]); + Assert.assertEquals("9 toto tata tutu", lines[9]); } } /** * Test method for {@link org.codelutin.jrst.AdvancedReader#readLines(int)}. + * @throws IOException */ - public void testReadLines() throws Exception { + public void testReadLines() throws IOException { { AdvancedReader in = new AdvancedReader(new FileReader(file)); String[] lines = in.readLines(3); - assertEquals(3, lines.length); - assertEquals("\t\t", lines[0]); - assertEquals("1 toto tata tutu", lines[1]); - assertEquals("2 toto tata tutu", lines[2]); + Assert.assertEquals(3, lines.length); + Assert.assertEquals("\t\t", lines[0]); + Assert.assertEquals("1 toto tata tutu", lines[1]); + Assert.assertEquals("2 toto tata tutu", lines[2]); } { AdvancedReader in = new AdvancedReader(new StringReader(text)); String[] lines = in.readLines(3); - assertEquals(3, lines.length); - assertEquals("\t\t", lines[0]); - assertEquals("1 toto tata tutu", lines[1]); - assertEquals("2 toto tata tutu", lines[2]); + Assert.assertEquals(3, lines.length); + Assert.assertEquals("\t\t", lines[0]); + Assert.assertEquals("1 toto tata tutu", lines[1]); + Assert.assertEquals("2 toto tata tutu", lines[2]); } } /** * Test method for * {@link org.codelutin.jrst.AdvancedReader#readUntil(java.lang.String)}. + * @throws IOException */ - public void testReadUntil() throws Exception { + public void testReadUntil() throws IOException { { AdvancedReader in = new AdvancedReader(new FileReader(file)); String[] lines = in.readUntil("^3.*$"); - assertEquals(3, lines.length); - assertEquals("\t\t", lines[0]); - assertEquals("1 toto tata tutu", lines[1]); - assertEquals("2 toto tata tutu", lines[2]); + Assert.assertEquals(3, lines.length); + Assert.assertEquals("\t\t", lines[0]); + Assert.assertEquals("1 toto tata tutu", lines[1]); + Assert.assertEquals("2 toto tata tutu", lines[2]); String line = in.readLine(); - assertEquals("3 toto tata tutu", line); + Assert.assertEquals("3 toto tata tutu", line); } { AdvancedReader in = new AdvancedReader(new StringReader(text)); String[] lines = in.readUntil("^3.*$"); - assertEquals(3, lines.length); - assertEquals("\t\t", lines[0]); - assertEquals("1 toto tata tutu", lines[1]); - assertEquals("2 toto tata tutu", lines[2]); + Assert.assertEquals(3, lines.length); + Assert.assertEquals("\t\t", lines[0]); + Assert.assertEquals("1 toto tata tutu", lines[1]); + Assert.assertEquals("2 toto tata tutu", lines[2]); String line = in.readLine(); - assertEquals("3 toto tata tutu", line); + Assert.assertEquals("3 toto tata tutu", line); } } /** * Test method for * {@link org.codelutin.jrst.AdvancedReader#readUntil(java.lang.String)}. + * @throws IOException */ - public void testReadWhile() throws Exception { + public void testReadWhile() throws IOException { { AdvancedReader in = new AdvancedReader(new FileReader(file)); in.skipBlankLines(); String[] lines = in.readWhile("^[123].*$"); - assertEquals(3, lines.length); - assertEquals("1 toto tata tutu", lines[0]); - assertEquals("2 toto tata tutu", lines[1]); - assertEquals("3 toto tata tutu", lines[2]); + Assert.assertEquals(3, lines.length); + Assert.assertEquals("1 toto tata tutu", lines[0]); + Assert.assertEquals("2 toto tata tutu", lines[1]); + Assert.assertEquals("3 toto tata tutu", lines[2]); String line = in.readLine(); - assertEquals("4 toto tata tutu", line); + Assert.assertEquals("4 toto tata tutu", line); } { AdvancedReader in = new AdvancedReader(new StringReader(text)); in.skipBlankLines(); String[] lines = in.readWhile("^[123].*$"); - assertEquals(3, lines.length); - assertEquals("1 toto tata tutu", lines[0]); - assertEquals("2 toto tata tutu", lines[1]); - assertEquals("3 toto tata tutu", lines[2]); + Assert.assertEquals(3, lines.length); + Assert.assertEquals("1 toto tata tutu", lines[0]); + Assert.assertEquals("2 toto tata tutu", lines[1]); + Assert.assertEquals("3 toto tata tutu", lines[2]); String line = in.readLine(); - assertEquals("4 toto tata tutu", line); + Assert.assertEquals("4 toto tata tutu", line); } } /** * Test method for {@link org.codelutin.jrst.AdvancedReader#readLine()}. + * @throws IOException */ - public void testReadLine() throws Exception { + public void testReadLine() throws IOException { { AdvancedReader in = new AdvancedReader(new FileReader(file)); String line = in.readLine(); - assertEquals("\t\t", line); + Assert.assertEquals("\t\t", line); line = in.readLine(); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals("1 toto tata tutu", line); line = in.readLine(); - assertEquals("2 toto tata tutu", line); + Assert.assertEquals("2 toto tata tutu", line); } { AdvancedReader in = new AdvancedReader(new StringReader(text)); String line = in.readLine(); - assertEquals("\t\t", line); + Assert.assertEquals("\t\t", line); line = in.readLine(); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals("1 toto tata tutu", line); line = in.readLine(); - assertEquals("2 toto tata tutu", line); + Assert.assertEquals("2 toto tata tutu", line); } } - public void testMark() throws Exception { + public void testMark() throws IOException { AdvancedReader in = new AdvancedReader(new StringReader(text)); String line = in.readLine(); in.mark(); line = in.readLine(); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals("1 toto tata tutu", line); in.reset(); line = in.readLine(); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals("1 toto tata tutu", line); } - public void testUnread() throws Exception { + public void testUnread() throws IOException { AdvancedReader in = new AdvancedReader(new StringReader(text)); - assertEquals(0, in.getCharNumber()); - assertEquals(0, in.getLineNumber()); + Assert.assertEquals(0, in.getCharNumber()); + Assert.assertEquals(0, in.getLineNumber()); String line = in.readLine(); - assertEquals(3, in.getCharNumber()); - assertEquals(1, in.getLineNumber()); + Assert.assertEquals(3, in.getCharNumber()); + Assert.assertEquals(1, in.getLineNumber()); line = in.readLine(); - assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber()); - assertEquals(2, in.getLineNumber()); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber()); + Assert.assertEquals(2, in.getLineNumber()); + Assert.assertEquals("1 toto tata tutu", line); in.unread(line.length() + 1); - assertEquals(3, in.getCharNumber()); - assertEquals(1, in.getLineNumber()); + Assert.assertEquals(3, in.getCharNumber()); + Assert.assertEquals(1, in.getLineNumber()); line = in.readLine(); - assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber()); - assertEquals(2, in.getLineNumber()); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals(4 + "1 toto tata tutu".length(), in.getCharNumber()); + Assert.assertEquals(2, in.getLineNumber()); + Assert.assertEquals("1 toto tata tutu", line); } - public void testSkip() throws Exception { + public void testSkip() throws IOException { AdvancedReader in = new AdvancedReader(new StringReader(text)); in.skip(3); String line = in.readLine(); - assertEquals("1 toto tata tutu", line); + Assert.assertEquals("1 toto tata tutu", line); in.skip(text.length()); line = in.readLine(); - assertNull(line); + Assert.assertNull(line); } } Modified: jrst/trunk/src/test/java/org/codelutin/jrst/Compare.java =================================================================== --- jrst/trunk/src/test/java/org/codelutin/jrst/Compare.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/java/org/codelutin/jrst/Compare.java 2009-01-15 18:31:16 UTC (rev 248) @@ -1,6 +1,5 @@ -/** - * *##% JRst - * Copyright (C) 2004 - 2008 CodeLutin +/* *##% JRst + * Copyright (C) 2004 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -16,10 +15,7 @@ * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */ -/** - * Class de test pour comparer le XML de DocUtils avec celui du JRST - * - */ + package org.codelutin.jrst; import java.io.File; @@ -44,36 +40,41 @@ import org.dom4j.io.OutputFormat; import org.dom4j.io.SAXReader; import org.dom4j.io.XMLWriter; +import org.junit.Ignore; + import sdoc.*; +/** + * Class de test pour comparer le XML de DocUtils avec celui du JRST + */ +@Ignore public class Compare { + static boolean[] bColorRst; static boolean[] bColorPython; - // redefinir - // manuelement - static public void main(String[] args) throws Exception { + public static void main(String[] args) throws Exception { File source = null; if (args.length > 0) { source = new File(args[0]); - if (source != null) - parser(source); - } else + parser(source); + } else { System.err.println("Argument source manquant"); + } } private static void parser(File source) throws Exception { - URL url = source.toURL(); + URL url = source.toURI().toURL(); Reader in = new InputStreamReader(url.openStream()); JRSTReader jrst = new JRSTReader(); Document docRst = jrst.read(in); // JRST - String cmd = "rst2xml " + source.getPath(); + String cmd = "rst2xml.py " + source.getPath(); Process p = Runtime.getRuntime().exec(cmd); // Python ThreadRedirection t = new ThreadRedirection(p); t.start(); p.waitFor(); // On attend que le processus ce termine - String strPython = t.getSortit().replaceAll("null", ""); + //String strPython = t.getSortit().replaceAll("null", ""); t.stop(); p.destroy(); SAXReader sr = new SAXReader(); @@ -152,8 +153,7 @@ return nbLine; } - private static void compare(String docRst, String docPython, String diff) - throws IOException { + private static void compare(String docRst, String docPython, String diff) { JTextArea jrst = new JTextArea(); JTextArea python = new JTextArea(); jrst.setEditable(false); Modified: jrst/trunk/src/test/java/org/codelutin/jrst/GutterColor.java =================================================================== --- jrst/trunk/src/test/java/org/codelutin/jrst/GutterColor.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/java/org/codelutin/jrst/GutterColor.java 2009-01-15 18:31:16 UTC (rev 248) @@ -1,6 +1,5 @@ -/** - * *##% JRst - * Copyright (C) 2004 - 2008 CodeLutin +/* *##% JRst + * Copyright (C) 2004 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -16,34 +15,9 @@ * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */ -/** - * numerotation des lignes - * - */ + package org.codelutin.jrst; -/* - * - * Created on 1 aout 2005, 17:45 - * - * Copyright (C) 2005 Yves Zoundi - * MOdified by Jason Davis - * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - import java.awt.Color; import java.awt.Dimension; import java.awt.FontMetrics; @@ -59,11 +33,14 @@ import javax.swing.JScrollPane; import javax.swing.text.JTextComponent; +import org.junit.Ignore; + /** * A class which adds line numbering to a editor * * @author Yves Zoundi */ +@Ignore public final class GutterColor extends JLabel { /** serialVersionUID */ private static final long serialVersionUID = -4419253280014127529L; @@ -76,6 +53,8 @@ * * @param edit * the editor which has to display line numbers + * @param pane + * @param bColors */ public GutterColor(JTextComponent edit, JScrollPane pane, boolean[] bColors) { this.edit = edit; Modified: jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java =================================================================== --- jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/java/org/codelutin/jrst/JRSTGeneratorTest.java 2009-01-15 18:31:16 UTC (rev 248) @@ -1,5 +1,5 @@ /* *##% JRst - * Copyright (C) 2004 - 2008 CodeLutin + * Copyright (C) 2004 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -15,8 +15,15 @@ * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/ -/* * - * JRSTGenerator.java +package org.codelutin.jrst; + +import java.io.File; + +import org.junit.Ignore; +import org.junit.Test; + +/** + * JRSTGeneratorTest. * * Created: 31 oct. 06 11:14:19 * @@ -26,57 +33,74 @@ * Last update: $Date$ * by : $Author$ */ +public class JRSTGeneratorTest { -package org.codelutin.jrst; - -import junit.framework.TestCase; - -/** - * @author poussin - * - */ - -public class JRSTGeneratorTest extends TestCase { - + @Test public void testRstToHtml() throws Exception { - long time0 = System.currentTimeMillis(); - // test 1 : - JRST.main(new String[] { "-t", "rst", "-o", "html", "src/test/resources/test.rst", }); - System.err - .println("==================================================================="); - long time1 = System.currentTimeMillis(); + File test1 = File.createTempFile("jrst-test", ".html"); + JRST.main(new String[] { "-t", "rst", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/test.rst", }); + test1.delete(); + } + + @Test + public void testRstToHtml2() throws Exception { + File test1 = File.createTempFile("jrst-test", ".html"); + JRST.main(new String[] { "-t", "html", "--force", "-o", test1.getAbsolutePath(), "src/test/resources/text.rst" }); + test1.delete(); + } + + @Test + public void testRstToDocbook() throws Exception { - // test 2 : - JRST.main(new String[] { "-t", "html", - "src/test/resources/text.rst" }); - System.err - .println("==================================================================="); - long time2 = System.currentTimeMillis(); - - // test 3 : - // JRST.main(new String[]{"-t", "docbook", - // "src/test/resources/text.rst"}); - System.err - .println("==================================================================="); - long time3 = System.currentTimeMillis(); - - // test 4 : - // JRST.main(new String[]{"-t", "xhtml", - // "src/test/resources/text.rst"}); - System.err - .println("==================================================================="); - long time4 = System.currentTimeMillis(); - - // test 5 : - JRST.main(new String[] { "-t", "xdoc", - "src/test/resources/text.rst" }); + File test1 = File.createTempFile("jrst-test", ".dbk"); + JRST.main(new String[]{"-t", "docbook", "--force","-o", test1.getAbsolutePath(), + "src/test/resources/test.rst"}); + test1.delete(); + } + + @Test + public void testRstToXdoc() throws Exception { + File test1 = File.createTempFile("jrst-test", ".xdoc"); + JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), + "src/test/resources/test.rst" }); + test1.delete(); + } - long time5 = System.currentTimeMillis(); - - System.out.println("time generation: " + (time1 - time0) + ":" - + (time2 - time1) + ":" + (time3 - time2) + ":" - + (time4 - time3) + ":" + (time5 - time4)); + /** + * This test is not working. + * + * @throws Exception + */ + @Ignore + public void testRstToXdoc2() throws Exception { + File test1 = File.createTempFile("jrst-test", ".xdoc"); + JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), + "src/test/resources/test2.rst" }); + test1.delete(); } - + + @Test + public void testRstToXdoc3() throws Exception { + File test1 = File.createTempFile("jrst-test", ".xdoc"); + JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), + "src/test/resources/test3.rst" }); + test1.delete(); + } + + @Test + public void testRstToXdoc4() throws Exception { + File test1 = File.createTempFile("jrst-test", ".xdoc"); + JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), + "src/test/resources/test4.rst" }); + test1.delete(); + } + + @Test + public void testRstToXdocJrstSite() throws Exception { + File test1 = File.createTempFile("jrst-test", ".xdoc"); + JRST.main(new String[] { "-t", "xdoc", "--force","-o", test1.getAbsolutePath(), + "src/test/resources/frEntier.rst" }); + test1.delete(); + } } Modified: jrst/trunk/src/test/java/org/codelutin/jrst/JRSTReaderTest.java =================================================================== --- jrst/trunk/src/test/java/org/codelutin/jrst/JRSTReaderTest.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/java/org/codelutin/jrst/JRSTReaderTest.java 2009-01-15 18:31:16 UTC (rev 248) @@ -1,5 +1,5 @@ /* *##% JRst - * Copyright (C) 2004 - 2008 CodeLutin + * Copyright (C) 2004 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -15,18 +15,6 @@ * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%*/ -/* * - * JRSTReaderTest.java - * - * Created: 27 oct. 06 12:11:44 - * - * @author poussin - * @version $Revision$ - * - * Last update: $Date$ - * by : $Author$ - */ - package org.codelutin.jrst; import junit.framework.TestCase; @@ -39,10 +27,16 @@ import java.net.URL; /** + * JRSTReaderTest. + * + * Created: 27 oct. 06 12:11:44 + * * @author poussin - * + * @version $Revision$ + * + * Last update: $Date$ + * by : $Author$ */ - public class JRSTReaderTest extends TestCase { public void testRead() throws Exception { Modified: jrst/trunk/src/test/java/org/codelutin/jrst/ThreadRedirection.java =================================================================== --- jrst/trunk/src/test/java/org/codelutin/jrst/ThreadRedirection.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/java/org/codelutin/jrst/ThreadRedirection.java 2009-01-15 18:31:16 UTC (rev 248) @@ -1,6 +1,5 @@ -/** - * *##% JRst - * Copyright (C) 2004 - 2008 CodeLutin +/* *##% JRst + * Copyright (C) 2004 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -16,15 +15,16 @@ * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */ -/* - * Class qui redirige la sortie standard pour la laisser en interne - */ + package org.codelutin.jrst; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; +/** + * Class qui redirige la sortie standard pour la laisser en interne + */ public class ThreadRedirection extends Thread { String str; String errors; @@ -43,9 +43,8 @@ try { String line; while ((line = reader.readLine()) != null) { - if (line != null) { - if (!line.equals("null")) - str += "\n" + line; + if (!line.equals("null")) { + str += "\n" + line; } } @@ -55,11 +54,9 @@ try { String line; while ((line = readerErrors.readLine()) != null) { - if (line != null) { - if (!line.equals(null)) - errors += "\n" + line; + if (!line.equals(null)) { + errors += "\n" + line; } - } } finally { Modified: jrst/trunk/src/test/java/org/codelutin/jrst/XMLCaseTest.java =================================================================== --- jrst/trunk/src/test/java/org/codelutin/jrst/XMLCaseTest.java 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/java/org/codelutin/jrst/XMLCaseTest.java 2009-01-15 18:31:16 UTC (rev 248) @@ -1,6 +1,5 @@ -/** - * *##% JRst - * Copyright (C) 2004 - 2008 CodeLutin +/* *##% JRst + * Copyright (C) 2004 - 2009 CodeLutin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -16,16 +15,19 @@ * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */ -/** - * Compare les 2 xml avec XMLUnit - * - */ + package org.codelutin.jrst; import org.custommonkey.xmlunit.DetailedDiff; import org.custommonkey.xmlunit.XMLTestCase; +import org.junit.Ignore; +/** + * Compare les 2 xml avec XMLUnit. + */ +@Ignore public class XMLCaseTest extends XMLTestCase { + public XMLCaseTest(String name) { super(name); } @@ -35,7 +37,6 @@ DetailedDiff myDiff = new DetailedDiff(compareXML(myControlXML, myTestXML)); return myDiff; - } } Modified: jrst/trunk/src/test/resources/test2.rst =================================================================== --- jrst/trunk/src/test/resources/test2.rst 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/resources/test2.rst 2009-01-15 18:31:16 UTC (rev 248) @@ -308,7 +308,7 @@ .. _Docstring Processing System: http://docstring.sourceforge.net/ .. _master PEP repository: http://www.python.org/peps/ - + .. Local Variables: mode: indented-text Modified: jrst/trunk/src/test/resources/text.rst =================================================================== --- jrst/trunk/src/test/resources/text.rst 2009-01-15 18:30:52 UTC (rev 247) +++ jrst/trunk/src/test/resources/text.rst 2009-01-15 18:31:16 UTC (rev 248) @@ -6,7 +6,7 @@ subtitle ---------- -.. include:: /home/letellier/PROJET/jrst2/src/test/org/codelutin/jrst/textHeader.rst +.. include:: src/test/resources/textHeader.rst .. sectnum:: @@ -365,7 +365,7 @@ ------- .. include:: literal - /home/letellier/PROJET/jrst2/src/test/org/codelutin/jrst/textLiteral.txt + src/test/resources/textLiteral.txt la derniere ligne.
participants (1)
-
chatellier@users.labs.libre-entreprise.org