jwebunit-development Mailing List for JWebUnit (Page 9)
Brought to you by:
henryju
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(98) |
Jul
(45) |
Aug
(49) |
Sep
(90) |
Oct
(28) |
Nov
(18) |
Dec
(17) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(14) |
Feb
(21) |
Mar
(52) |
Apr
(39) |
May
(61) |
Jun
(35) |
Jul
(42) |
Aug
(31) |
Sep
(34) |
Oct
(16) |
Nov
(14) |
Dec
(61) |
| 2006 |
Jan
(39) |
Feb
(11) |
Mar
(29) |
Apr
(29) |
May
(30) |
Jun
(145) |
Jul
(61) |
Aug
(40) |
Sep
(36) |
Oct
(66) |
Nov
(50) |
Dec
(11) |
| 2007 |
Jan
(30) |
Feb
(1) |
Mar
(47) |
Apr
(9) |
May
(36) |
Jun
(13) |
Jul
(7) |
Aug
(5) |
Sep
(6) |
Oct
(3) |
Nov
(11) |
Dec
(36) |
| 2008 |
Jan
(12) |
Feb
|
Mar
(4) |
Apr
(29) |
May
(1) |
Jun
(8) |
Jul
(10) |
Aug
|
Sep
(2) |
Oct
(77) |
Nov
(107) |
Dec
(46) |
| 2009 |
Jan
(17) |
Feb
(13) |
Mar
(27) |
Apr
(5) |
May
(8) |
Jun
(17) |
Jul
(10) |
Aug
(25) |
Sep
(15) |
Oct
(4) |
Nov
(4) |
Dec
(10) |
| 2010 |
Jan
|
Feb
(6) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(5) |
Jul
(9) |
Aug
(5) |
Sep
(5) |
Oct
(63) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(9) |
Feb
(3) |
Mar
(15) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
(14) |
Sep
(15) |
Oct
(11) |
Nov
(1) |
Dec
(2) |
| 2012 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(17) |
Sep
(8) |
Oct
(1) |
Nov
(17) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
(13) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(13) |
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
|
From: <he...@us...> - 2010-10-20 12:03:20
|
Revision: 870
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=870&view=rev
Author: henryju
Date: 2010-10-20 12:03:13 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
Prevents deployment of generator module as it is not supposed to be used by end users.
Modified Paths:
--------------
trunk/jwebunit-webtestcase-generator/pom.xml
Modified: trunk/jwebunit-webtestcase-generator/pom.xml
===================================================================
--- trunk/jwebunit-webtestcase-generator/pom.xml 2010-10-20 10:02:51 UTC (rev 869)
+++ trunk/jwebunit-webtestcase-generator/pom.xml 2010-10-20 12:03:13 UTC (rev 870)
@@ -11,6 +11,8 @@
<description>A little parser that create WebTestCase from WebTester.</description>
<properties>
<topDirectoryLocation>..</topDirectoryLocation>
+ <!-- Prevents deployment as this module is not intended to be used by end-users -->
+ <maven.deploy.skip>true</maven.deploy.skip>
</properties>
<build>
<plugins>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-20 10:03:00
|
Revision: 869
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=869&view=rev
Author: henryju
Date: 2010-10-20 10:02:51 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
JUnit 4 migration part 3: restored WebTestCase generator and added a new generator for JWebUnit.
Modified Paths:
--------------
trunk/jwebunit-core/pom.xml
Added Paths:
-----------
trunk/jwebunit-webtestcase-generator/src/main/javacc/JWebUnit.jj
trunk/jwebunit-webtestcase-generator/src/main/javacc/WebTestCase.jj
Removed Paths:
-------------
trunk/jwebunit-webtestcase-generator/src/main/javacc/Java1.5.jj
Modified: trunk/jwebunit-core/pom.xml
===================================================================
--- trunk/jwebunit-core/pom.xml 2010-10-20 09:17:31 UTC (rev 868)
+++ trunk/jwebunit-core/pom.xml 2010-10-20 10:02:51 UTC (rev 869)
@@ -41,21 +41,34 @@
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
+ <id>generate-webtestcase</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
- <sourceRoot>
- ${project.build.directory}/generated-sources/main/java
- </sourceRoot>
+ <mainClass>
+ net.sourceforge.jwebunit.javacc.WebTestCaseGenerator
+ </mainClass>
</configuration>
</execution>
+ <execution>
+ <id>generate-jwebunit</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ <configuration>
+ <mainClass>
+ net.sourceforge.jwebunit.javacc.JWebUnitGenerator
+ </mainClass>
+ </configuration>
+ </execution>
</executions>
<configuration>
- <mainClass>
- net.sourceforge.jwebunit.javacc.WebTestCaseGenerator
- </mainClass>
+ <sourceRoot>
+ ${project.build.directory}/generated-sources/main/java
+ </sourceRoot>
<arguments>
<argument>${basedir}/src/main/java</argument>
<argument>
Copied: trunk/jwebunit-webtestcase-generator/src/main/javacc/JWebUnit.jj (from rev 860, trunk/jwebunit-webtestcase-generator/src/main/javacc/Java1.5.jj)
===================================================================
--- trunk/jwebunit-webtestcase-generator/src/main/javacc/JWebUnit.jj (rev 0)
+++ trunk/jwebunit-webtestcase-generator/src/main/javacc/JWebUnit.jj 2010-10-20 10:02:51 UTC (rev 869)
@@ -0,0 +1,1605 @@
+
+/*
+ * Copyright © 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has
+ * intellectual property rights relating to technology embodied in the product
+ * that is described in this document. In particular, and without limitation,
+ * these intellectual property rights may include one or more of the U.S.
+ * patents listed at http://www.sun.com/patents and one or more additional
+ * patents or pending patent applications in the U.S. and in other countries.
+ * U.S. Government Rights - Commercial software. Government users are subject
+ * to the Sun Microsystems, Inc. standard license agreement and applicable
+ * provisions of the FAR and its supplements. Use is subject to license terms.
+ * Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
+ * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. This
+ * product is covered and controlled by U.S. Export Control laws and may be
+ * subject to the export or import laws in other countries. Nuclear, missile,
+ * chemical biological weapons or nuclear maritime end uses or end users,
+ * whether direct or indirect, are strictly prohibited. Export or reexport
+ * to countries subject to U.S. embargo or to entities identified on U.S.
+ * export exclusion lists, including, but not limited to, the denied persons
+ * and specially designated nationals lists is strictly prohibited.
+ */
+
+options {
+ JAVA_UNICODE_ESCAPE = true;
+ ERROR_REPORTING = false;
+ STATIC = false;
+}
+
+PARSER_BEGIN(JWebUnitGenerator)
+package net.sourceforge.jwebunit.javacc;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * Grammar to parse Java version 1.5
+ * @author Sreenivasa Viswanadha - Simplified and enhanced for 1.5
+ */
+public class JWebUnitGenerator
+{
+ /**
+ * Class to hold modifiers.
+ */
+ static public final class ModifierSet
+ {
+ /* Definitions of the bits in the modifiers field. */
+ public static final int PUBLIC = 0x0001;
+ public static final int PROTECTED = 0x0002;
+ public static final int PRIVATE = 0x0004;
+ public static final int ABSTRACT = 0x0008;
+ public static final int STATIC = 0x0010;
+ public static final int FINAL = 0x0020;
+ public static final int SYNCHRONIZED = 0x0040;
+ public static final int NATIVE = 0x0080;
+ public static final int TRANSIENT = 0x0100;
+ public static final int VOLATILE = 0x0200;
+ public static final int STRICTFP = 0x1000;
+
+ /** A set of accessors that indicate whether the specified modifier
+ is in the set. */
+
+ public boolean isPublic(int modifiers)
+ {
+ return (modifiers & PUBLIC) != 0;
+ }
+
+ public boolean isProtected(int modifiers)
+ {
+ return (modifiers & PROTECTED) != 0;
+ }
+
+ public boolean isPrivate(int modifiers)
+ {
+ return (modifiers & PRIVATE) != 0;
+ }
+
+ public boolean isStatic(int modifiers)
+ {
+ return (modifiers & STATIC) != 0;
+ }
+
+ public boolean isAbstract(int modifiers)
+ {
+ return (modifiers & ABSTRACT) != 0;
+ }
+
+ public boolean isFinal(int modifiers)
+ {
+ return (modifiers & FINAL) != 0;
+ }
+
+ public boolean isNative(int modifiers)
+ {
+ return (modifiers & NATIVE) != 0;
+ }
+
+ public boolean isStrictfp(int modifiers)
+ {
+ return (modifiers & STRICTFP) != 0;
+ }
+
+ public boolean isSynchronized(int modifiers)
+ {
+ return (modifiers & SYNCHRONIZED) != 0;
+ }
+
+ public boolean isTransient(int modifiers)
+ {
+ return (modifiers & TRANSIENT) != 0;
+ }
+
+ public boolean isVolatile(int modifiers)
+ {
+ return (modifiers & VOLATILE) != 0;
+ }
+
+ /**
+ * Removes the given modifier.
+ */
+ static int removeModifier(int modifiers, int mod)
+ {
+ return modifiers & ~mod;
+ }
+ }
+
+ public JWebUnitGenerator(String fileName)
+ {
+ this(System.in);
+ try { ReInit(new FileInputStream(new File(fileName))); }
+ catch(Exception e) { e.printStackTrace(); }
+ }
+
+ public static void main(String args[]) {
+ JWebUnitGenerator parser;
+ StringBuffer sb = new StringBuffer();
+ String webTesterPath;
+ String webTestCasePath;
+ File inputFile;
+ File outputFile;
+ FileOutputStream output;
+ if (args.length == 2) {
+ webTesterPath = args[0] + File.separator + "net" + File.separator + "sourceforge" + File.separator + "jwebunit" + File.separator + "junit" + File.separator + "WebTester.java";
+ webTestCasePath = args[1] + File.separator + "net" + File.separator + "sourceforge" + File.separator + "jwebunit" + File.separator + "junit" + File.separator + "JWebUnit.java";
+ inputFile = new File(webTesterPath);
+ if (inputFile.exists()) {
+ System.out.println("JWebUnitGenerator: Reading from file " + webTesterPath + " . . .");
+ } else {
+ System.out.println("JWebUnitGenerator: [ERROR] File " + webTesterPath + " not found . . .");
+ return;
+ }
+
+ try {
+ parser = new JWebUnitGenerator(new java.io.FileInputStream(inputFile));
+ } catch (java.io.FileNotFoundException e) {
+ System.out.println("JWebUnitGenerator: [ERROR] File " + webTesterPath + " not found . . .");
+ return;
+ }
+ outputFile = new File(webTestCasePath);
+ if (!outputFile.getParentFile().exists() && !outputFile.getParentFile().mkdirs()) {
+ System.out.println("JWebUnitGenerator: [ERROR] Can not create output directory " + outputFile.getParentFile() + ".");
+ return;
+ }
+ try {
+ output = new java.io.FileOutputStream(outputFile);
+ } catch (java.io.FileNotFoundException e) {
+ System.out.println("JWebUnitGenerator: File " + webTestCasePath + " can not be opened.");
+ return;
+ }
+
+ } else {
+ System.out.println("JWebUnitGenerator: Usage is :");
+ System.out.println(" java JWebUnitGenerator dir_to_WebTester.java output_dir_for_JWebUnit.java");
+ return;
+ }
+ try {
+
+ parser.CompilationUnit(sb);
+ System.out.println("JWebUnitGenerator: WebTester.java parsed successfully.");
+ } catch (ParseException e) {
+ System.out.println(e.getMessage());
+ System.out.println("JWebUnitGenerator: Encountered errors during parse.");
+ }
+ try {
+ output.write(sb.toString().getBytes("UTF-8"));
+ output.close();
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
+
+PARSER_END(JWebUnitGenerator)
+
+/* WHITE SPACE */
+
+SKIP :
+{
+ " "
+| "\t"
+| "\n"
+| "\r"
+| "\f"
+}
+
+/* COMMENTS */
+
+MORE :
+{
+ "//" : IN_SINGLE_LINE_COMMENT
+|
+ <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT
+|
+ "/*" : IN_MULTI_LINE_COMMENT
+}
+
+<IN_SINGLE_LINE_COMMENT>
+SPECIAL_TOKEN :
+{
+ <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" > : DEFAULT
+}
+
+<IN_FORMAL_COMMENT>
+SPECIAL_TOKEN :
+{
+ <FORMAL_COMMENT: "*/" > : DEFAULT
+}
+
+<IN_MULTI_LINE_COMMENT>
+SPECIAL_TOKEN :
+{
+ <MULTI_LINE_COMMENT: "*/" > : DEFAULT
+}
+
+<IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT>
+MORE :
+{
+ < ~[] >
+}
+
+/* RESERVED WORDS AND LITERALS */
+
+TOKEN :
+{
+ < ABSTRACT: "abstract" >
+| < ASSERT: "assert" >
+| < BOOLEAN: "boolean" >
+| < BREAK: "break" >
+| < BYTE: "byte" >
+| < CASE: "case" >
+| < CATCH: "catch" >
+| < CHAR: "char" >
+| < CLASS: "class" >
+| < CONST: "const" >
+| < CONTINUE: "continue" >
+| < _DEFAULT: "default" >
+| < DO: "do" >
+| < DOUBLE: "double" >
+| < ELSE: "else" >
+| < ENUM: "enum" >
+| < EXTENDS: "extends" >
+| < FALSE: "false" >
+| < FINAL: "final" >
+| < FINALLY: "finally" >
+| < FLOAT: "float" >
+| < FOR: "for" >
+| < GOTO: "goto" >
+| < IF: "if" >
+| < IMPLEMENTS: "implements" >
+| < IMPORT: "import" >
+| < INSTANCEOF: "instanceof" >
+| < INT: "int" >
+| < INTERFACE: "interface" >
+| < LONG: "long" >
+| < NATIVE: "native" >
+| < NEW: "new" >
+| < NULL: "null" >
+| < PACKAGE: "package">
+| < PRIVATE: "private" >
+| < PROTECTED: "protected" >
+| < PUBLIC: "public" >
+| < RETURN: "return" >
+| < SHORT: "short" >
+| < STATIC: "static" >
+| < STRICTFP: "strictfp" >
+| < SUPER: "super" >
+| < SWITCH: "switch" >
+| < SYNCHRONIZED: "synchronized" >
+| < THIS: "this" >
+| < THROW: "throw" >
+| < THROWS: "throws" >
+| < TRANSIENT: "transient" >
+| < TRUE: "true" >
+| < TRY: "try" >
+| < VOID: "void" >
+| < VOLATILE: "volatile" >
+| < WHILE: "while" >
+}
+
+/* LITERALS */
+
+TOKEN :
+{
+ < INTEGER_LITERAL:
+ <DECIMAL_LITERAL> (["l","L"])?
+ | <HEX_LITERAL> (["l","L"])?
+ | <OCTAL_LITERAL> (["l","L"])?
+ >
+|
+ < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
+|
+ < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
+|
+ < #OCTAL_LITERAL: "0" (["0"-"7"])* >
+|
+ < FLOATING_POINT_LITERAL:
+ (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
+ | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
+ | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
+ | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
+ >
+|
+ < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
+|
+ < CHARACTER_LITERAL:
+ "'"
+ ( (~["'","\\","\n","\r"])
+ | ("\\"
+ ( ["n","t","b","r","f","\\","'","\""]
+ | ["0"-"7"] ( ["0"-"7"] )?
+ | ["0"-"3"] ["0"-"7"] ["0"-"7"]
+ )
+ )
+ )
+ "'"
+ >
+|
+ < STRING_LITERAL:
+ "\""
+ ( (~["\"","\\","\n","\r"])
+ | ("\\"
+ ( ["n","t","b","r","f","\\","'","\""]
+ | ["0"-"7"] ( ["0"-"7"] )?
+ | ["0"-"3"] ["0"-"7"] ["0"-"7"]
+ )
+ )
+ )*
+ "\""
+ >
+}
+
+/* IDENTIFIERS */
+
+TOKEN :
+{
+ < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
+|
+ < #LETTER:
+ [
+ "\u0024",
+ "\u0041"-"\u005a",
+ "\u005f",
+ "\u0061"-"\u007a",
+ "\u00c0"-"\u00d6",
+ "\u00d8"-"\u00f6",
+ "\u00f8"-"\u00ff",
+ "\u0100"-"\u1fff",
+ "\u3040"-"\u318f",
+ "\u3300"-"\u337f",
+ "\u3400"-"\u3d2d",
+ "\u4e00"-"\u9fff",
+ "\uf900"-"\ufaff"
+ ]
+ >
+|
+ < #DIGIT:
+ [
+ "\u0030"-"\u0039",
+ "\u0660"-"\u0669",
+ "\u06f0"-"\u06f9",
+ "\u0966"-"\u096f",
+ "\u09e6"-"\u09ef",
+ "\u0a66"-"\u0a6f",
+ "\u0ae6"-"\u0aef",
+ "\u0b66"-"\u0b6f",
+ "\u0be7"-"\u0bef",
+ "\u0c66"-"\u0c6f",
+ "\u0ce6"-"\u0cef",
+ "\u0d66"-"\u0d6f",
+ "\u0e50"-"\u0e59",
+ "\u0ed0"-"\u0ed9",
+ "\u1040"-"\u1049"
+ ]
+ >
+}
+
+/* SEPARATORS */
+
+TOKEN :
+{
+ < LPAREN: "(" >
+| < RPAREN: ")" >
+| < LBRACE: "{" >
+| < RBRACE: "}" >
+| < LBRACKET: "[" >
+| < RBRACKET: "]" >
+| < SEMICOLON: ";" >
+| < COMMA: "," >
+| < DOT: "." >
+| < AT: "@" >
+}
+
+/* OPERATORS */
+
+TOKEN :
+{
+ < ASSIGN: "=" >
+| < LT: "<" >
+| < BANG: "!" >
+| < TILDE: "~" >
+| < HOOK: "?" >
+| < COLON: ":" >
+| < EQ: "==" >
+| < LE: "<=" >
+| < GE: ">=" >
+| < NE: "!=" >
+| < SC_OR: "||" >
+| < SC_AND: "&&" >
+| < INCR: "++" >
+| < DECR: "--" >
+| < PLUS: "+" >
+| < MINUS: "-" >
+| < STAR: "*" >
+| < SLASH: "/" >
+| < BIT_AND: "&" >
+| < BIT_OR: "|" >
+| < XOR: "^" >
+| < REM: "%" >
+| < LSHIFT: "<<" >
+| < PLUSASSIGN: "+=" >
+| < MINUSASSIGN: "-=" >
+| < STARASSIGN: "*=" >
+| < SLASHASSIGN: "/=" >
+| < ANDASSIGN: "&=" >
+| < ORASSIGN: "|=" >
+| < XORASSIGN: "^=" >
+| < REMASSIGN: "%=" >
+| < LSHIFTASSIGN: "<<=" >
+| < RSIGNEDSHIFTASSIGN: ">>=" >
+| < RUNSIGNEDSHIFTASSIGN: ">>>=" >
+| < ELLIPSIS: "..." >
+}
+
+/* >'s need special attention due to generics syntax. */
+TOKEN :
+{
+ < RUNSIGNEDSHIFT: ">>>" >
+ {
+ matchedToken.kind = GT;
+ ((Token.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT;
+ input_stream.backup(2);
+ }
+| < RSIGNEDSHIFT: ">>" >
+ {
+ matchedToken.kind = GT;
+ ((Token.GTToken)matchedToken).realKind = RSIGNEDSHIFT;
+ input_stream.backup(1);
+ }
+| < GT: ">" >
+}
+
+
+/*****************************************
+ * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
+ *****************************************/
+
+/*
+ * Program structuring syntax follows.
+ */
+
+void CompilationUnit(StringBuffer sb):
+{}
+{
+ {sb.append(getToken(1).specialToken.image).append("\n");}
+ [ PackageDeclaration(sb) ]
+
+ {sb.append("import java.awt.Image;\n");
+ sb.append("import java.io.File;\n");
+ sb.append("import java.io.PrintStream;\n");
+ sb.append("import java.util.List;\n");
+ sb.append("import java.util.Map;\n");
+ sb.append("import java.net.URL;\n\n");
+ sb.append("import net.sourceforge.jwebunit.api.IElement;\n");
+ sb.append("import net.sourceforge.jwebunit.api.ITestingEngine;\n");
+ sb.append("import net.sourceforge.jwebunit.exception.TestingEngineResponseException;\n");
+ sb.append("import net.sourceforge.jwebunit.html.Table;\n");
+ sb.append("import net.sourceforge.jwebunit.util.TestContext;\n\n");}
+
+ ( ImportDeclaration(sb) )*
+
+ {sb.append("/**\n");
+ sb.append(" * Utility class for JUnit 4 tests which provides web application navigation and \n");
+ sb.append(" * JUnit assertions. This class uses and is generated from {@link net.sourceforge.jwebunit.junit.WebTester}.\n");
+ sb.append(" * \n");
+ sb.append(" * @author JavaCC\n");
+ sb.append(" */\n");}
+
+ ( TypeDeclaration(sb) )*
+ <EOF>
+}
+
+void PackageDeclaration(StringBuffer sb):
+{String name;}
+{
+ "package" name=Name() ";"
+ {sb.append("package ").append(name).append(";\n\n");}
+
+}
+
+void ImportDeclaration(StringBuffer sb):
+{}
+{
+ "import" [ "static" ] Name() [ "." "*" ] ";"
+}
+
+/*
+ * Modifiers. We match all modifiers in a single rule to reduce the chances of
+ * syntax errors for simple modifier mistakes. It will also enable us to give
+ * better error messages.
+ */
+
+int Modifiers():
+{
+ int modifiers = 0;
+}
+{
+ (
+ LOOKAHEAD(2)
+ (
+ "public" { modifiers |= ModifierSet.PUBLIC; }
+ |
+ "static" { modifiers |= ModifierSet.STATIC; }
+ |
+ "protected" { modifiers |= ModifierSet.PROTECTED; }
+ |
+ "private" { modifiers |= ModifierSet.PRIVATE; }
+ |
+ "final" { modifiers |= ModifierSet.FINAL; }
+ |
+ "abstract" { modifiers |= ModifierSet.ABSTRACT; }
+ |
+ "synchronized" { modifiers |= ModifierSet.SYNCHRONIZED; }
+ |
+ "native" { modifiers |= ModifierSet.NATIVE; }
+ |
+ "transient" { modifiers |= ModifierSet.TRANSIENT; }
+ |
+ "volatile" { modifiers |= ModifierSet.VOLATILE; }
+ |
+ "strictfp" { modifiers |= ModifierSet.STRICTFP; }
+ |
+ Annotation()
+ )
+ )*
+
+ {
+ return modifiers;
+ }
+}
+
+/*
+ * Declaration syntax follows.
+ */
+void TypeDeclaration(StringBuffer sb):
+{
+ int modifiers;
+}
+{
+ ";"
+|
+ modifiers = Modifiers()
+ (
+ ClassOrInterfaceDeclaration(modifiers, sb)
+ |
+ EnumDeclaration(modifiers)
+ |
+ AnnotationTypeDeclaration(modifiers)
+ )
+}
+
+
+void ClassOrInterfaceDeclaration(int modifiers, StringBuffer sb):
+{
+ boolean isInterface = false;
+}
+{
+ ( "class" | "interface" { isInterface = true; } )
+ <IDENTIFIER>
+ [ TypeParameters() ]
+ [ ExtendsList(isInterface) ]
+ [ ImplementsList(isInterface) ]
+ {sb.append("public class JWebUnit ");}
+ ClassOrInterfaceBody(isInterface, sb)
+}
+
+void ExtendsList(boolean isInterface):
+{
+ boolean extendsMoreThanOne = false;
+}
+{
+ "extends" ClassOrInterfaceType()
+ ( "," ClassOrInterfaceType() { extendsMoreThanOne = true; } )*
+ {
+ if (extendsMoreThanOne && !isInterface)
+ throw new ParseException("A class cannot extend more than one other class");
+ }
+}
+
+void ImplementsList(boolean isInterface):
+{}
+{
+ "implements" ClassOrInterfaceType()
+ ( "," ClassOrInterfaceType() )*
+ {
+ if (isInterface)
+ throw new ParseException("An interface cannot implement other interfaces");
+ }
+}
+
+void EnumDeclaration(int modifiers):
+{}
+{
+ "enum" <IDENTIFIER>
+ [ ImplementsList(false) ]
+ EnumBody()
+}
+
+void EnumBody():
+{}
+{
+ "{"
+ EnumConstant() ( "," EnumConstant() )*
+ [ ";" ( ClassOrInterfaceBodyDeclaration(false, null) )* ]
+ "}"
+}
+
+void EnumConstant():
+{}
+{
+ <IDENTIFIER> [ Arguments() ] [ ClassOrInterfaceBody(false, null) ]
+}
+
+void TypeParameters():
+{}
+{
+ "<" TypeParameter() ( "," TypeParameter() )* ">"
+}
+
+void TypeParameter():
+{}
+{
+ <IDENTIFIER> [ TypeBound() ]
+}
+
+void TypeBound():
+{}
+{
+ "extends" ClassOrInterfaceType() ( "&" ClassOrInterfaceType() )*
+}
+
+void ClassOrInterfaceBody(boolean isInterface, StringBuffer sb):
+{}
+{ {sb.append("{\n");
+ sb.append(" private static InheritableThreadLocal<WebTester> tester = new InheritableThreadLocal<WebTester>() {\n");
+ sb.append(" @Override\n");
+ sb.append(" protected WebTester childValue(WebTester parentValue) {\n");
+ sb.append(" //Create a new web tester for each child thread\n");
+ sb.append(" WebTester webTester = new WebTester();\n");
+ sb.append(" //But initialize it with parent TestContext\n");
+ sb.append(" webTester.setTestContext(parentValue.getTestContext());\n");
+ sb.append(" return webTester;\n");
+ sb.append(" }\n");
+ sb.append(" };\n\n");
+ sb.append(" private JWebUnit() {\n");
+ sb.append(" //This class should not be instanciated, but instead used statically\n");
+ sb.append(" }\n\n");
+
+ sb.append(" /**\n");
+ sb.append(" * Get internal WebTester.\n");
+ sb.append(" */\n");
+ sb.append(" public static WebTester getTester() {\n");
+ sb.append(" if (tester.get() == null) {\n");
+ sb.append(" tester.set(new WebTester());\n");
+ sb.append(" }\n");
+ sb.append(" return tester.get();\n");
+ sb.append(" }\n\n");
+
+ sb.append(" /**\n");
+ sb.append(" * Set a custom WebTester (for example your own subclass).\n");
+ sb.append(" */\n");
+ sb.append(" public static void setCustomTester(WebTester tester) {\n");
+ sb.append(" JWebUnit.tester.set(tester);\n");
+ sb.append(" }\n\n");}
+
+ "{" ( ClassOrInterfaceBodyDeclaration(isInterface, sb) )* "}"
+ {sb.append("}\n");}
+}
+
+void ClassOrInterfaceBodyDeclaration(boolean isInterface, StringBuffer sb):
+{
+ boolean isNestedInterface = false;
+ int modifiers;
+ String comment;
+}
+{
+ LOOKAHEAD(2)
+ Initializer()
+ {
+ if (isInterface)
+ throw new ParseException("An interface cannot have initializers");
+ }
+|
+ {comment=getToken(1).specialToken!=null?getToken(1).specialToken.image:"";}
+ modifiers = Modifiers() // Just get all the modifiers out of the way. If you want to do
+ // more checks, pass the modifiers down to the member
+ (
+ ClassOrInterfaceDeclaration(modifiers, sb)
+ |
+ EnumDeclaration(modifiers)
+ |
+ LOOKAHEAD( [ TypeParameters() ] <IDENTIFIER> "(" )
+ ConstructorDeclaration()
+ |
+ LOOKAHEAD( Type() <IDENTIFIER> ( "[" "]" )* ( "," | "=" | ";" ) )
+ FieldDeclaration(modifiers)
+ |
+ MethodDeclaration(modifiers, sb, comment)
+ )
+|
+ ";"
+}
+
+void FieldDeclaration(int modifiers):
+{}
+{
+ // Modifiers are already matched in the caller
+ Type() VariableDeclarator() ( "," VariableDeclarator() )* ";"
+}
+
+void VariableDeclarator():
+{}
+{
+ VariableDeclaratorId() [ "=" VariableInitializer() ]
+}
+
+String VariableDeclaratorId():
+{String result;
+ Token t;}
+{
+ t=<IDENTIFIER> {result=t.image;} ( "[" "]" {result+="[]";} )*
+ {return result;}
+}
+
+void VariableInitializer():
+{}
+{
+ ArrayInitializer()
+|
+ Expression()
+}
+
+void ArrayInitializer():
+{}
+{
+ "{" [ VariableInitializer() ( LOOKAHEAD(2) "," VariableInitializer() )* ] [ "," ] "}"
+}
+
+void MethodDeclaration(int modifiers, StringBuffer sb, String comment):
+{ boolean append;
+ String resultType;
+ List params;
+ String throwsList;
+ boolean isVoid;}
+{
+ // Modifiers already matched in the caller!
+ { append = (modifiers & ModifierSet.PUBLIC) != 0;}
+ { if (append && comment!=null) sb.append(" ").append(comment).append("\n");}
+ { if (append) sb.append(" public static ");}
+ [ TypeParameters() ]
+ isVoid=ResultType(append, sb)
+ params=MethodDeclarator(append, sb) [ "throws" throwsList=NameList() {if (append) sb.append("throws "+throwsList);} ]
+ ( Block() | ";" )
+ {if (append) {
+ sb.append(" {\n");
+ sb.append(" ");
+ if (!isVoid) sb.append("return ");
+ sb.append("getTester().").append(params.remove(0)).append("(");
+ for (Iterator i = params.iterator(); i.hasNext();) {
+ i.next();
+ sb.append(i.next());
+ if (i.hasNext()) sb.append(", ");
+ }
+ sb.append(");\n");
+ sb.append(" }\n\n");
+ }}
+}
+
+List MethodDeclarator(boolean append, StringBuffer sb):
+{Token t;
+List result;}
+{
+ t=<IDENTIFIER> {if(append) sb.append(t.image);} result=FormalParameters(append, sb) ( "[" "]" )*
+ {result.add(0, t.image); return result;}
+}
+
+List FormalParameters(boolean append, StringBuffer sb):
+{List result = new LinkedList();
+ List tmp;}
+{
+ "(" {if(append) sb.append("(");} [ tmp=FormalParameter() {result.add(tmp.get(0)); result.add(tmp.get(1)); if (append) {sb.append(tmp.get(0)).append(" ").append(tmp.get(1));}}
+ ( ","{if(append) sb.append(", ");} tmp=FormalParameter() {result.add(tmp.get(0)); result.add(tmp.get(1)); if (append) {sb.append(tmp.get(0)).append(" ").append(tmp.get(1));}} )* ] ")" {if(append) sb.append(")");}
+ {return result;}
+}
+
+List FormalParameter():
+{List result = new ArrayList();
+ String tmp;}
+{
+ [ "final" ] tmp=Type() {result.add(tmp);} [ "..." ] tmp=VariableDeclaratorId() {result.add(tmp);}
+ {return result;}
+}
+
+void ConstructorDeclaration():
+{}
+{
+ [ TypeParameters() ]
+ // Modifiers matched in the caller
+ <IDENTIFIER> FormalParameters(false, null) [ "throws" NameList() ]
+ "{"
+ [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
+ ( BlockStatement() )*
+ "}"
+}
+
+void ExplicitConstructorInvocation():
+{}
+{
+ LOOKAHEAD("this" Arguments() ";")
+ "this" Arguments() ";"
+|
+ [ LOOKAHEAD(2) PrimaryExpression() "." ] "super" Arguments() ";"
+}
+
+void Initializer():
+{}
+{
+ [ "static" ] Block()
+}
+
+
+/*
+ * Type, name and expression syntax follows.
+ */
+
+String Type():
+{String s;}
+{
+ (LOOKAHEAD(2) s=ReferenceType()
+ |
+ s=PrimitiveType())
+ {return s;}
+}
+
+String ReferenceType():
+{String result;}
+{
+ (result=PrimitiveType() ( LOOKAHEAD(2) "[" "]" {result+="[]";} )+
+ |
+ ( result=ClassOrInterfaceType() ) ( LOOKAHEAD(2) "[" "]" {result+="[]";} )*)
+ {return result;}
+}
+
+String ClassOrInterfaceType():
+{String result="";
+ String result2="";
+ Token t;}
+{
+ t=<IDENTIFIER> {result=t.image;} [ LOOKAHEAD(2) result2=TypeArguments() ]
+ ( LOOKAHEAD(2) "." <IDENTIFIER> [ LOOKAHEAD(2) TypeArguments() ] )*
+ {return result+result2;}
+}
+
+String TypeArguments():
+{String resultTmp;
+ StringBuffer sb = new StringBuffer();}
+{
+ "<" {sb.append("<");} resultTmp=TypeArgument() {sb.append(resultTmp);} ( "," {sb.append(",");} resultTmp=TypeArgument() {sb.append(resultTmp);} )* ">" {sb.append(">");}
+ {return sb.toString();}
+}
+
+String TypeArgument():
+{String resultTmp = "";
+ StringBuffer sb = new StringBuffer();}
+{
+ (resultTmp=ReferenceType() {sb.append(resultTmp);}
+ |
+ "?" {sb.append("?");} [ resultTmp=WildcardBounds() {sb.append(resultTmp);} ])
+ {return sb.toString();}
+}
+
+String WildcardBounds():
+{String resultTmp = "";
+ StringBuffer sb = new StringBuffer();}
+{
+ "extends" {sb.append("extends");} resultTmp=ReferenceType() {sb.append(resultTmp);}
+ |
+ "super" {sb.append("super");} resultTmp=ReferenceType() {sb.append(resultTmp);}
+ {return sb.toString();}
+}
+
+
+String PrimitiveType():
+{}
+{
+ "boolean" {return "boolean";}
+|
+ "char" {return "char";}
+|
+ "byte" {return "byte";}
+|
+ "short" {return "short";}
+|
+ "int" {return "int";}
+|
+ "long" {return "long";}
+|
+ "float" {return "float";}
+|
+ "double" {return "double";}
+}
+
+boolean ResultType(boolean append, StringBuffer sb):
+{String result;}
+{
+ "void" {if (append) sb.append("void "); return true;}
+|
+ result=Type() {if (append) sb.append(result+" "); return false;}
+}
+
+String Name():
+/*
+ * A lookahead of 2 is required below since "Name" can be followed
+ * by a ".*" when used in the context of an "ImportDeclaration".
+ */
+{String name = "";
+Token t;}
+{
+ t=<IDENTIFIER>
+ {name+=t.image;}
+ ( LOOKAHEAD(2) "." t=<IDENTIFIER> {name+="."+t.image;} )*
+ {return name;}
+}
+
+String NameList():
+{String result, tmp;}
+{
+ result=Name() ( "," tmp=Name() {result+=", "+tmp;} )*
+ {return result;}
+}
+
+
+/*
+ * Expression syntax follows.
+ */
+
+void Expression():
+/*
+ * This expansion has been written this way instead of:
+ * Assignment() | ConditionalExpression()
+ * for performance reasons.
+ * However, it is a weakening of the grammar for it allows the LHS of
+ * assignments to be any conditional expression whereas it can only be
+ * a primary expression. Consider adding a semantic predicate to work
+ * around this.
+ */
+{}
+{
+ ConditionalExpression()
+ [
+ LOOKAHEAD(2)
+ AssignmentOperator() Expression()
+ ]
+}
+
+void AssignmentOperator():
+{}
+{
+ "=" | "*=" | "/=" | "%=" | "+=" | "-=" | "<<=" | ">>=" | ">>>=" | "&=" | "^=" | "|="
+}
+
+void ConditionalExpression():
+{}
+{
+ ConditionalOrExpression() [ "?" Expression() ":" Expression() ]
+}
+
+void ConditionalOrExpression():
+{}
+{
+ ConditionalAndExpression() ( "||" ConditionalAndExpression() )*
+}
+
+void ConditionalAndExpression():
+{}
+{
+ InclusiveOrExpression() ( "&&" InclusiveOrExpression() )*
+}
+
+void InclusiveOrExpression():
+{}
+{
+ ExclusiveOrExpression() ( "|" ExclusiveOrExpression() )*
+}
+
+void ExclusiveOrExpression():
+{}
+{
+ AndExpression() ( "^" AndExpression() )*
+}
+
+void AndExpression():
+{}
+{
+ EqualityExpression() ( "&" EqualityExpression() )*
+}
+
+void EqualityExpression():
+{}
+{
+ InstanceOfExpression() ( ( "==" | "!=" ) InstanceOfExpression() )*
+}
+
+void InstanceOfExpression():
+{}
+{
+ RelationalExpression() [ "instanceof" Type() ]
+}
+
+void RelationalExpression():
+{}
+{
+ ShiftExpression() ( ( "<" | ">" | "<=" | ">=" ) ShiftExpression() )*
+}
+
+void ShiftExpression():
+{}
+{
+ AdditiveExpression() ( ( "<<" | RSIGNEDSHIFT() | RUNSIGNEDSHIFT() ) AdditiveExpression() )*
+}
+
+void AdditiveExpression():
+{}
+{
+ MultiplicativeExpression() ( ( "+" | "-" ) MultiplicativeExpression() )*
+}
+
+void MultiplicativeExpression():
+{}
+{
+ UnaryExpression() ( ( "*" | "/" | "%" ) UnaryExpression() )*
+}
+
+void UnaryExpression():
+{}
+{
+ ( "+" | "-" ) UnaryExpression()
+|
+ PreIncrementExpression()
+|
+ PreDecrementExpression()
+|
+ UnaryExpressionNotPlusMinus()
+}
+
+void PreIncrementExpression():
+{}
+{
+ "++" PrimaryExpression()
+}
+
+void PreDecrementExpression():
+{}
+{
+ "--" PrimaryExpression()
+}
+
+void UnaryExpressionNotPlusMinus():
+{}
+{
+ ( "~" | "!" ) UnaryExpression()
+|
+ LOOKAHEAD( CastLookahead() )
+ CastExpression()
+|
+ PostfixExpression()
+}
+
+// This production is to determine lookahead only. The LOOKAHEAD specifications
+// below are not used, but they are there just to indicate that we know about
+// this.
+void CastLookahead():
+{}
+{
+ LOOKAHEAD(2)
+ "(" PrimitiveType()
+|
+ LOOKAHEAD("(" Type() "[")
+ "(" Type() "[" "]"
+|
+ "(" Type() ")" ( "~" | "!" | "(" | <IDENTIFIER> | "this" | "super" | "new" | Literal() )
+}
+
+void PostfixExpression():
+{}
+{
+ PrimaryExpression() [ "++" | "--" ]
+}
+
+void CastExpression():
+{}
+{
+ LOOKAHEAD("(" PrimitiveType())
+ "(" Type() ")" UnaryExpression()
+|
+ "(" Type() ")" UnaryExpressionNotPlusMinus()
+}
+
+void PrimaryExpression():
+{}
+{
+ PrimaryPrefix() ( LOOKAHEAD(2) PrimarySuffix() )*
+}
+
+void MemberSelector():
+{}
+{
+ "." TypeArguments() <IDENTIFIER>
+}
+
+void PrimaryPrefix():
+{}
+{
+ Literal()
+|
+ "this"
+|
+ "super" "." <IDENTIFIER>
+|
+ "(" Expression() ")"
+|
+ AllocationExpression()
+|
+ LOOKAHEAD( ResultType(false, null) "." "class" )
+ ResultType(false, null) "." "class"
+|
+ Name()
+}
+
+void PrimarySuffix():
+{}
+{
+ LOOKAHEAD(2)
+ "." "this"
+|
+ LOOKAHEAD(2)
+ "." AllocationExpression()
+|
+ LOOKAHEAD(3)
+ MemberSelector()
+|
+ "[" Expression() "]"
+|
+ "." <IDENTIFIER>
+|
+ Arguments()
+}
+
+void Literal():
+{}
+{
+ <INTEGER_LITERAL>
+|
+ <FLOATING_POINT_LITERAL>
+|
+ <CHARACTER_LITERAL>
+|
+ <STRING_LITERAL>
+|
+ BooleanLiteral()
+|
+ NullLiteral()
+}
+
+void BooleanLiteral():
+{}
+{
+ "true"
+|
+ "false"
+}
+
+void NullLiteral():
+{}
+{
+ "null"
+}
+
+void Arguments():
+{}
+{
+ "(" [ ArgumentList() ] ")"
+}
+
+void ArgumentList():
+{}
+{
+ Expression() ( "," Expression() )*
+}
+
+void AllocationExpression():
+{}
+{
+ LOOKAHEAD(2)
+ "new" PrimitiveType() ArrayDimsAndInits()
+|
+ "new" ClassOrInterfaceType() [ TypeArguments() ]
+ (
+ ArrayDimsAndInits()
+ |
+ Arguments() [ ClassOrInterfaceBody(false, null) ]
+ )
+}
+
+/*
+ * The third LOOKAHEAD specification below is to parse to PrimarySuffix
+ * if there is an expression between the "[...]".
+ */
+void ArrayDimsAndInits():
+{}
+{
+ LOOKAHEAD(2)
+ ( LOOKAHEAD(2) "[" Expression() "]" )+ ( LOOKAHEAD(2) "[" "]" )*
+|
+ ( "[" "]" )+ ArrayInitializer()
+}
+
+
+/*
+ * Statement syntax follows.
+ */
+
+void Statement():
+{}
+{
+ LOOKAHEAD(2)
+ LabeledStatement()
+|
+ AssertStatement()
+|
+ Block()
+|
+ EmptyStatement()
+|
+ StatementExpression() ";"
+|
+ SwitchStatement()
+|
+ IfStatement()
+|
+ WhileStatement()
+|
+ DoStatement()
+|
+ ForStatement()
+|
+ BreakStatement()
+|
+ ContinueStatement()
+|
+ ReturnStatement()
+|
+ ThrowStatement()
+|
+ SynchronizedStatement()
+|
+ TryStatement()
+}
+
+void AssertStatement():
+{}
+{
+ "assert" Expression() [ ":" Expression() ] ";"
+}
+
+void LabeledStatement():
+{}
+{
+ <IDENTIFIER> ":" Statement()
+}
+
+void Block():
+{}
+{
+ "{" ( BlockStatement() )* "}"
+}
+
+void BlockStatement():
+{}
+{
+ LOOKAHEAD([ "final" ] Type() <IDENTIFIER>)
+ LocalVariableDeclaration() ";"
+|
+ Statement()
+|
+ ClassOrInterfaceDeclaration(0, null)
+}
+
+void LocalVariableDeclaration():
+{}
+{
+ [ "final" ] Type() VariableDeclarator() ( "," VariableDeclarator() )*
+}
+
+void EmptyStatement():
+{}
+{
+ ";"
+}
+
+void StatementExpression():
+/*
+ * The last expansion of this production accepts more than the legal
+ * Java expansions for StatementExpression. This expansion does not
+ * use PostfixExpression for performance reasons.
+ */
+{}
+{
+ PreIncrementExpression()
+|
+ PreDecrementExpression()
+|
+ PrimaryExpression()
+ [
+ "++"
+ |
+ "--"
+ |
+ AssignmentOperator() Expression()
+ ]
+}
+
+void SwitchStatement():
+{}
+{
+ "switch" "(" Expression() ")" "{"
+ ( SwitchLabel() ( BlockStatement() )* )*
+ "}"
+}
+
+void SwitchLabel():
+{}
+{
+ "case" Expression() ":"
+|
+ "default" ":"
+}
+
+void IfStatement():
+/*
+ * The disambiguating algorithm of JavaCC automatically binds dangling
+ * else's to the innermost if statement. The LOOKAHEAD specification
+ * is to tell JavaCC that we know what we are doing.
+ */
+{}
+{
+ "if" "(" Expression() ")" Statement() [ LOOKAHEAD(1) "else" Statement() ]
+}
+
+void WhileStatement():
+{}
+{
+ "while" "(" Expression() ")" Statement()
+}
+
+void DoStatement():
+{}
+{
+ "do" Statement() "while" "(" Expression() ")" ";"
+}
+
+void ForStatement():
+{}
+{
+ "for" "("
+
+ (
+ LOOKAHEAD(Type() <IDENTIFIER> ":")
+ Type() <IDENTIFIER> ":" Expression()
+ |
+ [ ForInit() ] ";" [ Expression() ] ";" [ ForUpdate() ]
+ )
+
+ ")" Statement()
+}
+
+void ForInit():
+{}
+{
+ LOOKAHEAD( [ "final" ] Type() <IDENTIFIER> )
+ LocalVariableDeclaration()
+|
+ StatementExpressionList()
+}
+
+void StatementExpressionList():
+{}
+{
+ StatementExpression() ( "," StatementExpression() )*
+}
+
+void ForUpdate():
+{}
+{
+ StatementExpressionList()
+}
+
+void BreakStatement():
+{}
+{
+ "break" [ <IDENTIFIER> ] ";"
+}
+
+void ContinueStatement():
+{}
+{
+ "continue" [ <IDENTIFIER> ] ";"
+}
+
+void ReturnStatement():
+{}
+{
+ "return" [ Expression() ] ";"
+}
+
+void ThrowStatement():
+{}
+{
+ "throw" Expression() ";"
+}
+
+void SynchronizedStatement():
+{}
+{
+ "synchronized" "(" Expression() ")" Block()
+}
+
+void TryStatement():
+/*
+ * Semantic check required here to make sure that at least one
+ * finally/catch is present.
+ */
+{}
+{
+ "try" Block()
+ ( "catch" "(" FormalParameter() ")" Block() )*
+ [ "finally" Block() ]
+}
+
+/* We use productions to match >>>, >> and > so that we can keep the
+ * type declaration syntax with generics clean
+ */
+
+void RUNSIGNEDSHIFT():
+{}
+{
+ ( LOOKAHEAD({ getToken(1).kind == GT &&
+ ((Token.GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT} )
+ ">" ">" ">"
+ )
+}
+
+void RSIGNEDSHIFT():
+{}
+{
+ ( LOOKAHEAD({ getToken(1).kind == GT &&
+ ((Token.GTToken)getToken(1)).realKind == RSIGNEDSHIFT} )
+ ">" ">"
+ )
+}
+
+/* Annotation syntax follows. */
+
+void Annotation():
+{}
+{
+ LOOKAHEAD( "@" Name() "(" ( <IDENTIFIER> "=" | ")" ))
+ NormalAnnotation()
+ |
+ LOOKAHEAD( "@" Name() "(" )
+ SingleMemberAnnotation()
+ |
+ MarkerAnnotation()
+}
+
+void NormalAnnotation():
+{}
+{
+ "@" Name() "(" [ MemberValuePairs() ] ")"
+}
+
+void MarkerAnnotation():
+{}
+{
+ "@" Name()
+}
+
+void SingleMemberAnnotation():
+{}
+{
+ "@" Name() "(" MemberValue() ")"
+}
+
+void MemberValuePairs():
+{}
+{
+ MemberValuePair() ( "," MemberValuePair() )*
+}
+
+void MemberValuePair():
+{}
+{
+ <IDENTIFIER> "=" MemberValue()
+}
+
+void MemberValue():
+{}
+{
+ Annotation()
+ |
+ MemberValueArrayInitializer()
+ |
+ ConditionalExpression()
+}
+
+void MemberValueArrayInitializer():
+{}
+{
+ "{" MemberValue() ( LOOKAHEAD(2) "," MemberValue() )* [ "," ] "}"
+}
+
+
+/* Annotation Types. */
+
+void AnnotationTypeDeclaration(int modifiers):
+{}
+{
+ "@" "interface" <IDENTIFIER> AnnotationTypeBody()
+}
+
+void AnnotationTypeBody():
+{}
+{
+ "{" ( AnnotationTypeMemberDeclaration() )* "}"
+}
+
+void AnnotationTypeMemberDeclaration():
+{
+ int modifiers;
+}
+{
+ modifiers = Modifiers()
+ (
+ LOOKAHEAD(Type() <IDENTIFIER> "(")
+ Type() <IDENTIFIER> "(" ")" [ DefaultValue() ] ";"
+ |
+ ClassOrInterfaceDeclaration(modifiers, null)
+ |
+ EnumDeclaration(modifiers)
+ |
+ AnnotationTypeDeclaration(modifiers)
+ |
+ FieldDeclaration(modifiers)
+ )
+ |
+ ( ";" )
+}
+
+void DefaultValue():
+{}
+{
+ "default" MemberValue()
+}
Deleted: trunk/jwebunit-webtestcase-generator/src/main/javacc/Java1.5.jj
===================================================================
--- trunk/jwebunit-webtestcase-generator/src/main/javacc/Java1.5.jj 2010-10-20 09:17:31 UTC (rev 868)
+++ trunk/jwebunit-webtestcase-generator/src/main/javacc/Java1.5.jj 2010-10-20 10:02:51 UTC (rev 869)
@@ -1,1605 +0,0 @@
-
-/*
- * Copyright © 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has
- * intellectual property rights relating to technology embodied in the product
- * that is described in this document. In particular, and without limitation,
- * these intellectual property rights may include one or more of the U.S.
- * patents listed at http://www.sun.com/patents and one or more additional
- * patents or pending patent applications in the U.S. and in other countries.
- * U.S. Government Rights - Commercial software. Government users are subject
- * to the Sun Microsystems, Inc. standard license agreement and applicable
- * provisions of the FAR and its supplements. Use is subject to license terms.
- * Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
- * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. This
- * product is covered and controlled by U.S. Export Control laws and may be
- * subject to the export or import laws in other countries. Nuclear, missile,
- * chemical biological weapons or nuclear maritime end uses or end users,
- * whether direct or indirect, are strictly prohibited. Export or reexport
- * to countries subject to U.S. embargo or to entities identified on U.S.
- * export exclusion lists, including, but not limited to, the denied persons
- * and specially designated nationals lists is strictly prohibited.
- */
-
-options {
- JAVA_UNICODE_ESCAPE = true;
- ERROR_REPORTING = false;
- STATIC = false;
-}
-
-PARSER_BEGIN(WebTestCaseGenerator)
-package net.sourceforge.jwebunit.javacc;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Grammar to parse Java version 1.5
- * @author Sreenivasa Viswanadha - Simplified and enhanced for 1.5
- */
-public class WebTestCaseGenerator
-{
- /**
- * Class to hold modifiers.
- */
- static public final class ModifierSet
- {
- /* Definitions of the bits in the modifiers field. */
- public static final int PUBLIC = 0x0001;
- public static final int PROTECTED = 0x0002;
- public static final int PRIVATE = 0x0004;
- public static final int ABSTRACT = 0x0008;
- public static final int STATIC = 0x0010;
- public static final int FINAL = 0x0020;
- public static final int SYNCHRONIZED = 0x0040;
- public static final int NATIVE = 0x0080;
- public static final int TRANSIENT = 0x0100;
- public static final int VOLATILE = 0x0200;
- public static final int STRICTFP = 0x1000;
-
- /** A set of accessors that indicate whether the specified modifier
- is in the set. */
-
- public boolean isPublic(int modifiers)
- {
- return (modifiers & PUBLIC) != 0;
- }
-
- public boolean isProtected(int modifiers)
- {
- return (modifiers & PROTECTED) != 0;
- }
-
- public boolean isPrivate(int modifiers)
- {
- return (modifiers & PRIVATE) != 0;
- }
-
- public boolean isStatic(int modifiers)
- {
- return (modifiers & STATIC) != 0;
- }
-
- public boolean isAbstract(int modifiers)
- {
- return (modifiers & ABSTRACT) != 0;
- }
-
- public boolean isFinal(int modifiers)
- {
- return (modifiers & FINAL) != 0;
- }
-
- public boolean isNative(int modifiers)
- {
- return (modifiers & NATIVE) != 0;
- }
-
- public boolean isStrictfp(int modifiers)
- {
- return (modifiers & STRICTFP) != 0;
- }
-
- public boolean isSynchronized(int modifiers)
- {
- return (modifiers & SYNCHRONIZED) != 0;
- }
-
- public boolean isTransient(int modifiers)
- {
- return (modifiers & TRANSIENT) != 0;
- }
-
- public boolean isVolatile(int modifiers)
- {
- return (modifiers & VOLATILE) != 0;
- }
-
- /**
- * Removes the given modifier.
- */
- static int removeModifier(int modifiers, int mod)
- {
- return modifiers & ~mod;
- }
- }
-
- public WebTestCaseGenerator(String fileName)
- {
- this(System.in);
- try { ReInit(new FileInputStream(new File(fileName))); }
- catch(Exception e) { e.printStackTrace(); }
- }
-
- public static void main(String args[]) {
- WebTestCaseGenerator parser;
- StringBuffer sb = new StringBuffer();
- String webTesterPath;
- String webTestCasePath;
- File inputFile;
- File outputFile;
- FileOutputStream output;
- if (args.length == 2) {
- webTesterPath = args[0] + File.separator + "net" + File.separator + "sourceforge" + File.separator + "jwebunit" + File.separator + "junit" + File.separator + "WebTester.java";
- webTestCasePath = args[1] + File.separator + "net" + File.separator + "sourceforge" + File.separator + "jwebunit" + File.separator + "junit" + File.separator + "JWebUnit.java";
- inputFile = new File(webTesterPath);
- if (inputFile.exists()) {
- System.out.println("WebTestCaseGenerator: Reading from file " + webTesterPath + " . . .");
- } else {
- System.out.println("WebTestCaseGenerator: [ERROR] File " + webTesterPath + " not found . . .");
- return;
- }
-
- try {
- parser = new WebTestCaseGenerator(new java.io.FileInputStream(inputFile));
- } catch (java.io.FileNotFoundException e) {
- System.out.println("WebTestCaseGenerator: [ERROR] File " + webTesterPath + " not found . . .");
- return;
- }
- outputFile = new File(webTestCasePath);
- if (!outputFile.getParentFile().exists() && !outputFile.getParentFile().mkdirs()) {
- System.out.println("WebTestCaseGenerator: [ERROR] Can not create output directory " + outputFile.getParentFile() + ".");
- return;
- }
- try {
- output = new java.io.FileOutputStream(outputFile);
- } catch (java.io.FileNotFoundException e) {
- System.out.println("WebTestCaseGenerator: File " + webTestCasePath + " can not be opened.");
- return;
- }
-
- } else {
- System.out.println("WebTestCaseGenerator: Usage is :");
- System.out.println(" java WebTestCaseGenerator dir_to_WebTester.java output_dir_for_WebTestCase.java");
- return;
- }
- try {
-
- parser.CompilationUnit(sb);
- System.out.println("WebTestCaseGenerator: WebTester.java parsed successfully.");
- } catch (ParseException e) {
- System.out.println(e.getMessage());
- System.out.println("WebTestCaseGenerator: Encountered errors during parse.");
- }
- try {
- output.write(sb.toString().getBytes("UTF-8"));
- output.close();
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
-}
-
-PARSER_END(WebTestCaseGenerator)
-
-/* WHITE SPACE */
-
-SKIP :
-{
- " "
-| "\t"
-| "\n"
-| "\r"
-| "\f"
-}
-
-/* COMMENTS */
-
-MORE :
-{
- "//" : IN_SINGLE_LINE_COMMENT
-|
- <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT
-|
- "/*" : IN_MULTI_LINE_COMMENT
-}
-
-<IN_SINGLE_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
- <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" > : DEFAULT
-}
-
-<IN_FORMAL_COMMENT>
-SPECIAL_TOKEN :
-{
- <FORMAL_COMMENT: "*/" > : DEFAULT
-}
-
-<IN_MULTI_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
- <MULTI_LINE_COMMENT: "*/" > : DEFAULT
-}
-
-<IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT>
-MORE :
-{
- < ~[] >
-}
-
-/* RESERVED WORDS AND LITERALS */
-
-TOKEN :
-{
- < ABSTRACT: "abstract" >
-| < ASSERT: "assert" >
-| < BOOLEAN: "boolean" >
-| < BREAK: "break" >
-| < BYTE: "byte" >
-| < CASE: "case" >
-| < CATCH: "catch" >
-| < CHAR: "char" >
-| < CLASS: "class" >
-| < CONST: "const" >
-| < CONTINUE: "continue" >
-| < _DEFAULT: "default" >
-| < DO: "do" >
-| < DOUBLE: "double" >
-| < ELSE: "else" >
-| < ENUM: "enum" >
-| < EXTENDS: "extends" >
-| < FALSE: "false" >
-| < FINAL: "final" >
-| < FINALLY: "finally" >
-| < FLOAT: "float" >
-| < FOR: "for" >
-| < GOTO: "goto" >
-| < IF: "if" >
-| < IMPLEMENTS: "implements" >
-| < IMPORT: "import" >
-| < INSTANCEOF: "instanceof" >
-| < INT: "int" >
-| < INTERFACE: "interface" >
-| < LONG: "long" >
-| < NATIVE: "native" >
-| < NEW: "new" >
-| < NULL: "null" >
-| < PACKAGE: "package">
-| < PRIVATE: "private" >
-| < PROTECTED: "protected" >
-| < PUBLIC: "public" >
-| < RETURN: "return" >
-| < SHORT: "short" >
-| < STATIC: "static" >
-| < STRICTFP: "strictfp" >
-| < SUPER: "super" >
-| < SWITCH: "switch" >
-| < SYNCHRONIZED: "synchronized" >
-| < THIS: "this" >
-| < THROW: "throw" >
-| < THROWS: "throws" >
-| < TRANSIENT: "transient" >
-| < TRUE: "true" >
-| < TRY: "try" >
-| < VOID: "void" >
-| < VOLATILE: "volatile" >
-| < WHILE: "while" >
-}
-
-/* LITERALS */
-
-TOKEN :
-{
- < INTEGER_LITERAL:
- <DECIMAL_LITERAL> (["l","L"])?
- | <HEX_LITERAL> (["l","L"])?
- | <OCTAL_LITERAL> (["l","L"])?
- >
-|
- < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
-|
- < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
-|
- < #OCTAL_LITERAL: "0" (["0"-"7"])* >
-|
- < FLOATING_POINT_LITERAL:
- (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
- | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
- | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
- | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
- >
-|
- < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
-|
- < CHARACTER_LITERAL:
- "'"
- ( (~["'","\\","\n","\r"])
- | ("\\"
- ( ["n","t","b","r","f","\\","'","\""]
- | ["0"-"7"] ( ["0"-"7"] )?
- | ["0"-"3"] ["0"-"7"] ["0"-"7"]
- )
- )
- )
- "'"
- >
-|
- < STRING_LITERAL:
- "\""
- ( (~["\"","\\","\n","\r"])
- | ("\\"
- ( ["n","t","b","r","f","\\","'","\""]
- | ["0"-"7"] ( ["0"-"7"] )?
- | ["0"-"3"] ["0"-"7"] ["0"-"7"]
- )
- )
- )*
- "\""
- >
-}
-
-/* IDENTIFIERS */
-
-TOKEN :
-{
- < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
-|
- < #LETTER:
- [
- "\u0024",
- "\u0041"-"\u005a",
- "\u005f",
- "\u0061"-"\u007a",
- "\u00c0"-"\u00d6",
- "\u00d8"-"\u00f6",
- "\u00f8"-"\u00ff",
- "\u0100"-"\u1fff",
- "\u3040"-"\u318f",
- "\u3300"-"\u337f",
- "\u3400"-"\u3d2d",
- "\u4e00"-"\u9fff",
- "\uf900"-"\ufaff"
- ]
- >
-|
- < #DIGIT:
- [
- "\u0030"-"\u0039",
- "\u0660"-"\u0669",
- "\u06f0"-"\u06f9",
- "\u0966"-"\u096f",
- "\u09e6"-"\u09ef",
- "\u0a66"-"\u0a6f",
- "\u0ae6"-"\u0aef",
- "\u0b66"-"\u0b6f",
- "\u0be7"-"\u0bef",
- "\u0c66"-"\u0c6f",
- "\u0ce6"-"\u0cef",
- "\u0d66"-"\u0d6f",
- "\u0e50"-"\u0e59",
- "\u0ed0"-"\u0ed9",
- "\u1040"-"\u1049"
- ]
- >
-}
-
-/* SEPARATORS */
-
-TOKEN :
-{
- < LPAREN: "(" >
-| < RPAREN: ")" >
-| < LBRACE: "{" >
-| < RBRACE: "}" >
-| < LBRACKET: "[" >
-| < RBRACKET: "]" >
-| < SEMICOLON: ";" >
-| < COMMA: "," >
-| < DOT: "." >
-| < AT: "@" >
-}
-
-/* OPERATORS */
-
-TOKEN :
-{
- < ASSIGN: "=" >
-| < LT: "<" >
-| < BANG: "!" >
-| < TILDE: "~" >
-| < HOOK: "?" >
-| < COLON: ":" >
-| < EQ: "==" >
-| < LE: "<=" >
-| < GE: ">=" >
-| < NE: "!=" >
-| < SC_OR: "||" >
-| < SC_AND: "&&" >
-| < INCR: "++" >
-| < DECR: "--" >
-| < PLUS: "+" >
-| < MINUS: "-" >
-| < STAR: "*" >
-| < SLASH: "/" >
-| < BIT_AND: "&" >
-| < BIT_OR: "|" >
-| < XOR: "^" >
-| < REM: "%" >
-| < LSHIFT: "<<" >
-| < PLUSASSIGN: "+=" >
-| < MINUSASSIGN: "-=" >
-| < STARASSIGN: "*=" >
-| < SLASHASSIGN: "/=" >
-| < ANDASSIGN: "&=" >
-| < ORASSIGN: "|=" >
-| < XORASSIGN: "^=" >
-| < REMASSIGN: "%=" >
-| < LSHIFTASSIGN: "<<=" >
-| < RSIGNEDSHIFTASSIGN: ">>=" >
-| < RUNSIGNEDSHIFTASSIGN: ">>>=" >
-| < ELLIPSIS: "..." >
-}
-
-/* >'s need special attention due to generics syntax. */
-TOKEN :
-{
- < RUNSIGNEDSHIFT: ">>>" >
- {
- matchedToken.kind = GT;
- ((Token.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT;
- input_stream.backup(2);
- }
-| < RSIGNEDSHIFT: ">>" >
- {
- matchedToken.kind = GT;
- ((Token.GTToken)matchedToken).realKind = RSIGNEDSHIFT;
- input_stream.backup(1);
- }
-| < GT: ">" >
-}
-
-
-/*****************************************
- * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
- *****************************************/
-
-/*
- * Program structuring syntax follows.
- */
-
-void CompilationUnit(StringBuffer sb):
-{}
-{
- {sb.append(getToken(1).specialToken.image).append("\n");}
- [ PackageDeclaration(sb) ]
-
- {sb.append("import java.awt.Image;\n");
- sb.append("import java.io.File;\n");
- sb.append("import java.io.PrintStream;\n");
- sb.append("import java.util.List;\n");
- sb.append("import java.util.Map;\n");
- sb.append("import java.net.URL;\n\n");
- sb.append("import net.sourceforge.jwebunit.api.IElement;\n");
- sb.append("import net.sourceforge.jwebunit.api.ITestingEngine;\n");
- sb.append("import net.sourceforge.jwebunit.exception.TestingEngineResponseException;\n");
- sb.append("import net.sourceforge.jwebunit.html.Table;\n");
- sb.append("import net.sourceforge.jwebunit.util.TestContext;\n\n");}
-
- ( ImportDeclaration(sb) )*
-
- {sb.append("/**\n");
- sb.append(" * Utility class for JUnit 4 tests which provides web application navigation and \n");
- sb.append(" * JUnit assertions. This class uses and is generated from {@link net.sourceforge.jwebunit.junit.WebTester}.\n");
- sb.append(" * \n");
- sb.append(" * @author JavaCC\n");
- sb.append(" */\n");}
-
- ( TypeDeclaration(sb) )*
- <EOF>
-}
-
-void PackageDeclaration(StringBuffer sb):
-{String name;}
-{
- "package" name=Name() ";"
- {sb.append("package ").append(name).append(";\n\n");}
-
-}
-
-void ImportDeclaration(StringBuffer sb):
-{}
-{
- "import" [ "static" ] Name() [ "." "*" ] ";"
-}
-
-/*
- * Modifiers. We match all modifiers in a single rule to reduce the chances of
- * syntax errors for simple modifier mistakes. It will also enable us to give
- * better error messages.
- */
-
-int Modifiers():
-{
- int modifiers = 0;
-}
-{
- (
- LOOKAHEAD(2)
- (
- "public" { modifiers |= ModifierSet.PUBLIC; }
- |
- "static" { modifiers |= ModifierSet.STATIC; }
- |
- "protected" { modifiers |= ModifierSet.PROTECTED; }
- |
- "private" { modifiers |= ModifierSet.PRIVATE; }
- |
- "final" { modifiers |= ModifierSet.FINAL; }
- |
- "abstract" { modifiers |= ModifierSet.ABSTRACT; }
- |
- "synchronized" { modifiers |= ModifierSet.SYNCHRONIZED; }
- |
- "native" { modifiers |= ModifierSet.NATIVE; }
- |
- "transient" { modifiers |= ModifierSet.TRANSIENT; }
- |
- "volatile" { modifiers |= ModifierSet.VOLATILE; }
- |
- "strictfp" { modifiers |= ModifierSet.STRICTFP; }
- |
- Annotation()
- )
- )*
-
- {
- return modifiers;
- }
-}
-
-/*
- * Declaration syntax follows.
- */
-void TypeDeclaration(StringBuffer sb):
-{
- int modifiers;
-}
-{
- ";"
-|
- modifiers = Modifiers()
- (
- ClassOrInterfaceDeclaration(modifiers, sb)
- |
- EnumDeclaration(modifiers)
- |
- AnnotationTypeDeclaration(modifiers)
- )
-}
-
-
-void ClassOrInterfaceDeclaration(int modifiers, StringBuffer sb):
-{
- boolean isInterface = false;
-}
-{
- ( "class" | "interface" { isInterface = true; } )
- <IDENTIFIER>
- [ TypeParameters() ]
- [ ExtendsList(isInterface) ]
- [ ImplementsList(isInterface) ]
- {sb.append("public class JWebUnit ");}
- ClassOrInterfaceBody(isInterface, sb)
-}
-
-void ExtendsList(boolean isInterface):
-{
- boolean extendsMoreThanOne = false;
-}
-{
- "extends" ClassOrInterfaceType()
- ( "," ClassOrInterfaceType() { extendsMoreThanOne = true; } )*
- {
- if (extendsMoreThanOne && !isInterface)
- throw new ParseException("A class cannot extend more than one other class");
- }
-}
-
-void ImplementsList(boolean isInterface):
-{}
-{
- "implements" ClassOrInterfaceType()
- ( "," ClassOrInterfaceType() )*
- {
- if (isInterface)
- throw new ParseException("An interface cannot implement other interfaces");
- }
-}
-
-void EnumDeclaration(int modifiers):
-{}
-{
- "enum" <IDENTIFIER>
- [ ImplementsList(false) ]
- EnumBody()
-}
-
-void EnumBody():
-{}
-{
- "{"
- EnumConstant() ( "," EnumConstant() )*
- [ ";" ( ClassOrInterfaceBodyDeclaration(false, null) )* ]
- "}"
-}
-
-void EnumConstant():
-{}
-{
- <IDENTIFIER> [ Arguments() ] [ ClassOrInterfaceBody(false, null) ]
-}
-
-void TypeParameters():
-{}
-{
- "<" TypeParameter() ( "," TypeParameter() )* ">"
-}
-
-void TypeParameter():
-{}
-{
- <IDENTIFIER> [ TypeBound() ]
-}
-
-void TypeBound():
-{}
-{
- "extends" ClassOrInterfaceType() ( "&" ClassOrInterfaceType() )*
-}
-
-void ClassOrInterfaceBody(boolean isInterface, StringBuffer sb):
-{}
-{ {sb.append("{\n");
- sb.append(" private static InheritableThreadLocal<WebTester> tester = new InheritableThreadLocal<WebTester>() {\n");
- sb.append(" @Override\n");
- sb.append(" protected WebTester childValue(WebTester parentValue) {\n");
- sb.append(" //Create a new web tester for each child thread\n");
- sb.append(" WebTester webTester = new WebTester();\n");
- sb.append(" //But initialize it with parent TestContext\n");
- sb.append(" webTester.setTestContext(parentValue.getTestContext());\n");
- sb.append(" return webTester;\n");
- sb.append(" }\n");
- sb.append(" };\n\n");
- sb.append(" private JWebUnit() {\n");
- sb.append(" //This class should not be instanciated, but instead used statically\n");
- sb.append(" }\n\n");
-
- sb.append(" /**\n");
- sb.append(" * Get internal WebTester.\n");
- sb.append(" */\n");
- sb.append(" public static WebTester getTester() {\n");
- sb.append(" if (tester.get() == null) {\n");
- sb.append(" tester.set(new WebTester());\n");
- sb.append(" }\n");
- sb.append(" return tester.get();\n");
- sb.append(" }\n\n");
-
- sb.append(" /**\n");
- sb.append(" * Set a custom WebTester (for example your own subclass).\n");
- sb.append(" */\n");
- sb.append(" public static void setCustomTester(WebTester tester) {\n");
- sb.append(" JWebUnit.tester.set(tester);\n");
- sb.append(" }\n\n");}
-
- "{" ( ClassOrInterfaceBodyDeclaration(isInterface, sb) )* "}"
- {sb.append("}\n");}
-}
-
-void ClassOrInterfaceBodyDeclaration(boolean isInterface, StringBuffer sb):
-{
- boolean isNestedInterface = false;
- int modifiers;
- String comment;
-}
-{
- LOOKAHEAD(2)
- Initializer()
- {
- if (isInterface)
- throw new ParseException("An interface cannot have initializers");
- }
-|
- {comment=getToken(1).specialToken!=null?getToken(1).specialToken.image:"";}
- modifiers = Modifiers() // Just get all the modifiers out of the way. If you want to do
- // more checks, pass the modifiers down to the member
- (
- ClassOrInterfaceDeclaration(modifiers, sb)
- |
- EnumDeclaration(modifiers)
- |
- LOOKAHEAD( [ TypeParameters() ] <IDENTIFIER> "(" )
- ConstructorDeclaration()
- |
- LOOKAHEAD( Type() <IDENTIFIER> ( "[" "]" )* ( "," | "=" | ";" ) )
- FieldDeclaration(modifiers)
- |
- MethodDeclaration(modifiers, sb, comment)
- )
-|
- ";"
-}
-
-void FieldDeclaration(int modifiers):
-{}
-{
- // Modifiers are already matched in the caller
- Type() VariableDeclarator() ( "," VariableDeclarator() )* ";"
-}
-
-void VariableDeclarator():
-{}
-{
- VariableDeclaratorId() [ "=" VariableInitializer() ]
-}
-
-String VariableDeclaratorId():
-{String result;
- Token t;}
-{
- t=<IDENTIFIER> {result=t.image;} ( "[" "]" {result+="[]";} )*
- {return result;}
-}
-
-void VariableInitializer():
-{}
-{
- ArrayInitializer()
-|
- Expression()
-}
-
-void ArrayInitializer():
-{}
-{
- "{" [ VariableInitializer() ( LOOKAHEAD(2) "," VariableInitializer() )* ] [ "," ] "}"
-}
-
-void MethodDeclaration(int modifiers, StringBuffer sb, String comment):
-{ boolean append;
- String resultType;
- List params;
- String throwsList;
- boolean isVoid;}
-{
- // Modifiers already matched in the caller!
- { append = (modifiers & ModifierSet.PUBLIC) != 0;}
- { if (append && comment!=null) sb.append(" ").append(comment).append("\n");}
- { if (append) sb.append(" public static ");}
- [ TypeParameters() ]
- isVoid=ResultType(append, sb)
- params=MethodDeclarator(append, sb) [ "throws" throwsList=NameList() {if (append) sb.append("throws "+throwsList);} ]
- ( Block() | ";" )
- {if (append) {
- sb.append(" {\n");
- sb.append(" ");
- if (!isVoid) sb.append("return ");
- sb.append("getTester().").append(params.remove(0)).append("(");
- for (Iterator i = params.iterator(); i.hasNext();) {
- i.next();
- sb.append(i.next());
- if (i.hasNext()) sb.append(", ");
- }
- sb.append(");\n");
- sb.append(" }\n\n");
- }}
-}
-
-List MethodDeclarator(boolean append, StringBuffer sb):
-{Token t;
-List result;}
-{
- t=<IDENTIFIER> {if(append) sb.append(t.image);} result=FormalParameters(append, sb) ( "[" "]" )*
- {result.add(0, t.image); return result;}
-}
-
-List FormalParameters(boolean append, StringBuffer sb):
-{List result = new LinkedList();
- List tmp;}
-{
- "(" {if(append) sb.append("(");} [ tmp=FormalParameter() {result.add(tmp.get(0)); result.add(tmp.get(1)); if (append) {sb.append(tmp.get(0)).append(" ").append(tmp.get(1));}}
- ( ","{if(append) sb.append(", ");} tmp=FormalParameter() {result.add(tmp.get(0)); result.add(tmp.get(1)); if (append) {sb.append(tmp.get(0)).append(" ").append(tmp.get(1));}} )* ] ")" {if(append) sb.append(")");}
- {return result;}
-}
-
-List FormalParameter():
-{List result = new ArrayList();
- String tmp;}
-{
- [ "final" ] tmp=Type() {result.add(tmp);} [ "..." ] tmp=VariableDeclaratorId() {result.add(tmp);}
- {return result;}
-}
-
-void ConstructorDeclaration():
-{}
-{
- [ TypeParameters() ]
- // Modifiers matched in the caller
- <IDENTIFIER> FormalParameters(false, null) [ "throws" NameList() ]
- "{"
- [ LOOKAHEAD(ExplicitConstructorInvocation()) ExplicitConstructorInvocation() ]
- ( BlockStatement() )*
- "}"
-}
-
-void ExplicitConstructorInvocation():
-{}
-{
- LOOKAHEAD("this" Arguments() ";")
- "this" Arguments() ";"
-|
- [ LOOKAHEAD(2) PrimaryExpression() "." ] "super" Arguments() ";"
-}
-
-void Initializer():
-{}
-{
- [ "static" ] Block()
-}
-
-
-/*
- * Type, name and expression syntax follows.
- */
-
-String Type():
-{String s;}
-{
- (LOOKAHEAD(2) s=ReferenceType()
- |
- s=PrimitiveType())
- {return s;}
-}
-
-String ReferenceType():
-{String result;}
-{
- (result=PrimitiveType() ( LOOKAHEAD(2) "[" "]" {result+="[]";} )+
- |
- ( result=ClassOrInterfaceType() ) ( LOOKAHEAD(2) "[" "]" {result+="[]";} )*)
- {return result;}
-}
-
-String ClassOrInterfaceType():
-{String result="";
- String result2="";
- Token t;}
-{
- t=<IDENTIFIER> {result=t.image;} [ LOOKAHEAD(2) result2=...
[truncated message content] |
|
From: SourceForge.net <no...@so...> - 2010-10-20 09:18:45
|
Bugs item #2970512, was opened at 2010-03-15 08:26 Message generated for change (Settings changed) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=2970512&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core API >Group: Release 2.5 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Todd Owen (toddmowen) Assigned to: Julien HENRY (henryju) Summary: getImage() treats absolute URL as relative Initial Comment: My site has a page "/en/admin/43/pictures", and on that page there is an img tag with an absolute URL: "/pictures/1/1/200x200.jpg". In the following code, the assertImagePresent() call succeeds, but getImage() fails: beginAt("/en/admin/43/pictures"); assertImagePresent("/pictures/1/1/200x200.jpg", null); Image img = getImage("/pictures/1/1/200x200.jpg", null); // AssertionFailedError: Could not load image from http://localhost:8080/en/admin/43/pictures/1/1/200x200.jpg Looking at the code, I see the problem is in the WebTester.createURL() method, which treats this as a relative URL and tacks it onto the current directory (i.e. /en/admin/43/), giving a nonexistent URL "/en/admin/43/pictures/1/1/200x200.jpg". ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-20 11:18 Message: OK, should be fixed in next release (2.5). ---------------------------------------------------------------------- Comment By: Julien HENRY (henryju) Date: 2010-10-19 16:13 Message: What is the value you set to getTestContext().setBaseUrl(xxx)? ---------------------------------------------------------------------- Comment By: Julien HENRY (henryju) Date: 2010-08-12 22:16 Message: If someone can provide a patch with a JUnit test and the fix, I will be happy to apply it for next release. ---------------------------------------------------------------------- Comment By: https://www.google.com/accounts () Date: 2010-08-12 07:36 Message: Also seeing this same issue with our tests. Any time-frame for a fix or a workaround for this? ---------------------------------------------------------------------- Comment By: Alexandre CESARI (acesari) Date: 2010-05-12 10:22 Message: Same issue while testing our project for image presence. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=2970512&group_id=61302 |
|
From: <he...@us...> - 2010-10-20 09:17:38
|
Revision: 868
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=868&view=rev
Author: henryju
Date: 2010-10-20 09:17:31 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
[2970512] Fixed issue with absolute image path. (merge)
Modified Paths:
--------------
trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html
trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
trunk/src/changes/changes.xml
Modified: trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
===================================================================
--- trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2010-10-20 09:16:23 UTC (rev 867)
+++ trunk/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2010-10-20 09:17:31 UTC (rev 868)
@@ -19,12 +19,7 @@
package net.sourceforge.jwebunit.tests;
-import static net.sourceforge.jwebunit.junit.JWebUnit.assertImagePresent;
-import static net.sourceforge.jwebunit.junit.JWebUnit.assertImageValid;
-import static net.sourceforge.jwebunit.junit.JWebUnit.assertImageValidAndStore;
-import static net.sourceforge.jwebunit.junit.JWebUnit.beginAt;
-import static net.sourceforge.jwebunit.junit.JWebUnit.getImage;
-import static net.sourceforge.jwebunit.junit.JWebUnit.setBaseUrl;
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
import static org.junit.Assert.assertNotNull;
import java.awt.Image;
@@ -47,7 +42,8 @@
beginAt("/PageWithImages.html");
}
- @Test public void testSimpleImagePresenceAssertion() throws Throwable {
+ @Test
+ public void testSimpleImagePresenceAssertion() throws Throwable {
assertImagePresent("images/Image1.gif", "image 1");
assertImagePresent("images/Image2.png", "image 2");
assertImagePresent("images/photos/Image3.jpg", "image 3");
@@ -59,23 +55,28 @@
assertFail("assertImagePresent", new Object[]{"images/Image2.png", "wrong alt"});
}
- @Test public void testGifCanBeLoaded() throws Throwable {
+ @Test
+ public void testGifCanBeLoaded() throws Throwable {
assertPass("assertImageValid", new Object[]{"images/Image1.gif", "image 1"});
}
- @Test public void testPngCanBeLoaded() throws Throwable {
+ @Test
+ public void testPngCanBeLoaded() throws Throwable {
assertPass("assertImageValid", new Object[]{"images/Image2.png", "image 2"});
}
- @Test public void testJpgCanBeLoaded() throws Throwable {
+ @Test
+ public void testJpgCanBeLoaded() throws Throwable {
assertPass("assertImageValid", new Object[]{"images/photos/Image3.jpg", "image 3"});
}
- @Test public void testFailsOnInvalidImages() throws Throwable {
+ @Test
+ public void testFailsOnInvalidImages() throws Throwable {
assertFail("assertImageValid", new Object[]{"images/InvalidImage.gif", "invalid image"});
}
- @Test public void testSavesImage() throws Throwable {
+ @Test
+ public void testSavesImage() throws Throwable {
File testOut = File.createTempFile("jwebunit-test-", ".png");
testOut.deleteOnExit();
assertImageValidAndStore("images/Image2.png", "image 2", testOut);
@@ -84,16 +85,25 @@
assertNotNull(testImg);
}
- @Test public void testImagesAreExposed() throws Throwable {
+ @Test
+ public void testImagesAreExposed() throws Throwable {
Image image = getImage("images/Image1.gif", "image 1");
// let's just assume it's ok if the image is there
assertNotNull(image);
}
- @Test public void testRelativePathsAreCorrectlyResolved() {
+ @Test
+ public void testRelativePathsAreCorrectlyResolved() {
beginAt("/somedir/AnotherPageWithImages.html");
assertImageValid("Image4.gif", "image 4 - same dir");
assertImageValid("images/Image5.png", "image 5 - subdir");
assertImageValid("../images/photos/Image3.jpg", "image 3 again - topdir");
}
+
+ @Test
+ public void testAbsolutePath() {
+ assertImagePresent("/jwebunit/ImageTest/images/Image1.gif", "absolute image 1");
+ assertImageValid("/jwebunit/ImageTest/images/Image1.gif", "absolute image 1");
+ }
+
}
Modified: trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html
===================================================================
--- trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html 2010-10-20 09:16:23 UTC (rev 867)
+++ trunk/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html 2010-10-20 09:17:31 UTC (rev 868)
@@ -28,6 +28,7 @@
<body>
<div id="test">
<img src="images/Image1.gif" alt="image 1" />
+ <img src="/jwebunit/ImageTest/images/Image1.gif" alt="absolute image 1" />
<img src="images/Image2.png" alt="image 2" />
<img src="images/photos/Image3.jpg" alt="image 3" />
<img src="somedir/Image4.gif" />
Modified: trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
===================================================================
--- trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-10-20 09:16:23 UTC (rev 867)
+++ trunk/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-10-20 09:17:31 UTC (rev 868)
@@ -232,6 +232,15 @@
}
+ /**
+ * This way of creating URL is not standard as absolute path are not correctly handled. We have to keep this
+ * non standard method for {@link #beginAt(String)} that advertise a bad usage for a long time.
+ * @param url Absolute or relative URL. If start with '/', then it is incorrectly appended to baseURL.
+ * @param baseURL Base URL of the page
+ * @return Final absolute URL.
+ * @throws MalformedURLException
+ */
+ @Deprecated
private URL createUrl(String url, URL baseURL) throws MalformedURLException {
if (url.startsWith("http://") || url.startsWith("https://")
|| url.startsWith("file://")) {
@@ -245,6 +254,24 @@
}
/**
+ *
+ * @param url Absolute or relative URL
+ * @param baseURL Base URL of the page
+ * @return Final absolute URL.
+ * @throws MalformedURLException
+ */
+ private URL createUrlFixed(String url, URL baseURL) throws MalformedURLException {
+ if (url.startsWith("http://") || url.startsWith("https://") //Absolute URL
+ || url.startsWith("file://")) {
+ return new URL(url);
+ } else if (url.startsWith("www.")) { //Absolute URL with missing scheme (accepted by some browsers)
+ return new URL("http://" + url);
+ } else { //Relative path
+ return new URL(baseURL, url);
+ }
+ }
+
+ /**
* Return the value of a web resource based on its key. This translates to a property file lookup with the locale
* based on the current TestContext.
*
@@ -3426,7 +3453,7 @@
assertImagePresent(imageSrc, imageAlt);
URL imageUrl = null;
try {
- imageUrl = createUrl(imageSrc, getTestingEngine().getPageURL());
+ imageUrl = createUrlFixed(imageSrc, getTestingEngine().getPageURL());
} catch (MalformedURLException e1) {
fail(e1.getLocalizedMessage());
}
Modified: trunk/src/changes/changes.xml
===================================================================
--- trunk/src/changes/changes.xml 2010-10-20 09:16:23 UTC (rev 867)
+++ trunk/src/changes/changes.xml 2010-10-20 09:17:31 UTC (rev 868)
@@ -27,7 +27,7 @@
<properties>
<title>JWebUnit changes</title>
<author email="henryju at users.sourceforge.net">
- Julien Henry
+ Julien HENRY
</author>
</properties>
<body>
@@ -37,6 +37,9 @@
</action>
</release>
<release version="2.5" date="UNKNOW" description="Small fixes and dependency updates">
+ <action type="fix" dev="henryju" issue="2970512" due-to="Todd Owen">
+ Fixed handling of absolute image path (when src attribute start with a /).
+ </action>
<action type="update" dev="henryju">
Updated to slf4j 1.6.1.
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-20 09:16:30
|
Revision: 867
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=867&view=rev
Author: henryju
Date: 2010-10-20 09:16:23 +0000 (Wed, 20 Oct 2010)
Log Message:
-----------
[2970512] Fixed issue with absolute image path.
Modified Paths:
--------------
branches/2.x/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
branches/2.x/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html
branches/2.x/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
branches/2.x/src/changes/changes.xml
Modified: branches/2.x/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java
===================================================================
--- branches/2.x/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2010-10-19 15:21:52 UTC (rev 866)
+++ branches/2.x/jwebunit-commons-tests/src/main/java/net/sourceforge/jwebunit/tests/ImageTest.java 2010-10-20 09:16:23 UTC (rev 867)
@@ -94,4 +94,9 @@
assertImageValid("images/Image5.png", "image 5 - subdir");
assertImageValid("../images/photos/Image3.jpg", "image 3 again - topdir");
}
+
+ public void testAbsolutePath() {
+ assertImagePresent("/jwebunit/ImageTest/images/Image1.gif", "absolute image 1");
+ assertImageValid("/jwebunit/ImageTest/images/Image1.gif", "absolute image 1");
+ }
}
Modified: branches/2.x/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html
===================================================================
--- branches/2.x/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html 2010-10-19 15:21:52 UTC (rev 866)
+++ branches/2.x/jwebunit-commons-tests/src/main/resources/testcases/ImageTest/PageWithImages.html 2010-10-20 09:16:23 UTC (rev 867)
@@ -28,6 +28,7 @@
<body>
<div id="test">
<img src="images/Image1.gif" alt="image 1" />
+ <img src="/jwebunit/ImageTest/images/Image1.gif" alt="absolute image 1" />
<img src="images/Image2.png" alt="image 2" />
<img src="images/photos/Image3.jpg" alt="image 3" />
<img src="somedir/Image4.gif" />
Modified: branches/2.x/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java
===================================================================
--- branches/2.x/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-10-19 15:21:52 UTC (rev 866)
+++ branches/2.x/jwebunit-core/src/main/java/net/sourceforge/jwebunit/junit/WebTester.java 2010-10-20 09:16:23 UTC (rev 867)
@@ -232,6 +232,15 @@
}
+ /**
+ * This way of creating URL is not standard as absolute path are not correctly handled. We have to keep this
+ * non standard method for {@link #beginAt(String)} that advertise a bad usage for a long time.
+ * @param url Absolute or relative URL. If start with '/', then it is incorrectly appended to baseURL.
+ * @param baseURL Base URL of the page
+ * @return Final absolute URL.
+ * @throws MalformedURLException
+ */
+ @Deprecated
private URL createUrl(String url, URL baseURL) throws MalformedURLException {
if (url.startsWith("http://") || url.startsWith("https://")
|| url.startsWith("file://")) {
@@ -244,6 +253,24 @@
}
}
+ /**
+ *
+ * @param url Absolute or relative URL
+ * @param baseURL Base URL of the page
+ * @return Final absolute URL.
+ * @throws MalformedURLException
+ */
+ private URL createUrlFixed(String url, URL baseURL) throws MalformedURLException {
+ if (url.startsWith("http://") || url.startsWith("https://") //Absolute URL
+ || url.startsWith("file://")) {
+ return new URL(url);
+ } else if (url.startsWith("www.")) { //Absolute URL with missing scheme (accepted by some browsers)
+ return new URL("http://" + url);
+ } else { //Relative path
+ return new URL(baseURL, url);
+ }
+ }
+
/**
* Return the value of a web resource based on its key. This translates to a property file lookup with the locale
* based on the current TestContext.
@@ -3427,7 +3454,7 @@
assertImagePresent(imageSrc, imageAlt);
URL imageUrl = null;
try {
- imageUrl = createUrl(imageSrc, getTestingEngine().getPageURL());
+ imageUrl = createUrlFixed(imageSrc, getTestingEngine().getPageURL());
} catch (MalformedURLException e1) {
Assert.fail(e1.getLocalizedMessage());
}
Modified: branches/2.x/src/changes/changes.xml
===================================================================
--- branches/2.x/src/changes/changes.xml 2010-10-19 15:21:52 UTC (rev 866)
+++ branches/2.x/src/changes/changes.xml 2010-10-20 09:16:23 UTC (rev 867)
@@ -32,6 +32,9 @@
</properties>
<body>
<release version="2.5" date="October 18, 2010" description="Small fixes and dependency updates">
+ <action type="fix" dev="henryju" issue="2970512" due-to="Todd Owen">
+ Fixed handling of absolute image path (when src attribute start with a /).
+ </action>
<action type="update" dev="henryju">
Updated to slf4j 1.6.1.
</action>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Julien H. <he...@ya...> - 2010-10-20 08:23:00
|
> That looks great! JWebUnit sounds fine for a static import - but how
> would it interact with WebTestCase?
JWebUnit.* will be a replacement for WebTestCase for those using JUnit 4 syntax.
JWebUnit.* methods will call WebTester.* methods.
> I'd prefer a single release for
> both JUnit 3 and 4, rather than separate builds for each version - is
> this possible?
2.5 will contains only JUnit 3 stuff.
For 3.0, I'll try to keep both WebTestCase (JUnit 3) and JWebUnit.* (JUnit 4).
The main issue I see is that under the hood, both are using WebTester that was
migrated to JUnit 4. As a result all assertXXX will throw
java.lang.AssertionError instead of junit.framework.AssertionFailedError.
So in order to keep proper assertion failure reporting for those using JUnit 3,
I'll have to change the way WebTestCase is generated to have this kind of
pattern:
public class WebTestCase extends TestCase {
...
public void assertTablePresent(String id) {
try {
newJUnit4WebTester.assertTablePresent(id);
} catch (org.junit.ComparisonFailure e) {
throw new junit.framework.ComparisonFailure(e.getMessage,
e.getExpected(), e.getActual());
}
} catch (java.lang.AssertionError e) {
throw new junit.framework.AssertionFailedError(e.getMessage());
}
}
}
WDYT ?
Regards,
Julien
----- Message d'origine ----
> De : Jevon Wright <je...@je...>
> À : JWebUnit Development mail list
<jwe...@li...>
> Envoyé le : Mer 20 octobre 2010, 4h 42min 15s
> Objet : Re: [JWebUnit-development] JUnit 4 migration
>
> Hi Julien,
>
> That looks great! JWebUnit sounds fine for a static import - but how
> would it interact with WebTestCase? I'd prefer a single release for
> both JUnit 3 and 4, rather than separate builds for each version - is
> this possible?
>
> Cheers
> Jevon
>
> On Mon, Oct 18, 2010 at 5:27 PM, Julien HENRY <he...@ya...> wrote:
> > Hi all,
> >
> > I'm working on JUnit 4 migration (we are already depending on junit-4.jar
>but
> > still using old JUnit 3 style/api).
> >
> > I plan to keep old WebTestCase for those still using JUnit 3, and create a
>new
> > class called JWebUnit (do you have a better suggestion?). JWebUnit class
>will
> > contains the same things than WebTestCase but followin JUnit 4 way, all
>methods
> > will be static in order to allow writing tests this way:
> >
> > import static net.sourceforge.jwebunit.junit.JWebUnit.*;
> >
> > public class MyTest {
> >
> > @Test
> > public void aTest() {
> > beginAt("http://google.com");
> > ...
> > }
> >
> > }
> >
> > I will also update all JWebUnit internal tests to use this new syntax.
> >
> > After this work is done, I suggest to release a version 3.0.
> >
> > I will still try to release a 2.5 with pre JUnit 4 migration work.
> >
> > If you have any suggestion, feel free to tell me.
> >
> > Regards,
> >
> > Julien
> >
> >
> >
> >
> >
> >
>------------------------------------------------------------------------------
> > Download new Adobe(R) Flash(R) Builder(TM) 4
> > The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
> > Flex(R) Builder(TM)) enable the development of rich applications that run
> > across multiple browsers and platforms. Download your free trials today!
> > http://p.sf.net/sfu/adobe-dev2dev
> > _______________________________________________
> > JWebUnit-development mailing list
> > JWe...@li...
> > https://lists.sourceforge.net/lists/listinfo/jwebunit-development
> >
>
> ------------------------------------------------------------------------------
> Download new Adobe(R) Flash(R) Builder(TM) 4
> The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
> Flex(R) Builder(TM)) enable the development of rich applications that run
> across multiple browsers and platforms. Download your free trials today!
> http://p.sf.net/sfu/adobe-dev2dev
> _______________________________________________
> JWebUnit-development mailing list
> JWe...@li...
> https://lists.sourceforge.net/lists/listinfo/jwebunit-development
>
|
|
From: Jevon W. <je...@je...> - 2010-10-20 02:42:22
|
Hi Julien,
That looks great! JWebUnit sounds fine for a static import - but how
would it interact with WebTestCase? I'd prefer a single release for
both JUnit 3 and 4, rather than separate builds for each version - is
this possible?
Cheers
Jevon
On Mon, Oct 18, 2010 at 5:27 PM, Julien HENRY <he...@ya...> wrote:
> Hi all,
>
> I'm working on JUnit 4 migration (we are already depending on junit-4.jar but
> still using old JUnit 3 style/api).
>
> I plan to keep old WebTestCase for those still using JUnit 3, and create a new
> class called JWebUnit (do you have a better suggestion?). JWebUnit class will
> contains the same things than WebTestCase but followin JUnit 4 way, all methods
> will be static in order to allow writing tests this way:
>
> import static net.sourceforge.jwebunit.junit.JWebUnit.*;
>
> public class MyTest {
>
> @Test
> public void aTest() {
> beginAt("http://google.com");
> ...
> }
>
> }
>
> I will also update all JWebUnit internal tests to use this new syntax.
>
> After this work is done, I suggest to release a version 3.0.
>
> I will still try to release a 2.5 with pre JUnit 4 migration work.
>
> If you have any suggestion, feel free to tell me.
>
> Regards,
>
> Julien
>
>
>
>
>
> ------------------------------------------------------------------------------
> Download new Adobe(R) Flash(R) Builder(TM) 4
> The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
> Flex(R) Builder(TM)) enable the development of rich applications that run
> across multiple browsers and platforms. Download your free trials today!
> http://p.sf.net/sfu/adobe-dev2dev
> _______________________________________________
> JWebUnit-development mailing list
> JWe...@li...
> https://lists.sourceforge.net/lists/listinfo/jwebunit-development
>
|
|
From: <he...@us...> - 2010-10-19 15:21:58
|
Revision: 866
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=866&view=rev
Author: henryju
Date: 2010-10-19 15:21:52 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
Fixed licence checker warnings.
Modified Paths:
--------------
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-10-19 10:22:03 UTC (rev 865)
+++ trunk/pom.xml 2010-10-19 15:21:52 UTC (rev 866)
@@ -306,8 +306,9 @@
<header>${topDirectoryLocation}/src/license/header.txt</header>
<aggregate>false</aggregate>
<encoding>${project.build.sourceEncoding}</encoding>
- <strictChecking>true</strictChecking>
+ <strictCheck>true</strictCheck>
<excludes>
+ <exclude>src/license/header.txt</exclude>
<exclude>LICENSE.txt</exclude>
<exclude>README.txt</exclude>
<exclude>COPYING*</exclude>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SourceForge.net <no...@so...> - 2010-10-19 14:13:53
|
Bugs item #2970512, was opened at 2010-03-15 08:26 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=2970512&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core API Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Todd Owen (toddmowen) >Assigned to: Julien HENRY (henryju) Summary: getImage() treats absolute URL as relative Initial Comment: My site has a page "/en/admin/43/pictures", and on that page there is an img tag with an absolute URL: "/pictures/1/1/200x200.jpg". In the following code, the assertImagePresent() call succeeds, but getImage() fails: beginAt("/en/admin/43/pictures"); assertImagePresent("/pictures/1/1/200x200.jpg", null); Image img = getImage("/pictures/1/1/200x200.jpg", null); // AssertionFailedError: Could not load image from http://localhost:8080/en/admin/43/pictures/1/1/200x200.jpg Looking at the code, I see the problem is in the WebTester.createURL() method, which treats this as a relative URL and tacks it onto the current directory (i.e. /en/admin/43/), giving a nonexistent URL "/en/admin/43/pictures/1/1/200x200.jpg". ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 16:13 Message: What is the value you set to getTestContext().setBaseUrl(xxx)? ---------------------------------------------------------------------- Comment By: Julien HENRY (henryju) Date: 2010-08-12 22:16 Message: If someone can provide a patch with a JUnit test and the fix, I will be happy to apply it for next release. ---------------------------------------------------------------------- Comment By: https://www.google.com/accounts () Date: 2010-08-12 07:36 Message: Also seeing this same issue with our tests. Any time-frame for a fix or a workaround for this? ---------------------------------------------------------------------- Comment By: Alexandre CESARI (acesari) Date: 2010-05-12 10:22 Message: Same issue while testing our project for image presence. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=2970512&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 14:05:01
|
Bugs item #3035310, was opened at 2010-07-27 16:07 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3035310&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: HtmlUnit plugin Group: None >Status: Closed >Resolution: Rejected Priority: 5 Private: No Submitted By: Felipe Duarte (fcduarte83) Assigned to: Nobody/Anonymous (nobody) Summary: CSSStyleSheetImpl insertRule method throws NPE Initial Comment: Hi Folks, I found a bug on CSS Parser.. The class CSSStyleSheetImpl has the following code on insertRule method after line 147: try { InputSource is = new InputSource(new StringReader(rule)); CSSOMParser parser = new CSSOMParser(); parser.setParentStyleSheet(this); CSSRule r = parser.parseRule(is); if (getCssRules().getLength() > 0) { // We need to check that this type of rule can legally go into // the requested position. int msg = -1; if (r.getType() == CSSRule.CHARSET_RULE) { // Index must be 0, and there can be only one charset rule if (index != 0) { msg = DOMExceptionImpl.CHARSET_NOT_FIRST; } else if (getCssRules().item(0).getType() == CSSRule.CHARSET_RULE) { msg = DOMExceptionImpl.CHARSET_NOT_UNIQUE; } } else if (r.getType() == CSSRule.IMPORT_RULE) { // Import rules must preceed all other rules (except // charset rules) if (index <= getCssRules().getLength()) { for (int i = 0; i < index; i++) { int rt = getCssRules().item(i).getType(); if ((rt != CSSRule.CHARSET_RULE) || (rt != CSSRule.IMPORT_RULE)) { msg = DOMExceptionImpl.IMPORT_NOT_FIRST; break; } } } } if (msg > -1) { throw new DOMExceptionImpl( DOMException.HIERARCHY_REQUEST_ERR, msg); } } // Insert the rule into the list of rules ((CSSRuleListImpl)getCssRules()).insert(r, index); ... If this line "CSSRule r = parser.parseRule(is);" returns null, then we will get a NPE on this code: "if (r.getType() == CSSRule.CHARSET_RULE) {" .. I think this must have a protection such like "if (r != null) {...}" The string to simulate this bug is "ul[class^="udm"] li{left:0;position:static;}" with have to be passed to attribute "rule" .. Cheers, Felipe ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 16:05 Message: Please report this bug to HtmlUnit team (htmlunit.sourceforge.net). We are only responsible for the jwebunit code. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3035310&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 14:03:21
|
Bugs item #3053434, was opened at 2010-08-26 11:31 Message generated for change (Settings changed) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3053434&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed Resolution: Works For Me Priority: 5 Private: No Submitted By: D S (favarava) Assigned to: Nobody/Anonymous (nobody) Summary: setIgnoreFailingStatusCodes not work Initial Comment: function "setIgnoreFailingStatusCodes" in Class "WebTestCase" does not work ---------------------------------------------------------------------- Comment By: Julien HENRY (henryju) Date: 2010-10-19 16:03 Message: I just did a test and it works: getTestContext().setBaseUrl("http://www.google.com"); setIgnoreFailingStatusCodes(true); beginAt("foo"); closeBrowser(); setIgnoreFailingStatusCodes(false); beginAt("foo");//Fail ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3053434&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 14:03:08
|
Bugs item #3053434, was opened at 2010-08-26 11:31 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3053434&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Works For Me Priority: 5 Private: No Submitted By: D S (favarava) Assigned to: Nobody/Anonymous (nobody) Summary: setIgnoreFailingStatusCodes not work Initial Comment: function "setIgnoreFailingStatusCodes" in Class "WebTestCase" does not work ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 16:03 Message: I just did a test and it works: getTestContext().setBaseUrl("http://www.google.com"); setIgnoreFailingStatusCodes(true); beginAt("foo"); closeBrowser(); setIgnoreFailingStatusCodes(false); beginAt("foo");//Fail ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3053434&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 13:56:34
|
Bugs item #3053443, was opened at 2010-08-26 11:46 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3053443&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: HtmlUnit plugin Group: None >Status: Closed >Resolution: Works For Me Priority: 5 Private: No Submitted By: D S (favarava) Assigned to: Nobody/Anonymous (nobody) Summary: Problem with internal html element Initial Comment: All functions that find an element does not work if the element is internal and not first in another tag. Example: <form id="formId"> <div class="class1"> <div class="class2">other code</div> <div class="class3"> <table id="table1"></table> <table id="table2"></table> <table id="table3"></table> <table id="table4"></table> </div> </div> </form> in this code table with id="table1" is find by assertTablePresent, getElementsByXPath, getElementsById, ecc... but those methods are not find table2 and the following ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 15:56 Message: I'm not able to reproduce with current JWebUnit code (see attached project). Please provide additional informations if you still have an issue. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3053443&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 10:24:06
|
Patches item #2868961, was opened at 2009-09-28 18:05 Message generated for change (Settings changed) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497984&aid=2868961&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Selenium Group: Release 3.0 Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Stefan Friedrich Birkner (silptur) Assigned to: Julien HENRY (henryju) Summary: Selenium: UnsupportedOperationException("setTimeout") Initial Comment: SeleniumTestingEngineImpl.setTimeout(int) throws an UnsupportedOperationException ---------------------------------------------------------------------- Comment By: Julien HENRY (henryju) Date: 2010-10-19 12:23 Message: Sorry for the delay. Patch applied. Thanks. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497984&aid=2868961&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 10:23:46
|
Patches item #2868961, was opened at 2009-09-28 18:05 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497984&aid=2868961&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None >Group: Release 3.0 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Stefan Friedrich Birkner (silptur) Assigned to: Julien HENRY (henryju) Summary: Selenium: UnsupportedOperationException("setTimeout") Initial Comment: SeleniumTestingEngineImpl.setTimeout(int) throws an UnsupportedOperationException ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 12:23 Message: Sorry for the delay. Patch applied. Thanks. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497984&aid=2868961&group_id=61302 |
|
From: <he...@us...> - 2010-10-19 10:22:09
|
Revision: 865
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=865&view=rev
Author: henryju
Date: 2010-10-19 10:22:03 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
[2868961] Implemented setTimeout method on Selenium testing engine. Thanks to Stefan Friedrich Birkner.
Modified Paths:
--------------
trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java
Modified: trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java
===================================================================
--- trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java 2010-10-19 10:02:15 UTC (rev 864)
+++ trunk/jwebunit-selenium-plugin/src/main/java/net/sourceforge/jwebunit/selenium/SeleniumTestingEngineImpl.java 2010-10-19 10:22:03 UTC (rev 865)
@@ -63,7 +63,7 @@
private Selenium selenium;
// Timeout in milliseconds. It's a string 'cause Selenium wants a string.
- private static final String timeout = "3000";
+ private String timeout = "3000";
private static final int port = 4444;
private TestContext testContext;
@@ -752,8 +752,7 @@
}
public void setTimeout(int milliseconds) {
- // TODO implement method
- throw new UnsupportedOperationException("setTimeout");
+ timeout = Integer.toString(milliseconds);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SourceForge.net <no...@so...> - 2010-10-19 10:18:33
|
Patches item #2850064, was opened at 2009-09-03 17:47 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497984&aid=2850064&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: HtmlUnit Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Souquieres Adam (asouquieres) Assigned to: Nobody/Anonymous (nobody) Summary: Access to cssEnabled property in htmlunit : Core patch Initial Comment: Here's patches which allow to use cssEnabled(boolean value, to disable or enable css check. Sometimes the css check is useless when errors comes from external stylesheets. ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 12:18 Message: See 2850065 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497984&aid=2850064&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 10:18:00
|
Patches item #2850065, was opened at 2009-09-03 17:48 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497984&aid=2850065&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Souquieres Adam (asouquieres) Assigned to: Nobody/Anonymous (nobody) Summary: Access to cssEnabled property in htmlunit : Plugin patch Initial Comment: Here's patches which allow to use cssEnabled(boolean value, to disable or enable css check. Sometimes the css check is useless when errors comes from external stylesheets. ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 12:17 Message: Sorry for the late answer but we don't expose methods specific to the underlying testing engine. If you really need it, do something like: ((HtmlUnitTestingEngineImpl) getTestingEngine()).getWebTester().setCssEnabled(true); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497984&aid=2850065&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 10:10:35
|
Support Requests item #1909403, was opened at 2008-03-07 10:30 Message generated for change (Settings changed) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1909403&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Priority: 5 Private: No Submitted By: Paweł Zagórski (pzagorski) Assigned to: Julien HENRY (henryju) Summary: JavaScript variable value doesn't available beetwen windows Initial Comment: Parent window opens child window. Child window after submit sets js variable in parent window. It doesn-t work. ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 12:10 Message: Please provide a JUnit test case. Old issue => closing. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1909403&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 10:08:42
|
Support Requests item #1909407, was opened at 2008-03-07 10:39 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1909407&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Priority: 5 Private: No Submitted By: Paweł Zagórski (pzagorski) Assigned to: Julien HENRY (henryju) Summary: JWEBUNIT doesn-t get full response from server Initial Comment: Something wrong in getting response from server. Via web browser (eg. IE,FF) everything works ok. ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 12:08 Message: I don't see any error in the provided informations. Closing. ---------------------------------------------------------------------- Comment By: Jevon Wright (jevonwright) Date: 2008-11-18 04:17 Message: Hi, can you post the test case that you are running to obtain this output? ---------------------------------------------------------------------- Comment By: Paweł Zagórski (pzagorski) Date: 2008-03-07 10:40 Message: Logged In: YES user_id=2029908 Originator: YES File Added: dump.txt ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497983&aid=1909407&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 10:04:22
|
Bugs item #2436699, was opened at 2008-12-17 02:50 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=2436699&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core API Group: Release 2.2 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jevon Wright (jevonwright) Assigned to: Jevon Wright (jevonwright) Summary: JWebUnit test cases are not self-contained Initial Comment: JUnit tests should be completely self contained -- that is, you can run any test suite, test case or test method individually and it will test fine. However the JWebUnit tests do not meet this requirement, as the Jetty initialisation is done before the test cases are run?, so individual test cases cannot run (e.g. through Eclipse). This would be helpful for debugging test cases. ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 12:04 Message: The problem is tests are in a separate module to allow easy sharing between htmlunit and selenium testing engines. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=2436699&group_id=61302 |
|
From: <he...@us...> - 2010-10-19 10:02:21
|
Revision: 864
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=864&view=rev
Author: henryju
Date: 2010-10-19 10:02:15 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
Set Maven plugins versions to have reproducible build (and remove Maven 3 warning). (merge)
Modified Paths:
--------------
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-10-19 10:01:45 UTC (rev 863)
+++ trunk/pom.xml 2010-10-19 10:02:15 UTC (rev 864)
@@ -220,6 +220,16 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.1.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-10-19 10:01:52
|
Revision: 863
http://jwebunit.svn.sourceforge.net/jwebunit/?rev=863&view=rev
Author: henryju
Date: 2010-10-19 10:01:45 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
Set Maven plugins versions to have reproducible build (and remove Maven 3 warning).
Modified Paths:
--------------
branches/2.x/pom.xml
Modified: branches/2.x/pom.xml
===================================================================
--- branches/2.x/pom.xml 2010-10-19 09:30:51 UTC (rev 862)
+++ branches/2.x/pom.xml 2010-10-19 10:01:45 UTC (rev 863)
@@ -220,6 +220,16 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.1.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SourceForge.net <no...@so...> - 2010-10-19 10:00:17
|
Bugs item #2367400, was opened at 2008-11-30 23:51 Message generated for change (Comment added) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=2367400&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Maven >Group: Release 2.5 >Status: Closed >Resolution: Fixed Priority: 7 Private: No Submitted By: Jevon Wright (jevonwright) Assigned to: Julien HENRY (henryju) Summary: No JavaDocs for WebTestCase Initial Comment: There is no JavaDocs for WebTestCase -- probably because it is generated at runtime. Can we add this generated source file into the Maven script somehow? ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 12:00 Message: This is fixed now (at least in coming 2.5 release). ---------------------------------------------------------------------- Comment By: Julien HENRY (henryju) Date: 2008-12-01 10:00 Message: Waiting for http://jira.codehaus.org/browse/MJAVADOC-181 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=2367400&group_id=61302 |
|
From: SourceForge.net <no...@so...> - 2010-10-19 09:57:09
|
Support Requests item #2542722, was opened at 2009-01-28 11:31 Message generated for change (Settings changed) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497983&aid=2542722&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Priority: 5 Private: No Submitted By: Reiner Brunken (reinerbrunken) >Assigned to: Julien HENRY (henryju) Summary: Missing WebTestCase.java Initial Comment: I missing in the jwebunit-2.1-sources.zip file the file WebTestCase.java in the package net.sourceforge.jwebunit.junit. ---------------------------------------------------------------------- >Comment By: Julien HENRY (henryju) Date: 2010-10-19 11:57 Message: WebTestCase.java is generated during the build so it is not in the source bundle created from SVN. But it is in Maven -source artifact. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497983&aid=2542722&group_id=61302 |