Changeset 17803

Show
Ignore:
Timestamp:
07/31/08 09:50:50 (5 months ago)
Author:
vmalykhin
Message:

new htmlunit/js introducing and and fixes for tests: js error, Cannot find function hasAttribute, resource syntax error

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/net/project/view/pages/resource/management/AssignmentSummary.java

    r17351 r17803  
    432432                                                getPnProject().getProjectId(), startDate, endDate.getTime(), SessionManager.getUser().getDateFormatter()); 
    433433 
    434                 summaryGridData = ""; 
    435434                summaryGridData = "[  "; 
    436435                if (summaryList != null) { 
     
    466465                                        .length() - 2); 
    467466                } 
     467                 
     468                // todo: the previous loop block should be fixed. 
     469                // the reason - in certain cases the value of summaryGridData is " ]". 
     470                // this is producing JS error (at least for HtmlUnit and FF browser console) 
     471                // so a temporary hack/fix is: 
     472                if (summaryGridData.equals("")) { 
     473                        summaryGridData = "[ "; 
     474                } 
     475                // 
     476                 
    468477                summaryGridData += " ]"; 
    469478                if (summaryGridData.equals("[ ]")) { 
  • trunk/core/src/net/project/view/pages/resource/management/ViewSummary.java

    r17351 r17803  
    335335                resourceAssignmentDetail.setAssignedProjects(assignmentSummaryDetails); 
    336336 
    337                 summaryGridData = ""; 
    338337                summaryGridData = "[ "; 
    339338                if (assignmentSummaryDetails.size() > 0) { 
     
    356355                        summaryGridData = summaryGridData.substring(0, summaryGridData.length() - 2); 
    357356                } 
     357                 
     358                // todo: the previous loop block should be fixed. 
     359                // the reason - in certain cases the value of summaryGridData is " ]". 
     360                // this is producing JS error (at least for HtmlUnit and FF browser console) 
     361                // so a temporary hack/fix is: 
     362                if (summaryGridData.equals("")) { 
     363                        summaryGridData = "[ "; 
     364                } 
     365                // 
     366                 
    358367                summaryGridData += " ]"; 
    359368                if (summaryGridData.endsWith("[  ]")) { 
  • trunk/core/web/jsp/help/include_outside/footer.jsp

    r17673 r17803  
    2121</div> 
    2222 
    23 <script language="javascript" type="text/javascript"> 
    24  
    25         if (document.getElementById("fixedBottomLine") == null) { 
    26                 document.write("</div>"); 
    27         } 
    28  
    29         // Footer alignment 
    30         var str = "<div style='clear: both' align=<footerDisplay:get name='@prm.global.footer.alignment' /> >"; 
    31          
    32         // Powered-by footer logo image 
    33         str += "<footerDisplay:img  
    34                 if='@prm.global.poweredby.isenabled' 
    35                 src='@prm.global.footer.poweredby.logo' 
    36                 href='@prm.global.footer.poweredby.href' />"; 
    37          
    38         // Copyright Footers 
    39         str += "<footerDisplay:if name='@prm.global.footer.copyright.newline'></footerDisplay:if>"; 
    40          
    41         str += "<footerDisplay:get 
    42            name='@prm.global.footer.copyright' 
    43                if='@prm.global.footer.copyright.isenabled' 
    44                href='@prm.global.footer.copyright.href' 
    45                enableLink='@prm.global.footer.copyright.href.isenabled' />"; 
    46                 
    47         str += "<footerDisplay:if name='@prm.global.footer.copyright.line2.newline'><br/></footerDisplay:if>"; 
    48          
    49         str += "<footerDisplay:get 
    50            name='@prm.global.footer.copyright.line2' 
    51                if='@prm.global.footer.copyright.line2.isenabled' 
    52                href='@prm.global.footer.copyright.line2.href' 
    53                enableLink='@prm.global.footer.copyright.line2.href.isenabled' />"; 
    54                  
    55         str+="</div>"; 
    56          
    57         var href = "<%= PropertyProvider.get("prm.global.footer.copyright.href")%>";  
    58         str = replaceAll(str, href, "\"" + href + "\""); 
    59          
    60         if ((navigator.userAgent.toLowerCase()).indexOf("msie") == -1 || document.getElementById("content") == null) { 
    61                 document.write(str); 
    62         } 
    63         else { 
    64                 document.getElementById("content").innerHTML = document.getElementById("content").innerHTML + str;               
    65         }        
    66  
    67         function replaceAll(OldString,FindString,ReplaceString) { 
    68                 var SearchIndex = 0; 
    69                 var NewString = "";  
    70                 while (OldString.indexOf(FindString,SearchIndex) != -1)    { 
    71                 NewString += OldString.substring(SearchIndex,OldString.indexOf(FindString,SearchIndex)); 
    72                 NewString += ReplaceString; 
    73                 SearchIndex = (OldString.indexOf(FindString,SearchIndex) + FindString.length);          
    74                 } 
    75                 NewString += OldString.substring(SearchIndex,OldString.length); 
    76                 return NewString; 
    77         } 
    78          
    79 </script> 
    80  
    8123<%-- Provides application server debugging info.--%> 
    8224 
  • trunk/test/acceptance/.classpath

    r17740 r17803  
    1010        <classpathentry kind="lib" path="lib/commons-logging-1.1.1.jar"/> 
    1111        <classpathentry kind="lib" path="lib/cssparser-0.9.5.jar"/> 
    12         <classpathentry kind="lib" path="lib/htmlunit-2.1.jar"/> 
    1312        <classpathentry kind="lib" path="lib/jaxen-1.1.1.jar"/> 
    14         <classpathentry kind="lib" path="lib/js-1.7R1.jar"/> 
    1513        <classpathentry kind="lib" path="lib/junit-3.8.2.jar"/> 
    1614        <classpathentry kind="lib" path="lib/jwebunit-core-1.5.jar"/> 
    1715        <classpathentry kind="lib" path="lib/log4j-1.2.13.jar"/> 
    18         <classpathentry kind="lib" path="lib/nekohtml-1.9.7.jar"/> 
    1916        <classpathentry kind="lib" path="lib/regexp-1.3.jar"/> 
    2017        <classpathentry kind="lib" path="lib/sac-1.3.jar"/> 
     
    2724        <classpathentry kind="lib" path="lib/xmlParserAPIs-2.6.2.jar"/> 
    2825        <classpathentry kind="lib" path="lib/jwebunit-htmlunit-plugin-1.5-patched-for-htmlunit-2.1.jar"/> 
     26        <classpathentry kind="lib" path="lib/htmlunit-2.1.jar"/> 
     27        <classpathentry kind="lib" path="lib/nekohtml-1.9.7.jar"/> 
     28        <classpathentry kind="lib" path="lib/htmlunit-core-js-2.2.jar"/> 
    2929        <classpathentry kind="output" path="bin"/> 
    3030</classpath> 
  • trunk/test/acceptance/src/net/project/test/acceptance/engine/PnetTestEngine.java

    r17733 r17803  
    4444                setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT); 
    4545                getTestContext().setBaseUrl(PNET_URL); 
    46                  
     46                                        
    4747                //getTestContext().setUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0"); 
    48                 getTestContext().setUserAgent("Mozilla/4.0 (compatible; Windows NT 5.1; YPC 3.0.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"); 
    49                 //getTestContext().setUserAgent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FDM; .NET CLR 2.0.50727; .NET CLR 1.1.4322)");                
     48                //getTestContext().setUserAgent("Mozilla/4.0 (Windows NT 5.1; YPC 3.0.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"); 
     49                getTestContext().setUserAgent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; FDM; .NET CLR 2.0.50727; .NET CLR 1.1.4322)");          
    5050                //getTestContext().setUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"); 
    51                  
    5251                //beginAt(CONTEXT_PATH); 
    5352        }