xlawrence    2005/06/15 14:28:27 CEST

  Modified files:
    core/src/test/src/java/org/jahia/engines/shared 
                                                    BigText_FieldTest.java 
  Log:
  Test is up to date with the latest version of the method
  
  Revision  Changes    Path
  1.3       +60 -35    
jahia/core/src/test/src/java/org/jahia/engines/shared/BigText_FieldTest.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/test/src/java/org/jahia/engines/shared/BigText_FieldTest.java.diff?r1=1.2&r2=1.3&f=h
  
  
  
  Index: BigText_FieldTest.java
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/test/src/java/org/jahia/engines/shared/BigText_FieldTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BigText_FieldTest.java    13 Jun 2005 13:06:32 -0000      1.2
  +++ BigText_FieldTest.java    15 Jun 2005 12:28:27 -0000      1.3
  @@ -62,41 +62,54 @@
           super(testName);
       }
       
  -    /*
  -     <a 
href='https://localhost:8080/jahia/Jahia/op/edit/pid/2?matrix=1116589713765' 
target="_blank">
  -        the 1st link</a> <br/>
  -     
  -     <a href='ftp://ftp.test.ch/image.jpg'>the 2nd link</a> <br/>
  -     
  -     <a 
href='http://localhost:8080/jahia/Jahia/op/compare/lang/en/pid/79?matrix=1116589713765'>
  -        the 3rd link</a> <br/>
  -     
  -     <a target="_blank" 
href='http://www.epfl.ch/jahia/Jahia/op/compare/pid/3479?entryId=34' 
class="link" >
  -        the 4th link</a><br/>
  -     
  -     <a target="_blank" href='12' class="link">the 5th link</a><br/>
  -     
  -     <a target="_blank" 
href='http://www.unil.ch/jahia/Jahia/op/compare/pid/9#comments' class="link" >
  -        the 6th link </a>
  +    /** Test data to "copy-paste" in the engine:
  +        <a href='2'>the link (1)</a> <br />
  +        <a href='2'> the link (2)</a> <br/>
  +        <a href='2' >the link (3)</a> <br/>
  +        <a href='2' > the link (4) </a> <br/>
  +        <a href='pid/2'>the link (5)</a> <br/>
  +        <a href='/pid/2'>the link (6)</a> <br/>
  +        <a href='lang/en/pid/2'>the link (7)</a> <br/>
  +        <a href='/lang/en/pid/2'>the link (8)</a> <br/>
  +        <a href='/site/myjahiasite/pid/2'>the link (9)</a> <br/>
  +        <a href='site/myjahiasite/lang/en/pid/2'>the link (10)</a> <br/>
  +        <a href='/site/myjahiasite/lang/en/pid/2'>the link (11)</a> <br/>
  +        <a href='jahia/Jahia/site/myjahiasite/lang/en/pid/2'>the link 
(12)</a> <br/>
  +        <a href='/jahia/Jahia/site/myjahiasite/lang/en/pid/2'>the link 
(13)</a> <br/>
  +        <a 
href='http://localhost:8080/jahia/Jahia/site/myjahiasite/lang/en/pid/2'>the 
link (14)</a><br/>
  +        <a 
href='http://localhost:8080/jahia/Jahia/site/myjahiasite/lang/en/pid/2'>the 
link (15)</a><br/>
  +        <a href='/jahia/Jahia/site/myjahiasite/lang/en/op/edit/pid/2'>the 
link (16)</a><br/>
  +        <a 
href='/jahia/Jahia/site/myjahiasite/lang/en/op/edit/pid/2?matrix=1116589713765'>the
 link (17)</a><br/>
  +        <a 
href='/jahia/Jahia/site/myjahiasite/lang/en/op/edit/pid/2;jsessionid=1234546754756'>the
 link (18)</a><br/>
  +        <a href='/jahia/Jahia/pid/2?entryid=34?matrix=1116589713765' 
target='_blank'>the link (19)</a><br/>
  +        <a href='ftp://ftp.jahia.org/logo.gif'>the link (20)</a><br/>
  +        <a href='http://www.jahia.org/javadoc'>the link (21)</a><br/>
  +        <a 
href='http://www.epfl.ch/jahia/Jahia/op/edit/pid/23?matrix=1116589713765'>the 
link (22)</a>  <br/>
        */
       protected void setUp() throws Exception {
  -        content = "<p> a paragraph </p>\n" +
  -                "<a 
href='https://localhost:8080/jahia/Jahia/op/edit/pid/2?matrix=1116589713765' 
target=\"_blank\">"+
  -                "the 1st link</a>\n" +
  -                
  -                "<a href='ftp://ftp.test.ch/image.jpg'>the 2nd link</a>\n" +
  -                
  -                "<a 
href='http://www.unil.ch/jahia/Jahia/op/compare/lang/en/pid/79?matrix=1116589713765'>"+
  -                "the 3rd link</a>\n" +
  -                
  -                "<a target=\"_blank\" 
href='http://www.epfl.ch/jahia/Jahia/op/compare/pid/3479?entryId=34' 
class=\"link\" >"+
  -                " the 4th link </a>\n" +
  -                
  -                "<a target=\"_blank\" href='125' class=\"link\" >" +
  -                " the 5th link </a>\n" +
  -                
  -                "<a target=\"_blank\" 
href='http://www.unil.ch/jahia/Jahia/op/compare/pid/9#comments' class=\"link\" 
>" +
  -                " the 6th link </a>\n";
  +        content = "\n" +
  +                "<a href='2'>the link (1)</a>\n" +
  +                "<a href='2'> the link (2)</a>\n" +
  +                "<a href='2' >the link (3)</a>\n" +
  +                "<a href='2' > the link (4) </a>\n" +
  +                "<a href='pid/2'>the link (5)</a>\n" +
  +                "<a href='/pid/2'>the link (6)</a>\n" +
  +                "<a href='lang/en/pid/2'>the link (7)</a>\n" +
  +                "<a href='/lang/en/pid/2'>the link (8)</a>\n" +
  +                "<a href='/site/myjahiasite/pid/2'>the link (9)</a>\n" +
  +                "<a href='site/myjahiasite/lang/en/pid/2'>the link 
(10)</a>\n" +
  +                "<a href='/site/myjahiasite/lang/en/pid/2'>the link 
(11)</a>\n" +
  +                "<a href='jahia/Jahia/site/myjahiasite/lang/en/pid/2'>the 
link (12)</a>\n" +
  +                "<a href='/jahia/Jahia/site/myjahiasite/lang/en/pid/2'>the 
link (13)</a>\n" +
  +                "<a 
href='http://localhost:8080/jahia/Jahia/site/myjahiasite/lang/en/pid/2'>the 
link (14)</a>\n" +
  +                "<a 
href='http://localhost:8080/jahia/Jahia/site/myjahiasite/lang/en/pid/2'>the 
link (15)</a>\n" +
  +                "<a 
href='/jahia/Jahia/site/myjahiasite/lang/en/op/edit/pid/2'>the link (16)</a>\n" 
+
  +                "<a 
href='/jahia/Jahia/site/myjahiasite/lang/en/op/edit/pid/2?matrix=1116589713765'>the
 link (17)</a>\n" +
  +                "<a 
href='/jahia/Jahia/site/myjahiasite/lang/en/op/edit/pid/2;jsessionid=1234546754756'>the
 link (18)</a>\n" +
  +                "<a 
href='/jahia/Jahia/pid/2?entryid=34?matrix=1116589713765' target=\"_blank\">the 
link (19)</a>\n" +
  +                "<a href='ftp://ftp.jahia.org/logo.gif'>the link (20)</a>\n" 
+
  +                "<a href='http://www.jahia.org/javadoc'>the link (21)</a>\n" 
+
  +                "<a 
href='http://www.epfl.ch/jahia/Jahia/op/edit/pid/23?matrix=1116589713765'>the 
link (22)</a>\n";
       }
       
       public static Test suite() {
  @@ -135,10 +148,22 @@
               logger.info("RawValue: "+res[0]);
               logger.info("DisplayValue: "+res[1]);
               
  -            assertTrue(res[0].indexOf("?matrix") < 0 && 
res[0].indexOf(";jsessionid") < 0 &&
  +            assertTrue(res[0].indexOf("?matrix") < 0 &&
  +                    res[0].indexOf(";jsessionid") < 0 &&
                       res[0].indexOf("/op/") < 0 &&
  +                    res[0].indexOf("/site/") < 0 &&
  +//                    res[0].indexOf(request.getContextPath()) < 0 &&
  +//                    res[0].indexOf(request.getServletPath()) < 0 &&
                       res[0].indexOf(HttpServletRequestImpl.SERVER_NAME) < 0);
               
  +            assertTrue(res[1].indexOf("?matrix") < 0 &&
  +                    res[1].indexOf(";jsessionid") < 0 &&
  +                    res[1].indexOf("/op/") < 0 &&
  +                    res[1].indexOf("/site/") < 0 &&
  +                    res[1].indexOf(request.getContextPath()) > -1 &&
  +                    res[1].indexOf(request.getServletPath()) > -1 &&
  +                    res[1].indexOf(JahiaBigTextField.URL_MARKER) < 0);
  +            
           } catch (Exception e) {
               e.printStackTrace();
               throw e;
  @@ -150,7 +175,7 @@
        */
       class HttpServletRequestImpl implements HttpServletRequest {
           
  -        public static final String SERVER_NAME = "www.unil.ch";
  +        public static final String SERVER_NAME = "localhost";
           public static final String LOCAL_ADDR = "192.168.2.197";
           
           public String getAuthType() { return ""; }
  

Reply via email to