You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/06/10 14:57:54 UTC
svn commit: r1134297 - in
/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src:
main/java/org/apache/myfaces/tobago/example/demo/Navigation.java
test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java
Author: lofwyr
Date: Fri Jun 10 12:57:53 2011
New Revision: 1134297
URL: http://svn.apache.org/viewvc?rev=1134297&view=rev
Log:
fixing test
Modified:
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java?rev=1134297&r1=1134296&r2=1134297&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/Navigation.java Fri Jun 10 12:57:53 2011
@@ -17,6 +17,7 @@ package org.apache.myfaces.tobago.exampl
* limitations under the License.
*/
+import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.WindowScoped;
import org.apache.myfaces.tobago.context.ResourceManagerUtils;
import org.apache.myfaces.tobago.example.demo.jsp.JspFormatter;
import org.slf4j.Logger;
@@ -41,7 +42,7 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-public class Navigation {
+public class Navigation implements Serializable {
private static final Logger LOG = LoggerFactory.getLogger(Navigation.class);
@@ -50,9 +51,17 @@ public class Navigation {
private Node currentNode;
public Navigation() {
- final ServletContext servletContext
- = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
- final List<String> list = locateResourcesInWar(servletContext, "/content", new ArrayList<String>());
+ final ServletContext servletContext
+ = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
+ final List<String> list = locateResourcesInWar(servletContext, "/content", new ArrayList<String>());
+ init(list);
+ }
+
+ protected Navigation(List<String> list) {
+ init(list);
+ }
+
+ protected void init(List<String> list) {
list.add("/content/root.xhtml");
List<Node> nodes = new ArrayList<Node>();
for (String path : list) {
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java?rev=1134297&r1=1134296&r2=1134297&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/test/java/org/apache/myfaces/tobago/example/demo/NavigationUnitTest.java Fri Jun 10 12:57:53 2011
@@ -29,12 +29,12 @@ public class NavigationUnitTest extends
@Test
public void testFileNames() {
List<String> list = Arrays.asList(
- "00/test-1.xhtml",
- "00/07/test-2.xhtml",
- "01/test.xhtml",
- "00/00/test-4.xhtml",
- "bad.xhtml",
- "00_00_bad.xhtml"
+ "/content/00/test-1.xhtml",
+ "/content/00/07/test-2.xhtml",
+ "/content/01/test.xhtml",
+ "/content/00/00/test-4.xhtml",
+ "/content/bad.xhtml",
+ "/content/00_00_bad.xhtml"
);
final Navigation navigation = new Navigation(list);
final Navigation.Node root = navigation.getTree();