Author: ljelinko
Date: 2011-11-22 11:44:21 -0500 (Tue, 22 Nov 2011)
New Revision: 36537
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/console/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/console/ConsoleOutputMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/DefaultMatchersFactory.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/WorkspaceMatchersFactory.java
Removed:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortletProject.java
Log:
moved matchers factories to separate package
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java 2011-11-22
16:43:49 UTC (rev 36536)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java 2011-11-22
16:44:21 UTC (rev 36537)
@@ -2,9 +2,9 @@
import static
org.jboss.tools.portlet.ui.bot.test.create.CreateJavaPortletProject.PROJECT_NAME;
import static org.jboss.tools.portlet.ui.bot.test.entity.EntityFactory.file;
-import static
org.jboss.tools.portlet.ui.bot.test.matcher.problems.ProblemViewMatchersFactory.isNumberOfErrors;
-import static
org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.containsNodes;
-import static
org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.exists;
+import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.DefaultMatchersFactory.isNumberOfErrors;
+import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.WorkspaceMatchersFactory.containsNodes;
+import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.WorkspaceMatchersFactory.exists;
import org.jboss.tools.portlet.ui.bot.test.entity.XMLNode;
import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
@@ -39,7 +39,6 @@
doAssertThat(file(PROJECT_NAME, "WebContent/WEB-INF/default-object.xml"),
exists());
doAssertThat(file(PROJECT_NAME, "WebContent/WEB-INF/portlet-instances.xml"),
exists());
doAssertThat(file(PROJECT_NAME, "WebContent/WEB-INF/portlet.xml"),
containsNodes(new XMLNode("portlet-app/portlet/portlet-class",
FULL_CLASS_NAME)));
- System.out.println("");
}
private SWTTask getCreatePortletTask() {
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortletProject.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortletProject.java 2011-11-22
16:43:49 UTC (rev 36536)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortletProject.java 2011-11-22
16:44:21 UTC (rev 36537)
@@ -1,10 +1,10 @@
package org.jboss.tools.portlet.ui.bot.test.create;
import static org.jboss.tools.portlet.ui.bot.test.entity.EntityFactory.file;
-import static
org.jboss.tools.portlet.ui.bot.test.matcher.problems.ProblemViewMatchersFactory.isNumberOfErrors;
-import static
org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.exists;
-import static
org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.hasFacets;
-import static
org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.isExistingProject;
+import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.DefaultMatchersFactory.isNumberOfErrors;
+import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.WorkspaceMatchersFactory.exists;
+import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.WorkspaceMatchersFactory.hasFacets;
+import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.WorkspaceMatchersFactory.isExistingProject;
import org.jboss.tools.portlet.ui.bot.test.entity.FacetDefinition;
import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/console/ConsoleOutputMatcher.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/console/ConsoleOutputMatcher.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/console/ConsoleOutputMatcher.java 2011-11-22
16:44:21 UTC (rev 36537)
@@ -0,0 +1,27 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.console;
+
+import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+
+/**
+ * Checks if the console contains specified text.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class ConsoleOutputMatcher extends AbstractSWTMatcher<String> {
+
+ private String consoleText;
+
+ @Override
+ public boolean matchesSafely(String item) {
+ consoleText = SWTBotFactory.getConsole().getConsoleText();
+ return consoleText.contains(item);
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendText("console contains specified text [" + consoleText +
"]");
+ }
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/DefaultMatchersFactory.java
(from rev 36504,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/DefaultMatchersFactory.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/DefaultMatchersFactory.java 2011-11-22
16:44:21 UTC (rev 36537)
@@ -0,0 +1,26 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.factory;
+
+import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
+import org.jboss.tools.portlet.ui.bot.test.matcher.console.ConsoleOutputMatcher;
+import org.jboss.tools.portlet.ui.bot.test.matcher.problems.NumberOfErrorsMatcher;
+
+/**
+ * Factory of matchers for Problems View.
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class DefaultMatchersFactory {
+
+ public DefaultMatchersFactory() {
+ // not to be instantiated
+ }
+
+ public static SWTMatcher<Integer> isNumberOfErrors(){
+ return new NumberOfErrorsMatcher();
+ }
+
+ public static SWTMatcher<String> inConsoleOutput(){
+ return new ConsoleOutputMatcher();
+ }
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/WorkspaceMatchersFactory.java
(from rev 36524,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/WorkspaceMatchersFactory.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/factory/WorkspaceMatchersFactory.java 2011-11-22
16:44:21 UTC (rev 36537)
@@ -0,0 +1,41 @@
+package org.jboss.tools.portlet.ui.bot.test.matcher.factory;
+
+import java.util.Arrays;
+
+import org.jboss.tools.portlet.ui.bot.test.entity.FacetDefinition;
+import org.jboss.tools.portlet.ui.bot.test.entity.WorkspaceFile;
+import org.jboss.tools.portlet.ui.bot.test.entity.XMLNode;
+import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
+import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.ExistingProjectMatcher;
+import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.ProjectFacetsMatcher;
+import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.ExistingFileMatcher;
+import
org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.xml.XMLFileNodeContentMatcher;
+
+/**
+ * Factory for workspace specific matchers (projects, files..)
+ *
+ * @author Lucia Jelinkova
+ *
+ */
+public class WorkspaceMatchersFactory {
+
+ private WorkspaceMatchersFactory(){
+ // not to be instantiated
+ }
+
+ public static SWTMatcher<String> isExistingProject(){
+ return new ExistingProjectMatcher();
+ }
+
+ public static SWTMatcher<WorkspaceFile> exists(){
+ return new ExistingFileMatcher();
+ }
+
+ public static SWTMatcher<String> hasFacets(FacetDefinition... facets){
+ return new ProjectFacetsMatcher(facets);
+ }
+
+ public static SWTMatcher<WorkspaceFile> containsNodes(XMLNode... nodes){
+ return new XMLFileNodeContentMatcher(Arrays.asList(nodes));
+ }
+}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java 2011-11-22
16:43:49 UTC (rev 36536)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/problems/ProblemViewMatchersFactory.java 2011-11-22
16:44:21 UTC (rev 36537)
@@ -1,20 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.matcher.problems;
-
-import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
-
-/**
- * Factory of matchers for Problems View.
- *
- * @author Lucia Jelinkova
- *
- */
-public class ProblemViewMatchersFactory {
-
- public ProblemViewMatchersFactory() {
- // not to be instantiated
- }
-
- public static SWTMatcher<Integer> isNumberOfErrors(){
- return new NumberOfErrorsMatcher();
- }
-}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java 2011-11-22
16:43:49 UTC (rev 36536)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/WorkspaceMatchersFactory.java 2011-11-22
16:44:21 UTC (rev 36537)
@@ -1,39 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.matcher.workspace;
-
-import java.util.Arrays;
-
-import org.jboss.tools.portlet.ui.bot.test.entity.FacetDefinition;
-import org.jboss.tools.portlet.ui.bot.test.entity.WorkspaceFile;
-import org.jboss.tools.portlet.ui.bot.test.entity.XMLNode;
-import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
-import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.ExistingFileMatcher;
-import
org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.xml.XMLFileNodeContentMatcher;
-
-/**
- * Factory for workspace specific matchers (projects, files..)
- *
- * @author Lucia Jelinkova
- *
- */
-public class WorkspaceMatchersFactory {
-
- private WorkspaceMatchersFactory(){
- // not to be instantiated
- }
-
- public static SWTMatcher<String> isExistingProject(){
- return new ExistingProjectMatcher();
- }
-
- public static SWTMatcher<WorkspaceFile> exists(){
- return new ExistingFileMatcher();
- }
-
- public static SWTMatcher<String> hasFacets(FacetDefinition... facets){
- return new ProjectFacetsMatcher(facets);
- }
-
- public static SWTMatcher<WorkspaceFile> containsNodes(XMLNode... nodes){
- return new XMLFileNodeContentMatcher(Arrays.asList(nodes));
- }
-}