[kune-commits] r1668 - in trunk: img/screenshots script src/main/java/cc/kune/core/client/state src/main/java/cc/kune/core/client/state/impl src/main/java/cc/kune/wave/server/kspecific src/test/java/cc/kune/core/client/state/impl src/test/java/cc/kune/selenium/login

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri Jan 20 01:12:45 CET 2012


Author: vjrj_
Date: 2012-01-20 01:12:44 +0100 (Fri, 20 Jan 2012)
New Revision: 1668

Modified:
   trunk/img/screenshots/kune-newgroup.png
   trunk/img/screenshots/kune-register.png
   trunk/script/kune server debug.launch
   trunk/src/main/java/cc/kune/core/client/state/TokenMatcher.java
   trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
   trunk/src/main/java/cc/kune/wave/server/kspecific/WaveEmailNotifier.java
   trunk/src/test/java/cc/kune/core/client/state/impl/StateManagerDefaultTest.java
   trunk/src/test/java/cc/kune/core/client/state/impl/TokenMatcherTest.java
   trunk/src/test/java/cc/kune/selenium/login/ScreenCastsViaSeleniumTests.java
Log:
#prefs #gprefs(group) urls and some history fixes 

Modified: trunk/img/screenshots/kune-newgroup.png
===================================================================
(Binary files differ)

Modified: trunk/img/screenshots/kune-register.png
===================================================================
(Binary files differ)

Modified: trunk/script/kune server debug.launch
===================================================================
--- trunk/script/kune server debug.launch	2012-01-18 15:27:17 UTC (rev 1667)
+++ trunk/script/kune server debug.launch	2012-01-20 00:12:44 UTC (rev 1668)
@@ -13,7 +13,6 @@
 <mapAttribute key="org.eclipse.jdt.launching.CONNECT_MAP">
 <mapEntry key="hostname" value="localhost"/>
 <mapEntry key="port" value="8001"/>
-<mapEntry key="timeout" value="20000"/>
 </mapAttribute>
 <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="kune"/>
 <stringAttribute key="org.eclipse.jdt.launching.VM_CONNECTOR_ID" value="org.eclipse.jdt.launching.socketAttachConnector"/>

Modified: trunk/src/main/java/cc/kune/core/client/state/TokenMatcher.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/TokenMatcher.java	2012-01-18 15:27:17 UTC (rev 1667)
+++ trunk/src/main/java/cc/kune/core/client/state/TokenMatcher.java	2012-01-20 00:12:44 UTC (rev 1668)
@@ -30,59 +30,59 @@
 
 public class TokenMatcher {
 
-    private WaverefEncoder encoder;
-    private final ReservedWordsRegistryDTO reservedWordsRegistry;
+  private WaverefEncoder encoder;
+  private final ReservedWordsRegistryDTO reservedWordsRegistry;
 
-    @Inject
-    public TokenMatcher(final ReservedWordsRegistryDTO reservedWordsRegistry) {
-        this.reservedWordsRegistry = reservedWordsRegistry;
-    }
+  @Inject
+  public TokenMatcher(final ReservedWordsRegistryDTO reservedWordsRegistry) {
+    this.reservedWordsRegistry = reservedWordsRegistry;
+  }
 
-    public Pair<String, String> getRedirect(final String token) {
-        final String[] splited = splitRedirect(token);
-        if (hasRedirect(token, splited)) {
-            return Pair.create(splited[0], splited[1].replaceAll("\\)$", ""));
-        }
-        return null;
+  public Pair<String, String> getRedirect(final String token) {
+    final String[] splited = splitRedirect(token);
+    if (hasRedirect(token, splited)) {
+      return Pair.create(splited[0], splited[1].replaceAll("\\)$", ""));
     }
+    return null;
+  }
 
-    public boolean hasRedirect(final String token) {
-        final String[] splited = splitRedirect(token);
-        if (hasRedirect(token, splited)) {
-            return true;
-        }
-        return false;
+  public boolean hasRedirect(final String token) {
+    final String[] splited = splitRedirect(token);
+    if (hasRedirect(token, splited)) {
+      return true;
     }
+    return false;
+  }
 
-    private boolean hasRedirect(final String token, final String[] splited) {
-        return token.endsWith(")") && splited.length == 2;
-    }
+  private boolean hasRedirect(final String token, final String[] splited) {
+    return token.endsWith(")") && splited.length == 2;
+  }
 
-    public void init(final WaverefEncoder encoder) {
-        assert encoder != null;
-        this.encoder = encoder;
-    }
+  public void init(final WaverefEncoder encoder) {
+    assert encoder != null;
+    this.encoder = encoder;
+  }
 
-    public boolean isGroupToken(final String token) {
-        return token != null && !isWaveToken(token) && !hasRedirect(token) && !reservedWordsRegistry.contains(token)
-                && !new StateToken(token).hasNothing();
-    }
+  public boolean isGroupToken(final String token) {
+    return token != null && !isWaveToken(token) && !hasRedirect(token)
+        && !reservedWordsRegistry.contains(token) && !new StateToken(token).hasNothing();
+  }
 
-    public boolean isHomeToken(final String currentToken) {
-        return SiteTokens.HOME.equals(currentToken);
-    }
+  public boolean isHomeToken(final String currentToken) {
+    return SiteTokens.HOME.equals(currentToken);
+  }
 
-    public boolean isWaveToken(final String token) {
-        assert encoder != null;
-        try {
-            return token == null ? false : encoder.decodeWaveRefFromPath(token) != null;
-        } catch (final InvalidWaveRefException e) {
-            return false;
-        }
+  public boolean isWaveToken(final String token) {
+    assert encoder != null;
+    try {
+      return token == null ? false : encoder.decodeWaveRefFromPath(token) != null;
+    } catch (final InvalidWaveRefException e) {
+      return false;
     }
+  }
 
-    private String[] splitRedirect(final String token) {
-        return token.split("\\(", 2);
-    }
+  private String[] splitRedirect(final String token) {
+    return token.split("\\(", 2);
+  }
 
 }

Modified: trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java	2012-01-18 15:27:17 UTC (rev 1667)
+++ trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java	2012-01-20 00:12:44 UTC (rev 1668)
@@ -66,6 +66,9 @@
 import com.google.inject.Inject;
 
 public class StateManagerDefault implements StateManager, ValueChangeHandler<String> {
+  public interface OnFinishGetContent {
+    void finish();
+  }
   private final BeforeActionCollection beforeStateChangeCollection;
   private final ContentCache contentCache;
   private final EventBus eventBus;
@@ -152,6 +155,24 @@
 
   private void doActionOrSignInIfNeeded(final HistoryTokenCallback tokenListener,
       final String currentToken, final String secondPart) {
+    // First of all we see if we are starting up, and we get the def content
+    // first
+    if (startingUp()) {
+      // Starting with some token like "signin": load defContent first
+      Log.debug("Starting up with some token like #signin or #token(param): load defContent first");
+      getContent(new StateToken(SiteTokens.GROUP_HOME), false, new OnFinishGetContent() {
+        @Override
+        public void finish() {
+          doActionOrSignInIfNeededStarted(tokenListener, currentToken, secondPart);
+        }
+      });
+    } else {
+      doActionOrSignInIfNeededStarted(tokenListener, currentToken, secondPart);
+    }
+  }
+
+  private void doActionOrSignInIfNeededStarted(final HistoryTokenCallback tokenListener,
+      final String currentToken, final String secondPart) {
     if (tokenListener.authMandatory() && session.isNotLogged()) {
       Log.debug("login mandatory for " + currentToken);
       // Ok, we have to redirect because this token (for instance
@@ -170,6 +191,17 @@
   }
 
   private void getContent(final StateToken newState, final boolean setBrowserHistory) {
+    final OnFinishGetContent doNothing = new OnFinishGetContent() {
+      @Override
+      public void finish() {
+        // Do nothing
+      }
+    };
+    getContent(newState, setBrowserHistory, doNothing);
+  }
+
+  private void getContent(final StateToken newState, final boolean setBrowserHistory,
+      final OnFinishGetContent andThen) {
     // NotifyUser.info("loading: " + newState + " because current:" +
     // session.getCurrentStateToken());
     contentCache.getContent(session.getUserHash(), newState,
@@ -184,6 +216,7 @@
               history.newItem(currentToken, false);
               SpaceSelectEvent.fire(eventBus, Space.groupSpace);
             }
+            andThen.finish();
           }
         });
   }
@@ -283,35 +316,25 @@
     processHistoryToken(history.getToken());
   }
 
-  void processHistoryToken(final String newHistoryToken) {
+  void processHistoryToken(final String newToken) {
     // http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideHistory
     if (beforeStateChangeCollection.checkBeforeAction()) {
       // There isn't a beforeStateChange listener that stops this history
       // change
-      HistoryTokenCallback tokenListener = null;
-      if (newHistoryToken != null) {
-        final String nToken = newHistoryToken.toLowerCase();
-        tokenListener = siteTokens.get(nToken);
-      }
-      Log.debug("StateManager: on history changed (" + newHistoryToken + ")");
+      final HistoryTokenCallback tokenListener = newToken != null ? siteTokens.get(newToken.toLowerCase())
+          : null;
+      boolean isSpecialHash = false;
+      Log.debug("StateManager: on history changed (" + newToken + ")");
       if (tokenListener != null) {
+        isSpecialHash = true;
         Log.debug("token is one of #newgroup #signin #translate without #hash(redirection) ...");
-        if (startingUp()) {
-          // Starting with some token like "signin": load defContent
-          // also
-          Log.debug("Starting up with some token like #signin: load defContent also");
-          getContent(new StateToken(SiteTokens.GROUP_HOME), false);
-          // processHistoryToken(SiteTokens.GROUP_HOME);
-          // SpaceSelectEvent.fire(eventBus, Space.groupSpace);
-        }
-        // Fire the listener of this #hash token
-        doActionOrSignInIfNeeded(tokenListener, newHistoryToken, newHistoryToken);
+        doActionOrSignInIfNeeded(tokenListener, newToken, newToken);
       } else {
         Log.debug("Is not a special hash like #newgroup, etc, or maybe has a #hash(redirection)");
         // token is not one of #newgroup #signin #translate ...
-        final String nToken = newHistoryToken != null ? newHistoryToken.toLowerCase() : null;
-        if (nToken != null && tokenMatcher.hasRedirect(nToken)) {
-          final Pair<String, String> redirect = tokenMatcher.getRedirect(nToken);
+        final String newTokenLower = newToken != null ? newToken.toLowerCase() : null;
+        if (newTokenLower != null && tokenMatcher.hasRedirect(newTokenLower)) {
+          final Pair<String, String> redirect = tokenMatcher.getRedirect(newTokenLower);
           final String firstToken = redirect.getLeft();
           final String sndToken = redirect.getRight();
           if (firstToken.equals(SiteTokens.PREVIEW)) {
@@ -322,11 +345,12 @@
           } else {
             final HistoryTokenCallback tokenWithRedirect = siteTokens.get(firstToken);
             if (tokenWithRedirect != null) {
+              isSpecialHash = true;
               Log.info("Is some #subtitle(foo) or #verifyemail(hash) etc");
-              doActionOrSignInIfNeeded(tokenWithRedirect, newHistoryToken,
-                  tokenMatcher.getRedirect(newHistoryToken).getRight());
+              doActionOrSignInIfNeeded(tokenWithRedirect, newToken,
+                  tokenMatcher.getRedirect(newToken).getRight());
             } else if (firstToken.equals(SiteTokens.NEW_GROUP)) {
-              siteTokens.get(SiteTokens.NEW_GROUP).onHistoryToken(newHistoryToken);
+              siteTokens.get(SiteTokens.NEW_GROUP).onHistoryToken(newToken);
             } else if (firstToken.equals(SiteTokens.SIGN_IN)) {
               if (session.isLogged()) {
                 // We are logged, then redirect:
@@ -334,45 +358,43 @@
                 processHistoryToken(sndToken);
               } else {
                 // We have to login
-                siteTokens.get(SiteTokens.SIGN_IN).onHistoryToken(newHistoryToken);
+                siteTokens.get(SiteTokens.SIGN_IN).onHistoryToken(newToken);
               }
             }
           }
-        } else {
-          // Is not a Redirect token
-          Log.debug("Is not a redirect token");
         }
-        if (tokenMatcher.isWaveToken(newHistoryToken)) {
+        if (tokenMatcher.isWaveToken(newToken)) {
           if (session.isLogged()) {
-            SpaceConfEvent.fire(eventBus, Space.userSpace, newHistoryToken);
+            SpaceConfEvent.fire(eventBus, Space.userSpace, newToken);
             SpaceSelectEvent.fire(eventBus, Space.userSpace);
             try {
               ClientEvents.get().fireEvent(
-                  new WaveSelectionEvent(GwtWaverefEncoder.decodeWaveRefFromPath(newHistoryToken)));
+                  new WaveSelectionEvent(GwtWaverefEncoder.decodeWaveRefFromPath(newToken)));
             } catch (final InvalidWaveRefException e) {
-              Log.error(nToken, e);
+              Log.error(newToken, e);
             }
           } else {
             // Wave, but don't logged
-            redirectButSignInBefore(newHistoryToken);
+            redirectButSignInBefore(newToken);
             if (startingUp()) {
               // Starting application (with Wave)
               getContent(new StateToken(SiteTokens.GROUP_HOME), false);
             }
           }
-        } else if (tokenMatcher.isGroupToken(newHistoryToken)) {
-          SpaceConfEvent.fire(eventBus, Space.groupSpace, newHistoryToken);
-          SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(newHistoryToken));
-          SpaceSelectEvent.fire(eventBus, Space.groupSpace);
-          getContent(new StateToken(newHistoryToken));
-        } else {
-          if (!startingUp()) {
-            // gotoDefaultHomepage();
+        } else if (!isSpecialHash) {
+          if (tokenMatcher.isGroupToken(newToken)) {
+            SpaceConfEvent.fire(eventBus, Space.groupSpace, newToken);
+            SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(newToken));
+            SpaceSelectEvent.fire(eventBus, Space.groupSpace);
+            getContent(new StateToken(newToken));
+          } else {
+            Log.debug("Last option, get default with token: " + newToken);
+            getContent(new StateToken(SiteTokens.GROUP_HOME), false);
           }
         }
       }
     } else {
-      resumedHistoryToken = newHistoryToken;
+      resumedHistoryToken = newToken;
     }
   }
 

Modified: trunk/src/main/java/cc/kune/wave/server/kspecific/WaveEmailNotifier.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/WaveEmailNotifier.java	2012-01-18 15:27:17 UTC (rev 1667)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/WaveEmailNotifier.java	2012-01-20 00:12:44 UTC (rev 1668)
@@ -170,7 +170,7 @@
                     final ParticipantId by = ((WaveletBlipOperation) op).getContext().getCreator();
                     final String title = getTitle(wavelet, by);
                     final String url = KuneWaveServerUtils.getUrl(waveref);
-                    LOG.info(String.format("'%s' updated wave '%s'", by, title));
+                    LOG.info(String.format("'%s' update wave '%s'", by, title));
                     return new PendingNotification(NotificationType.email,
                         FormatedString.build("You have an updated message"), updatedWaveTemplate(
                             by.toString(), title, url), true, false, new WaveDestinationProvider(

Modified: trunk/src/test/java/cc/kune/core/client/state/impl/StateManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/impl/StateManagerDefaultTest.java	2012-01-18 15:27:17 UTC (rev 1667)
+++ trunk/src/test/java/cc/kune/core/client/state/impl/StateManagerDefaultTest.java	2012-01-20 00:12:44 UTC (rev 1668)
@@ -49,6 +49,7 @@
 import cc.kune.core.client.state.TokenMatcher;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.InitDataDTO;
+import cc.kune.core.shared.dto.ReservedWordsRegistryDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 
 import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -79,7 +80,7 @@
     contentProvider = Mockito.mock(ContentCache.class);
     session = Mockito.mock(Session.class);
     history = Mockito.mock(HistoryWrapper.class);
-    tokenMatcher = Mockito.mock(TokenMatcher.class);
+    tokenMatcher = new TokenMatcher(new ReservedWordsRegistryDTO());
     siteTokens = Mockito.mock(SiteTokenListeners.class);
     eventBus = new EventBusTester();
     Mockito.when(session.getUserHash()).thenReturn(HASH);
@@ -334,4 +335,5 @@
     Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
         (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
   }
+
 }

Modified: trunk/src/test/java/cc/kune/core/client/state/impl/TokenMatcherTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/impl/TokenMatcherTest.java	2012-01-18 15:27:17 UTC (rev 1667)
+++ trunk/src/test/java/cc/kune/core/client/state/impl/TokenMatcherTest.java	2012-01-20 00:12:44 UTC (rev 1668)
@@ -33,122 +33,123 @@
 
 public class TokenMatcherTest {
 
-    private static final String DEF_SITE_TOKEN = "";
-    private static final String GROUP_TOKEN = "site.docs.1";
-    private static final String GROUP_TOKEN_ONLY_PROJECT = "site";
-    private static final String GROUP_TOKEN_ONLY_PROJECT_AND_TOOL = "site.docs";
-    private static final String REDIRECT_LINK = "example.com/w+jsdKixyHhZA";
-    private static final String SIGNIN_TOKEN = "signin";
-    private static final String SIGNIN_TOKEN_WITH_REDIRECT = SIGNIN_TOKEN + "(" + REDIRECT_LINK + ")";
-    private static final String SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW = SIGNIN_TOKEN + "(" + SiteTokens.PREVIEW + "("
-            + REDIRECT_LINK + "))";
-    private static final String WAVE_TOKEN_SAMPLE1 = "example.com/w+abcd";
-    private static final String WAVE_TOKEN_SAMPLE2 = "example.com/w+abcd/~/conv+root";
-    private static final String WAVE_TOKEN_SAMPLE3 = "example.com/w+abcd/~/conv+root/b+45kg";
-    private TokenMatcher tokenMatcher;
+  private static final String DEF_SITE_TOKEN = "";
+  private static final String GROUP_TOKEN = "site.docs.1";
+  private static final String GROUP_TOKEN_ONLY_PROJECT = "site";
+  private static final String GROUP_TOKEN_ONLY_PROJECT_AND_TOOL = "site.docs";
+  private static final String REDIRECT_LINK = "example.com/w+jsdKixyHhZA";
+  private static final String SIGNIN_TOKEN = "signin";
+  private static final String SIGNIN_TOKEN_WITH_REDIRECT = SIGNIN_TOKEN + "(" + REDIRECT_LINK + ")";
+  private static final String SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW = SIGNIN_TOKEN + "("
+      + SiteTokens.PREVIEW + "(" + REDIRECT_LINK + "))";
+  private static final String WAVE_TOKEN_SAMPLE1 = "example.com/w+abcd";
+  private static final String WAVE_TOKEN_SAMPLE2 = "example.com/w+abcd/~/conv+root";
+  private static final String WAVE_TOKEN_SAMPLE3 = "example.com/w+abcd/~/conv+root/b+45kg";
+  private TokenMatcher tokenMatcher;
 
-    @Before
-    public void before() {
-        final ReservedWordsRegistryDTO reservedWords = new ReservedWordsRegistryDTO();
-        reservedWords.add(SIGNIN_TOKEN);
-        tokenMatcher = new TokenMatcher(reservedWords);
-        tokenMatcher.init(JavaWaverefEncoder.INSTANCE);
-    }
+  @Before
+  public void before() {
+    final ReservedWordsRegistryDTO reservedWords = new ReservedWordsRegistryDTO();
+    reservedWords.add(SIGNIN_TOKEN);
+    tokenMatcher = new TokenMatcher(reservedWords);
+    tokenMatcher.init(JavaWaverefEncoder.INSTANCE);
+  }
 
-    private void dontMatchGroupToken(final String token) {
-        assertFalse("Expected '" + token + "' dont match isGroup", tokenMatcher.isGroupToken(token));
-    }
+  private void dontMatchGroupToken(final String token) {
+    assertFalse("Expected '" + token + "' dont match isGroup", tokenMatcher.isGroupToken(token));
+  }
 
-    @Test
-    public void dontMatchRedirect() {
-        dontMatchWaveToken(SIGNIN_TOKEN_WITH_REDIRECT);
-        dontMatchGroupToken(SIGNIN_TOKEN_WITH_REDIRECT);
-        assertFalse(tokenMatcher.hasRedirect(SIGNIN_TOKEN));
-    }
+  @Test
+  public void dontMatchRedirect() {
+    dontMatchWaveToken(SIGNIN_TOKEN_WITH_REDIRECT);
+    dontMatchGroupToken(SIGNIN_TOKEN_WITH_REDIRECT);
+    assertFalse(tokenMatcher.hasRedirect(SIGNIN_TOKEN));
+  }
 
-    private void dontMatchWaveToken(final String token) {
-        assertFalse("Expected '" + token + "' dont match isWaveToken", tokenMatcher.isWaveToken(token));
-    }
+  private void dontMatchWaveToken(final String token) {
+    assertFalse("Expected '" + token + "' dont match isWaveToken", tokenMatcher.isWaveToken(token));
+  }
 
-    private void matchGroupToken(final String token) {
-        assertTrue("Expected '" + token + "' match isGroup", tokenMatcher.isGroupToken(token));
-    }
+  private void matchGroupToken(final String token) {
+    assertTrue("Expected '" + token + "' match isGroup", tokenMatcher.isGroupToken(token));
+  }
 
-    private void matchWaveToken(final String token) {
-        assertTrue("Expected '" + token + "' match isWaveToken", tokenMatcher.isWaveToken(token));
-    }
+  private void matchWaveToken(final String token) {
+    assertTrue("Expected '" + token + "' match isWaveToken", tokenMatcher.isWaveToken(token));
+  }
 
-    @Test
-    public void matchWaveToken2() {
-        matchWaveToken(WAVE_TOKEN_SAMPLE2);
-        dontMatchGroupToken(WAVE_TOKEN_SAMPLE2);
-    }
+  @Test
+  public void matchWaveToken2() {
+    matchWaveToken(WAVE_TOKEN_SAMPLE2);
+    dontMatchGroupToken(WAVE_TOKEN_SAMPLE2);
+  }
 
-    @Test
-    public void matchWaveToken3() {
-        matchWaveToken(WAVE_TOKEN_SAMPLE3);
-        dontMatchGroupToken(WAVE_TOKEN_SAMPLE3);
-    }
+  @Test
+  public void matchWaveToken3() {
+    matchWaveToken(WAVE_TOKEN_SAMPLE3);
+    dontMatchGroupToken(WAVE_TOKEN_SAMPLE3);
+  }
 
-    @Test
-    public void shouldDontMatchNull() {
-        dontMatchWaveToken(null);
-        dontMatchWaveToken("");
-        dontMatchGroupToken(null);
-        dontMatchGroupToken("");
-    }
+  @Test
+  public void shouldDontMatchNull() {
+    dontMatchWaveToken(null);
+    dontMatchWaveToken("");
+    dontMatchGroupToken(null);
+    dontMatchGroupToken("");
+  }
 
-    @Test
-    public void shouldExtractRedirect() {
-        assertTrue(tokenMatcher.hasRedirect(SIGNIN_TOKEN_WITH_REDIRECT));
-        assertEquals(SIGNIN_TOKEN, tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getLeft());
-        assertEquals(REDIRECT_LINK, tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getRight());
-    }
+  @Test
+  public void shouldExtractRedirect() {
+    assertTrue(tokenMatcher.hasRedirect(SIGNIN_TOKEN_WITH_REDIRECT));
+    assertEquals(SIGNIN_TOKEN, tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getLeft());
+    assertEquals(REDIRECT_LINK, tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getRight());
+  }
 
-    @Test
-    public void shouldExtractRedirectInSignPreview() {
-        assertTrue(tokenMatcher.hasRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW));
-        assertEquals(
-                "Expected " + SIGNIN_TOKEN + " but: "
-                        + tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW).getLeft(), SIGNIN_TOKEN,
-                tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW).getLeft());
-        // assertEquals(REDIRECT_LINK,
-        // tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getRight());
-    }
+  @Test
+  public void shouldExtractRedirectInSignPreview() {
+    assertTrue(tokenMatcher.hasRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW));
+    assertEquals(
+        "Expected " + SIGNIN_TOKEN + " but: "
+            + tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW).getLeft(), SIGNIN_TOKEN,
+        tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW).getLeft());
+    // assertEquals(REDIRECT_LINK,
+    // tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getRight());
+  }
 
-    @Test
-    public void shoulMatchCompleteToken() {
-        matchGroupToken(GROUP_TOKEN);
-        dontMatchWaveToken(GROUP_TOKEN);
-    }
+  @Test
+  public void shoulMatchCompleteToken() {
+    matchGroupToken(GROUP_TOKEN);
+    dontMatchWaveToken(GROUP_TOKEN);
+  }
 
-    @Test
-    public void shoulMatchGroupToken() {
-        matchGroupToken(GROUP_TOKEN_ONLY_PROJECT);
-        dontMatchWaveToken(GROUP_TOKEN_ONLY_PROJECT);
-    }
+  @Test
+  public void shoulMatchGroupToken() {
+    matchGroupToken(GROUP_TOKEN_ONLY_PROJECT);
+    dontMatchWaveToken(GROUP_TOKEN_ONLY_PROJECT);
+  }
 
-    @Test
-    public void shoulMatchGroupToolToken() {
-        matchGroupToken(GROUP_TOKEN_ONLY_PROJECT_AND_TOOL);
-        dontMatchWaveToken(GROUP_TOKEN_ONLY_PROJECT_AND_TOOL);
-    }
+  @Test
+  public void shoulMatchGroupToolToken() {
+    matchGroupToken("site.docs");
+    matchGroupToken(GROUP_TOKEN_ONLY_PROJECT_AND_TOOL);
+    dontMatchWaveToken(GROUP_TOKEN_ONLY_PROJECT_AND_TOOL);
+  }
 
-    @Test
-    public void testDefSiteTokenDontMatch() {
-        dontMatchWaveToken(DEF_SITE_TOKEN);
-        dontMatchGroupToken(DEF_SITE_TOKEN);
-    }
+  @Test
+  public void testDefSiteTokenDontMatch() {
+    dontMatchWaveToken(DEF_SITE_TOKEN);
+    dontMatchGroupToken(DEF_SITE_TOKEN);
+  }
 
-    @Test
-    public void testMatchWaveToken1() {
-        matchWaveToken(WAVE_TOKEN_SAMPLE1);
-        dontMatchGroupToken(WAVE_TOKEN_SAMPLE1);
-    }
+  @Test
+  public void testMatchWaveToken1() {
+    matchWaveToken(WAVE_TOKEN_SAMPLE1);
+    dontMatchGroupToken(WAVE_TOKEN_SAMPLE1);
+  }
 
-    @Test
-    public void testOtherSiteTokensDontMatch() {
-        dontMatchWaveToken(SIGNIN_TOKEN);
-        dontMatchGroupToken(SIGNIN_TOKEN);
-    }
+  @Test
+  public void testOtherSiteTokensDontMatch() {
+    dontMatchWaveToken(SIGNIN_TOKEN);
+    dontMatchGroupToken(SIGNIN_TOKEN);
+  }
 }

Modified: trunk/src/test/java/cc/kune/selenium/login/ScreenCastsViaSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/ScreenCastsViaSeleniumTests.java	2012-01-18 15:27:17 UTC (rev 1667)
+++ trunk/src/test/java/cc/kune/selenium/login/ScreenCastsViaSeleniumTests.java	2012-01-20 00:12:44 UTC (rev 1668)
@@ -65,6 +65,7 @@
     showTooltip(newGroup.projectType);
     doScreenshot("newgroup");
     newGroup.registerBtn.click();
+    sleep(2000);
     showTitleSlide(t("Group space (collaboration space) III "),
         t("Let's see the diferent tools you have available"));
     groupSpace.blogTool.click();




More information about the kune-commits mailing list