Author: ljelinko
Date: 2011-11-21 11:59:56 -0500 (Mon, 21 Nov 2011)
New Revision: 36502
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java
Log:
added assert for the content of XML file
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-21
16:52:40 UTC (rev 36501)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/create/CreateJavaPortlet.java 2011-11-21
16:59:56 UTC (rev 36502)
@@ -2,8 +2,10 @@
import static
org.jboss.tools.portlet.ui.bot.test.create.CreateJavaPortletProject.PROJECT_NAME;
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.areInFile;
import static
org.jboss.tools.portlet.ui.bot.test.matcher.workspace.WorkspaceMatchersFactory.existsInProject;
+import org.jboss.tools.portlet.ui.bot.test.matcher.workspace.file.xml.XMLNode;
import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
import org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss.PortletCreationTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
@@ -23,14 +25,19 @@
private static final String SOURCE_FILE_NAME = "src";
+ private static final String CLASS_FILE = SOURCE_FILE_NAME + "/" + PACKAGE_NAME
+ "/" + CLASS_NAME + ".java";
+
+ private static final String FULL_CLASS_NAME = PACKAGE_NAME + "." +
CLASS_NAME;
+
@Test
public void testCreate(){
doPerform(getCreatePortletTask());
doAssertThat(0, isNumberOfErrors());
- doAssertThat(SOURCE_FILE_NAME + "/" + PACKAGE_NAME + "/" +
CLASS_NAME + ".java", existsInProject(PROJECT_NAME));
+ doAssertThat(CLASS_FILE, existsInProject(PROJECT_NAME));
doAssertThat("WebContent/WEB-INF/default-object.xml",
existsInProject(PROJECT_NAME));
doAssertThat("WebContent/WEB-INF/portlet-instances.xml",
existsInProject(PROJECT_NAME));
+ doAssertThat(nodes(new XMLNode("portlet-app/portlet/portlet-class",
FULL_CLASS_NAME)), areInFile(PROJECT_NAME, "WebContent/WEB-INF/portlet.xml"));
System.out.println("");
}
@@ -41,4 +48,8 @@
task.setClassName(CLASS_NAME);
return task;
}
+
+ private XMLNode[] nodes(XMLNode... nodes){
+ return nodes;
+ }
}
Show replies by date