Changeset 1069 for trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel
- Timestamp:
- 02/14/13 15:20:07 (11 years ago)
- 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 24 24 * @author Patrick Harms 25 25 */ 26 public class HTML Pageextends HTMLGUIElement implements IDialog {26 public class HTMLDocument extends HTMLGUIElement implements IDialog { 27 27 28 28 /** */ … … 37 37 * @param parent 38 38 */ 39 public HTML Page(HTMLPageSpec specification, HTMLServer parent) {39 public HTMLDocument(HTMLDocumentSpec specification, HTMLServer parent) { 40 40 super(specification, parent); 41 41 } … … 48 48 @Override 49 49 public String toString() { 50 return " Page(" + getPagePath() + ", \"" + getPageTitle() + "\")";50 return "Document(" + getPath() + ", \"" + getTitle() + "\")"; 51 51 } 52 52 … … 58 58 @Override 59 59 protected String getElementDescriptor() { 60 return " Page";60 return "Document"; 61 61 } 62 62 … … 69 69 */ 70 70 HTMLServerSpec getServer() { 71 return ((HTML PageSpec) super.getSpecification()).getServer();71 return ((HTMLDocumentSpec) super.getSpecification()).getServer(); 72 72 } 73 73 … … 79 79 * @return 80 80 */ 81 String getPa gePath() {82 return ((HTML PageSpec) super.getSpecification()).getPagePath();81 String getPath() { 82 return ((HTMLDocumentSpec) super.getSpecification()).getPath(); 83 83 } 84 84 … … 90 90 * @return 91 91 */ 92 String get PageTitle() {93 return ((HTML PageSpec) super.getSpecification()).getPageTitle();92 String getTitle() { 93 return ((HTMLDocumentSpec) super.getSpecification()).getTitle(); 94 94 } 95 95 -
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 -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElement.java
r989 r1069 47 47 * @param parent 48 48 */ 49 public HTMLPageElement(HTMLPageElementSpec specification, HTML Pageparent) {49 public HTMLPageElement(HTMLPageElementSpec specification, HTMLDocument parent) { 50 50 super(specification, parent); 51 51 } … … 58 58 @Override 59 59 public String toString() { 60 String str = getTag ();60 String str = getTagName(); 61 61 62 if ((get TagId() != null) && (!"".equals(getTagId()))) {63 str += "(id=\"" + get TagId() + "\")";62 if ((getHtmlId() != null) && (!"".equals(getHtmlId()))) { 63 str += "(id=\"" + getHtmlId() + "\")"; 64 64 } 65 65 else { 66 str += "[" + get TagIndex() + "]";66 str += "[" + getIndex() + "]"; 67 67 } 68 68 … … 77 77 @Override 78 78 protected String getElementDescriptor() { 79 return getTag ();79 return getTagName(); 80 80 } 81 81 … … 87 87 * @return 88 88 */ 89 HTML PageSpec getPage() {89 HTMLDocumentSpec getPage() { 90 90 return ((HTMLPageElementSpec) super.getSpecification()).getPage(); 91 91 } … … 98 98 * @return 99 99 */ 100 String getTag () {101 return ((HTMLPageElementSpec) super.getSpecification()).getTag ();100 String getTagName() { 101 return ((HTMLPageElementSpec) super.getSpecification()).getTagName(); 102 102 } 103 103 … … 109 109 * @return 110 110 */ 111 String get TagId() {112 return ((HTMLPageElementSpec) super.getSpecification()).get TagId();111 String getHtmlId() { 112 return ((HTMLPageElementSpec) super.getSpecification()).getHtmlId(); 113 113 } 114 114 … … 120 120 * @return 121 121 */ 122 int get TagIndex() {123 return ((HTMLPageElementSpec) super.getSpecification()).get TagIndex();122 int getIndex() { 123 return ((HTMLPageElementSpec) super.getSpecification()).getIndex(); 124 124 } 125 125 -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java
r1059 r1069 30 30 31 31 /** */ 32 private HTML PageSpec page;32 private HTMLDocumentSpec page; 33 33 34 34 /** */ 35 private String tag ;35 private String tagName; 36 36 37 37 /** */ 38 private String id;38 private String htmlId; 39 39 40 40 /** */ … … 50 50 * @param id 51 51 */ 52 public HTMLPageElementSpec(HTML PageSpec page, String tag, String id, int index) {53 super(tag );52 public HTMLPageElementSpec(HTMLDocumentSpec page, String tagName, String htmlId, int index) { 53 super(tagName); 54 54 55 55 if (page == null) { 56 56 throw new IllegalArgumentException("page must not be null"); 57 57 } 58 else if (tag == null) {58 else if (tagName == null) { 59 59 throw new IllegalArgumentException("tag must not be null"); 60 60 } 61 else if (( id == null) && (index < 0)) {61 else if ((htmlId == null) && (index < 0)) { 62 62 throw new IllegalArgumentException 63 63 ("either id must not be null or the index must be greater or equal to 0"); … … 65 65 66 66 this.page = page; 67 this.tag = tag;68 this. id = id;67 this.tagName = tagName; 68 this.htmlId = htmlId; 69 69 this.index = index; 70 70 } … … 84 84 return false; 85 85 } 86 else if (!tag .equals(otherSpec.tag)) {86 else if (!tagName.equals(otherSpec.tagName)) { 87 87 return false; 88 88 } 89 89 90 if ( id != null) {91 return id.equals(otherSpec.id);90 if (htmlId != null) { 91 return htmlId.equals(otherSpec.htmlId); 92 92 } 93 93 else if (index >= 0) { … … 106 106 * @return 107 107 */ 108 public HTMLPageSpec getPage() {108 HTMLDocumentSpec getPage() { 109 109 return page; 110 110 } … … 117 117 * @return 118 118 */ 119 String getTag () {120 return tag ;119 String getTagName() { 120 return tagName; 121 121 } 122 122 … … 128 128 * @return 129 129 */ 130 String get TagId() {131 return id;130 String getHtmlId() { 131 return htmlId; 132 132 } 133 133 … … 139 139 * @return 140 140 */ 141 int get TagIndex() {141 int getIndex() { 142 142 return index; 143 143 } -
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java
r1059 r1069 14 14 15 15 package de.ugoe.cs.autoquest.plugin.html.guimodel; 16 17 import java.net.URL;18 16 19 17 import de.ugoe.cs.autoquest.eventcore.guimodel.IGUIElementSpec; … … 58 56 this.host = host; 59 57 this.port = port; 60 }61 62 /**63 * <p>64 * TODO: comment65 * </p>66 *67 * @param pageURL68 */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();78 58 } 79 59
Note: See TracChangeset
for help on using the changeset viewer.