Changeset 1069 for trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocumentSpec.java
- Timestamp:
- 02/14/13 15:20:07 (11 years ago)
- 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 15 15 package de.ugoe.cs.autoquest.plugin.html.guimodel; 16 16 17 import java.net.URL;18 19 17 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec; 20 18 … … 26 24 * @author Patrick Harms 27 25 */ 28 public class HTML PageSpec extends HTMLGUIElementSpec implements IGUIElementSpec {26 public class HTMLDocumentSpec extends HTMLGUIElementSpec implements IGUIElementSpec { 29 27 30 28 /** */ … … 35 33 36 34 /** */ 37 private String pa gePath;35 private String path; 38 36 39 37 /** */ 40 private String pageTitle; 38 private String query; 39 40 /** */ 41 private String title; 41 42 42 43 /** … … 49 50 * @param pageTitle 50 51 */ 51 public HTML PageSpec(HTMLServerSpec server, String pagePath, String pageTitle) {52 super(" page");52 public HTMLDocumentSpec(HTMLServerSpec server, String path, String query, String title) { 53 super("document"); 53 54 54 55 if (server == null) { 55 56 throw new IllegalArgumentException("server must not be null"); 56 57 } 57 else if (pa gePath == null) {58 else if (path == null) { 58 59 throw new IllegalArgumentException("pagePath must not be null"); 59 }60 else if (pageTitle == null) {61 throw new IllegalArgumentException("pageTitle must not be null");62 60 } 63 61 64 62 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; 91 66 } 92 67 … … 96 71 @Override 97 72 public boolean getSimilarity(IGUIElementSpec other) { 98 if (other instanceof HTML PageSpec) {99 HTML PageSpec otherSpec = (HTMLPageSpec) other;73 if (other instanceof HTMLDocumentSpec) { 74 HTMLDocumentSpec otherSpec = (HTMLDocumentSpec) other; 100 75 101 76 if (!super.getSimilarity(otherSpec)) { … … 105 80 return false; 106 81 } 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) { 108 86 return false; 109 87 } 110 88 else { 111 return pageTitle.equals(otherSpec.pageTitle);89 return (title != null ? title.equals(otherSpec.title) : otherSpec.title == null); 112 90 } 113 91 } … … 134 112 * @return 135 113 */ 136 String getPa gePath() {137 return pa gePath;114 String getPath() { 115 return path; 138 116 } 139 117 … … 145 123 * @return 146 124 */ 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; 149 138 } 150 139
Note: See TracChangeset
for help on using the changeset viewer.