Ignore:
Timestamp:
02/14/13 15:20:07 (11 years ago)
Author:
pharms
Message:
  • support of new HTML logging format
Location:
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel
Files:
3 edited
2 moved

Legend:

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

    r1047 r1069  
    2424 * @author Patrick Harms 
    2525 */ 
    26 public class HTMLPage extends HTMLGUIElement implements IDialog { 
     26public class HTMLDocument extends HTMLGUIElement implements IDialog { 
    2727 
    2828    /**  */ 
     
    3737     * @param parent 
    3838     */ 
    39     public HTMLPage(HTMLPageSpec specification, HTMLServer parent) { 
     39    public HTMLDocument(HTMLDocumentSpec specification, HTMLServer parent) { 
    4040        super(specification, parent); 
    4141    } 
     
    4848    @Override 
    4949    public String toString() { 
    50         return "Page(" + getPagePath() + ", \"" + getPageTitle() + "\")"; 
     50        return "Document(" + getPath() + ", \"" + getTitle() + "\")"; 
    5151    } 
    5252 
     
    5858    @Override 
    5959    protected String getElementDescriptor() { 
    60         return "Page"; 
     60        return "Document"; 
    6161    } 
    6262 
     
    6969     */ 
    7070    HTMLServerSpec getServer() { 
    71         return ((HTMLPageSpec) super.getSpecification()).getServer(); 
     71        return ((HTMLDocumentSpec) super.getSpecification()).getServer(); 
    7272    } 
    7373 
     
    7979     * @return 
    8080     */ 
    81     String getPagePath() { 
    82         return ((HTMLPageSpec) super.getSpecification()).getPagePath(); 
     81    String getPath() { 
     82        return ((HTMLDocumentSpec) super.getSpecification()).getPath(); 
    8383    } 
    8484 
     
    9090     * @return 
    9191     */ 
    92     String getPageTitle() { 
    93         return ((HTMLPageSpec) super.getSpecification()).getPageTitle(); 
     92    String getTitle() { 
     93        return ((HTMLDocumentSpec) super.getSpecification()).getTitle(); 
    9494    } 
    9595 
  • 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 
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElement.java

    r989 r1069  
    4747     * @param parent 
    4848     */ 
    49     public HTMLPageElement(HTMLPageElementSpec specification, HTMLPage parent) { 
     49    public HTMLPageElement(HTMLPageElementSpec specification, HTMLDocument parent) { 
    5050        super(specification, parent); 
    5151    } 
     
    5858    @Override 
    5959    public String toString() { 
    60         String str = getTag(); 
     60        String str = getTagName(); 
    6161         
    62         if ((getTagId() != null) && (!"".equals(getTagId()))) { 
    63             str += "(id=\"" + getTagId() + "\")"; 
     62        if ((getHtmlId() != null) && (!"".equals(getHtmlId()))) { 
     63            str += "(id=\"" + getHtmlId() + "\")"; 
    6464        } 
    6565        else { 
    66             str += "[" + getTagIndex() + "]"; 
     66            str += "[" + getIndex() + "]"; 
    6767        } 
    6868         
     
    7777    @Override 
    7878    protected String getElementDescriptor() { 
    79         return getTag(); 
     79        return getTagName(); 
    8080    } 
    8181 
     
    8787     * @return 
    8888     */ 
    89     HTMLPageSpec getPage() { 
     89    HTMLDocumentSpec getPage() { 
    9090        return ((HTMLPageElementSpec) super.getSpecification()).getPage(); 
    9191    } 
     
    9898     * @return 
    9999     */ 
    100     String getTag() { 
    101         return ((HTMLPageElementSpec) super.getSpecification()).getTag(); 
     100    String getTagName() { 
     101        return ((HTMLPageElementSpec) super.getSpecification()).getTagName(); 
    102102    } 
    103103 
     
    109109     * @return 
    110110     */ 
    111     String getTagId() { 
    112         return ((HTMLPageElementSpec) super.getSpecification()).getTagId(); 
     111    String getHtmlId() { 
     112        return ((HTMLPageElementSpec) super.getSpecification()).getHtmlId(); 
    113113    } 
    114114 
     
    120120     * @return 
    121121     */ 
    122     int getTagIndex() { 
    123         return ((HTMLPageElementSpec) super.getSpecification()).getTagIndex(); 
     122    int getIndex() { 
     123        return ((HTMLPageElementSpec) super.getSpecification()).getIndex(); 
    124124    } 
    125125 
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java

    r1059 r1069  
    3030     
    3131    /** */ 
    32     private HTMLPageSpec page; 
     32    private HTMLDocumentSpec page; 
    3333     
    3434    /** */ 
    35     private String tag; 
     35    private String tagName; 
    3636     
    3737    /** */ 
    38     private String id; 
     38    private String htmlId; 
    3939     
    4040    /** */ 
     
    5050     * @param id 
    5151     */ 
    52     public HTMLPageElementSpec(HTMLPageSpec page, String tag, String id, int index) { 
    53         super(tag); 
     52    public HTMLPageElementSpec(HTMLDocumentSpec page, String tagName, String htmlId, int index) { 
     53        super(tagName); 
    5454         
    5555        if (page == null) { 
    5656            throw new IllegalArgumentException("page must not be null"); 
    5757        } 
    58         else if (tag == null) { 
     58        else if (tagName == null) { 
    5959            throw new IllegalArgumentException("tag must not be null"); 
    6060        } 
    61         else if ((id == null) && (index < 0)) { 
     61        else if ((htmlId == null) && (index < 0)) { 
    6262            throw new IllegalArgumentException 
    6363                ("either id must not be null or the index must be greater or equal to 0"); 
     
    6565         
    6666        this.page = page; 
    67         this.tag = tag; 
    68         this.id = id; 
     67        this.tagName = tagName; 
     68        this.htmlId = htmlId; 
    6969        this.index = index; 
    7070    } 
     
    8484                return false; 
    8585            } 
    86             else if (!tag.equals(otherSpec.tag)) { 
     86            else if (!tagName.equals(otherSpec.tagName)) { 
    8787                return false; 
    8888            } 
    8989             
    90             if (id != null) { 
    91                 return id.equals(otherSpec.id); 
     90            if (htmlId != null) { 
     91                return htmlId.equals(otherSpec.htmlId); 
    9292            } 
    9393            else if (index >= 0) { 
     
    106106     * @return 
    107107     */ 
    108     public HTMLPageSpec getPage() { 
     108    HTMLDocumentSpec getPage() { 
    109109        return page; 
    110110    } 
     
    117117     * @return 
    118118     */ 
    119     String getTag() { 
    120         return tag; 
     119    String getTagName() { 
     120        return tagName; 
    121121    } 
    122122 
     
    128128     * @return 
    129129     */ 
    130     String getTagId() { 
    131         return id; 
     130    String getHtmlId() { 
     131        return htmlId; 
    132132    } 
    133133 
     
    139139     * @return 
    140140     */ 
    141     int getTagIndex() { 
     141    int getIndex() { 
    142142        return index; 
    143143    } 
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java

    r1059 r1069  
    1414 
    1515package de.ugoe.cs.autoquest.plugin.html.guimodel; 
    16  
    17 import java.net.URL; 
    1816 
    1917import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec; 
     
    5856        this.host = host; 
    5957        this.port = port; 
    60     } 
    61  
    62     /** 
    63      * <p> 
    64      * TODO: comment 
    65      * </p> 
    66      * 
    67      * @param pageURL 
    68      */ 
    69     public HTMLServerSpec(URL pageURL) { 
    70         super("server"); 
    71  
    72         if (pageURL == null) { 
    73             throw new IllegalArgumentException("page URL must not be null"); 
    74         } 
    75  
    76         this.host = pageURL.getHost(); 
    77         this.port = pageURL.getPort(); 
    7858    } 
    7959 
Note: See TracChangeset for help on using the changeset viewer.