Ignore:
Timestamp:
02/14/13 15:20:07 (11 years ago)
Author:
pharms
Message:
  • support of new HTML logging format
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocumentSpec.java

    r1047 r1069  
    1515package de.ugoe.cs.autoquest.plugin.html.guimodel; 
    1616 
    17 import java.net.URL; 
    18  
    1917import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec; 
    2018 
     
    2624 * @author Patrick Harms 
    2725 */ 
    28 public class HTMLPageSpec extends HTMLGUIElementSpec implements IGUIElementSpec { 
     26public class HTMLDocumentSpec extends HTMLGUIElementSpec implements IGUIElementSpec { 
    2927 
    3028    /**  */ 
     
    3533     
    3634    /** */ 
    37     private String pagePath; 
     35    private String path; 
    3836     
    3937    /** */ 
    40     private String pageTitle; 
     38    private String query; 
     39     
     40    /** */ 
     41    private String title; 
    4142     
    4243    /** 
     
    4950     * @param pageTitle 
    5051     */ 
    51     public HTMLPageSpec(HTMLServerSpec server, String pagePath, String pageTitle) { 
    52         super("page"); 
     52    public HTMLDocumentSpec(HTMLServerSpec server, String path, String query, String title) { 
     53        super("document"); 
    5354         
    5455        if (server == null) { 
    5556            throw new IllegalArgumentException("server must not be null"); 
    5657        } 
    57         else if (pagePath == null) { 
     58        else if (path == null) { 
    5859            throw new IllegalArgumentException("pagePath must not be null"); 
    59         } 
    60         else if (pageTitle == null) { 
    61             throw new IllegalArgumentException("pageTitle must not be null"); 
    6260        } 
    6361         
    6462        this.server = server; 
    65         this.pagePath = pagePath; 
    66         this.pageTitle = pageTitle; 
    67     } 
    68  
    69     /** 
    70      * <p> 
    71      * TODO: comment 
    72      * </p> 
    73      * 
    74      * @param server 
    75      * @param pagePath 
    76      * @param pageTitle 
    77      */ 
    78     public HTMLPageSpec(URL pageURL, String pageTitle) { 
    79         super("page"); 
    80          
    81         if (pageURL == null) { 
    82             throw new IllegalArgumentException("pageURL must not be null"); 
    83         } 
    84         else if (pageTitle == null) { 
    85             throw new IllegalArgumentException("pageTitle must not be null"); 
    86         } 
    87          
    88         this.server = new HTMLServerSpec(pageURL); 
    89         this.pagePath = pageURL.getPath(); 
    90         this.pageTitle = pageTitle; 
     63        this.path = path; 
     64        this.query = query; 
     65        this.title = title; 
    9166    } 
    9267 
     
    9671    @Override 
    9772    public boolean getSimilarity(IGUIElementSpec other) { 
    98         if (other instanceof HTMLPageSpec) { 
    99             HTMLPageSpec otherSpec = (HTMLPageSpec) other; 
     73        if (other instanceof HTMLDocumentSpec) { 
     74            HTMLDocumentSpec otherSpec = (HTMLDocumentSpec) other; 
    10075             
    10176            if (!super.getSimilarity(otherSpec)) { 
     
    10580                return false; 
    10681            } 
    107             else if (!pagePath.equals(otherSpec.pagePath)) { 
     82            else if (!path.equals(otherSpec.path)) { 
     83                return false; 
     84            } 
     85            else if (query != null ? !query.equals(otherSpec.query) : otherSpec.query != null) { 
    10886                return false; 
    10987            } 
    11088            else { 
    111                 return pageTitle.equals(otherSpec.pageTitle); 
     89                return (title != null ? title.equals(otherSpec.title) : otherSpec.title == null); 
    11290            } 
    11391        } 
     
    134112     * @return 
    135113     */ 
    136     String getPagePath() { 
    137         return pagePath; 
     114    String getPath() { 
     115        return path; 
    138116    } 
    139117 
     
    145123     * @return 
    146124     */ 
    147     String getPageTitle() { 
    148         return pageTitle; 
     125    String getQuery() { 
     126        return query; 
     127    } 
     128 
     129    /** 
     130     * <p> 
     131     * TODO: comment 
     132     * </p> 
     133     * 
     134     * @return 
     135     */ 
     136    String getTitle() { 
     137        return title; 
    149138    } 
    150139 
Note: See TracChangeset for help on using the changeset viewer.