[kune-commits] r1615 - in trunk: . src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/core/client/auth src/main/java/cc/kune/core/client/notify/confirm src/main/java/cc/kune/core/client/sitebar/search src/main/java/cc/kune/core/client/sn/actions src/main/java/cc/kune/core/client/state src/main/java/cc/kune/gspace/client/tool/selector src/main/java/cc/kune/lists/server/rpc src/main/java/org/ourproject/kune src/main/java/org/waveprotocol/box/server src/main/resources src/test/java/cc/kune/core/client/state src/test/java/cc/kune/gspace/client/tool/selector src/test/java/cc/kune/selenium src/test/java/cc/kune/selenium/login src/test/java/cc/kune/selenium/spaces
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sat Nov 19 14:15:25 CET 2011
Author: vjrj_
Date: 2011-11-19 14:15:24 +0100 (Sat, 19 Nov 2011)
New Revision: 1615
Added:
trunk/src/test/java/cc/kune/selenium/spaces/SitePageObject.java
Removed:
trunk/src/main/java/cc/kune/chat/client/actions/conditions/
trunk/src/main/java/org/ourproject/kune/gallery/
trunk/src/main/java/org/waveprotocol/box/server/rpc/
trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java
Modified:
trunk/.classpath
trunk/pom.xml
trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java
trunk/src/main/java/cc/kune/core/client/sitebar/search/EntitySearchPanel.java
trunk/src/main/java/cc/kune/core/client/sitebar/search/SearchBoxFactory.java
trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java
trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
trunk/src/main/resources/TestConstants_en.properties
trunk/src/main/resources/TestConstants_es.properties
trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java
trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java
Log:
CLOSED - # 162: Add [siteprojectprefix] to lists and posts title names
http://kune.ourproject.org/issues/ticket/162
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/.classpath 2011-11-19 13:15:24 UTC (rev 1615)
@@ -43,7 +43,7 @@
<classpathentry kind="var" path="M2_REPO/com/calclab/emite/emite-proxy/0.1/emite-proxy-0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3.jar" sourcepath="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r09/guava-r09.jar" sourcepath="M2_REPO/com/google/guava/guava/r09/guava-r09-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/10.0.1/guava-10.0.1.jar" sourcepath="M2_REPO/com/google/guava/guava/10.0.1/guava-10.0.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/guava/guava-gwt/r09/guava-gwt-r09.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/inject/guice/3.0/guice-3.0.jar" sourcepath="M2_REPO/com/google/inject/guice/3.0/guice-3.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/inject/extensions/guice-assisted-inject/2.0/guice-assisted-inject-2.0.jar"/>
@@ -95,6 +95,7 @@
<classpathentry kind="var" path="M2_REPO/net/sf/json-lib/json-lib/2.1/json-lib-2.1-jdk15.jar" sourcepath="M2_REPO/net/sf/json-lib/json-lib/2.1/json-lib-2.1-jdk15-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jsoup/jsoup/1.2.2/jsoup-1.2.2.jar" sourcepath="M2_REPO/org/jsoup/jsoup/1.2.2/jsoup-1.2.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/findbugs/jsr-305/v0r47/jsr-305-v0r47.jar" sourcepath="M2_REPO/net/sourceforge/findbugs/jsr-305/v0r47/jsr-305-v0r47-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jukito/jukito/1.0/jukito-1.0.jar" sourcepath="M2_REPO/org/jukito/jukito/1.0/jukito-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.9/junit-4.9.jar" sourcepath="M2_REPO/junit/junit/4.9/junit-4.9-sources.jar"/>
@@ -121,16 +122,16 @@
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.5/proto-msg-0.3.5.jar"/>
<classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar" sourcepath="M2_REPO/org/w3c/css/sac/1.3/sac-1.3-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.8.0/selenium-android-driver-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.8.0/selenium-android-driver-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-api/2.8.0/selenium-api-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-api/2.8.0/selenium-api-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.8.0/selenium-chrome-driver-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.8.0/selenium-chrome-driver-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.8.0/selenium-firefox-driver-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.8.0/selenium-firefox-driver-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.8.0/selenium-htmlunit-driver-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.8.0/selenium-htmlunit-driver-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.8.0/selenium-ie-driver-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.8.0/selenium-ie-driver-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-iphone-driver/2.8.0/selenium-iphone-driver-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-iphone-driver/2.8.0/selenium-iphone-driver-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-java/2.8.0/selenium-java-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-java/2.8.0/selenium-java-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/2.8.0/selenium-remote-driver-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/2.8.0/selenium-remote-driver-2.8.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-support/2.8.0/selenium-support-2.8.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-support/2.8.0/selenium-support-2.8.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.12.0/selenium-android-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.12.0/selenium-android-driver-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-api/2.12.0/selenium-api-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-api/2.12.0/selenium-api-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.12.0/selenium-chrome-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.12.0/selenium-chrome-driver-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.12.0/selenium-firefox-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.12.0/selenium-firefox-driver-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.12.0/selenium-htmlunit-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.12.0/selenium-htmlunit-driver-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.12.0/selenium-ie-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.12.0/selenium-ie-driver-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-iphone-driver/2.12.0/selenium-iphone-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-iphone-driver/2.12.0/selenium-iphone-driver-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-java/2.12.0/selenium-java-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-java/2.12.0/selenium-java-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/2.12.0/selenium-remote-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/2.12.0/selenium-remote-driver-2.12.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-support/2.12.0/selenium-support-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-support/2.12.0/selenium-support-2.12.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xalan/serializer/2.7.1/serializer-2.7.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1-sources.jar"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/pom.xml 2011-11-19 13:15:24 UTC (rev 1615)
@@ -489,7 +489,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
- <version>2.8.0</version>
+ <version>2.12.0</version>
<exclusions>
<exclusion>
<groupId>com.google.collections</groupId>
Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -205,24 +205,20 @@
}
private void showWelcolmeDialog() {
- NotifyUser.info(
- i18n.t("Welcome"),
- i18n.t(
- "Thanks for joining [%s]. "
- + "Now you can actively participate in [%s]. "
- + "You can also use your personal space to publish contents. "
- + "Note: your email is not verified, please follow the instructions you will receive by email.",
- siteCommonName, siteCommonName), Register.WELCOME_ID, true);
+ NotifyUser.info(i18n.t("Welcome"), i18n.t("Thanks for joining [%s]. "
+ + "Now you can actively participate in [%s]. "
+ + "You can also use your personal space to publish contents. ",
+ // +
+ // "Note: your email is not verified, please follow the instructions you will receive by email.",
+ siteCommonName, siteCommonName), Register.WELCOME_ID, true);
}
private void showWelcolmeDialogNoHomepage() {
- NotifyUser.info(
- i18n.t("Welcome"),
- i18n.t(
- "Thanks for joining [%s]. "
- + "Now you can actively participate in [%s]. "
- + "Note: your email is not verified, please follow the instructions you will receive by email.",
- siteCommonName, siteCommonName), Register.WELCOME_ID, true);
+ NotifyUser.info(i18n.t("Welcome"), i18n.t("Thanks for joining [%s]. "
+ + "Now you can actively participate in [%s]. ",
+ // +
+ // "Note: your email is not verified, please follow the instructions you will receive by email.",
+ siteCommonName, siteCommonName), Register.WELCOME_ID, true);
}
};
userServiceProvider.get().createUser(user, wantHomepage, callback);
Modified: trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -34,9 +34,9 @@
import com.gwtplatform.mvp.client.ViewImpl;
public class UserConfirmPanel extends ViewImpl implements UserConfirmView {
- private static final String CANCEL_ID = "k-conf-dial";
- private static final String DIALOG_ID = "k-conf-dial-nok";
- private static final String OK_ID = "k-conf-dial-ok";
+ public static final String CANCEL_ID = "k-conf-dial";
+ public static final String DIALOG_ID = "k-conf-dial-nok";
+ public static final String OK_ID = "k-conf-dial-ok";
private HandlerRegistration acceptHandler;
private final HTML askLabel;
private HandlerRegistration cancelHandler;
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/search/EntitySearchPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/search/EntitySearchPanel.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/search/EntitySearchPanel.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -38,7 +38,6 @@
public abstract class EntitySearchPanel {
public static final String DIALOG_ID = "entity-search-panel-diag";
- public static final String ENTITY_SEARCH_TEXTBOX = "kune-ssp-tbox";
public static final String OK_ID = "entity-search-panel-ok-id";
private static final int SEARCH_TEXT_HEIGHT = 13;
private static final int SEARCH_TEXT_WIDTH_BIG = 160;
@@ -68,14 +67,14 @@
searchTextBox.setValue("");
}
- private void create() {
+ private void create(final String id) {
dialog.getTitleText().setText(
i18n.t(searchOnlyUsers ? "Type the name of the user and select him/her:"
: "Type the name of the user or group and select it:"), i18n.getDirection());
- final MultivalueSuggestBox multivalueSBox = SearchBoxFactory.create(i18n, searchOnlyUsers, callback);
+ final MultivalueSuggestBox multivalueSBox = SearchBoxFactory.create(i18n, searchOnlyUsers, id,
+ callback);
suggestBox = multivalueSBox.getSuggestBox();
searchTextBox = suggestBox.getTextBox();
- searchTextBox.ensureDebugId(ENTITY_SEARCH_TEXTBOX);
dialog.getInnerPanel().add(multivalueSBox);
setTextSearchSmallImpl();
}
@@ -92,10 +91,11 @@
return searchTextBox;
}
- public void init(final OnEntitySelectedInSearch callback, final boolean searchOnlyUsers) {
+ public void init(final boolean searchOnlyUsers, final String id,
+ final OnEntitySelectedInSearch callback) {
this.callback = callback;
this.searchOnlyUsers = searchOnlyUsers;
- create();
+ create(id);
}
public void selectSearchText() {
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/search/SearchBoxFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/search/SearchBoxFactory.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/search/SearchBoxFactory.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -26,11 +26,12 @@
import com.google.gwt.i18n.client.HasDirection.Direction;
import com.google.gwt.user.client.ui.SuggestBox;
import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;
+import com.google.gwt.user.client.ui.TextBoxBase;
public class SearchBoxFactory {
public static MultivalueSuggestBox create(final I18nUITranslationService i18n,
- final boolean searchOnlyUsers, final OnEntitySelectedInSearch callback) {
+ final boolean searchOnlyUsers, final String id, final OnEntitySelectedInSearch callback) {
final MultivalueSuggestBox multivalueSBox = new MultivalueSuggestBox(
searchOnlyUsers ? SearcherConstants.USER_DATA_PROXY_URL : SearcherConstants.GROUP_DATA_PROXY_URL,
false, new OnExactMatch() {
@@ -57,13 +58,16 @@
}
};
};
+
final String siteCommonName = i18n.getSiteCommonName();
final SuggestBox suggestBox = multivalueSBox.getSuggestBox();
Tooltip.to(
suggestBox,
searchOnlyUsers ? i18n.t("Type something to search for users in [%s]", siteCommonName) : i18n.t(
"Type something to search for users and groups in [%s]", siteCommonName));
- suggestBox.getTextBox().setDirection(i18n.isRTL() ? Direction.RTL : Direction.LTR);
+ final TextBoxBase textBox = suggestBox.getTextBox();
+ textBox.setDirection(i18n.isRTL() ? Direction.RTL : Direction.LTR);
+ textBox.ensureDebugId(id);
return multivalueSBox;
}
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -43,7 +43,6 @@
private static final int SEARCH_TEXT_WIDTH_BIG = 160;
private static final int SEARCH_TEXT_WIDTH_SMALL = 120;
public static final String SITE_SEARCH_BUTTON = "kune-ssp-searchbt";
-
public static final String SITE_SEARCH_TEXTBOX = "kune-ssp-tbox";
private final PushButton searchButton;
private final TextBoxBase searchTextBox;
@@ -55,7 +54,7 @@
searchButton = new PushButton(new Image(img.kuneSearchIco()), new Image(img.kuneSearchIcoPush()));
searchButton.ensureDebugId(SITE_SEARCH_BUTTON);
final MultivalueSuggestBox multivalueSBox = SearchBoxFactory.create(i18n, false,
- new OnEntitySelectedInSearch() {
+ SITE_SEARCH_TEXTBOX, new OnEntitySelectedInSearch() {
@Override
public void onSeleted(final String shortName) {
stateManager.gotoHistoryToken(shortName);
@@ -63,7 +62,6 @@
});
suggestBox = multivalueSBox.getSuggestBox();
searchTextBox = suggestBox.getTextBox();
- searchTextBox.ensureDebugId(SITE_SEARCH_TEXTBOX);
searchTextBox.addStyleName("k-fr");
searchTextBox.addStyleName("k-sitebarsearch");
searchTextBox.addStyleName("k-fr");
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AddEntityToThisGroupAction.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -39,6 +39,7 @@
public class AddEntityToThisGroupAction extends SNRolAction {
+ public static final String ADD_NEW_MEMBER_TEXTBOX = "kune-add-newMember-tbox";
private final AddMemberSearchPanel searchPanel;
@Inject
@@ -52,37 +53,37 @@
putValue(NAME, i18n.t("Add new member"));
putValue(Action.SMALL_ICON, res.add());
putValue(Action.STYLES, "k-sn-join");
- searchPanel.init(new OnEntitySelectedInSearch() {
- @Override
- public void onSeleted(final String shortName) {
- NotifyUser.askConfirmation(
- i18n.t("Are you sure?"),
- i18n.t("Do you want to add '[%s]' as a member of '[%s]'?", shortName,
- session.getCurrentGroupShortName()), new SimpleResponseCallback() {
- @Override
- public void onCancel() {
- }
+ searchPanel.init(// In the future, with this to false, we'll be add groups
+ // to groups!
+ true, ADD_NEW_MEMBER_TEXTBOX, new OnEntitySelectedInSearch() {
+ @Override
+ public void onSeleted(final String shortName) {
+ NotifyUser.askConfirmation(
+ i18n.t("Are you sure?"),
+ i18n.t("Do you want to add '[%s]' as a member of '[%s]'?", shortName,
+ session.getCurrentGroupShortName()), new SimpleResponseCallback() {
+ @Override
+ public void onCancel() {
+ }
- @Override
- public void onSuccess() {
- NotifyUser.showProgress();
- snServiceProvider.get().addCollabMember(session.getUserHash(),
- session.getCurrentStateToken(), shortName,
- new AsyncCallbackSimple<SocialNetworkDataDTO>() {
- @Override
- public void onSuccess(final SocialNetworkDataDTO result) {
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Member added as collaborator"));
- stateManager.setSocialNetwork(result);
- }
- });
- }
- });
- }
+ @Override
+ public void onSuccess() {
+ NotifyUser.showProgress();
+ snServiceProvider.get().addCollabMember(session.getUserHash(),
+ session.getCurrentStateToken(), shortName,
+ new AsyncCallbackSimple<SocialNetworkDataDTO>() {
+ @Override
+ public void onSuccess(final SocialNetworkDataDTO result) {
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Member added as collaborator"));
+ stateManager.setSocialNetwork(result);
+ }
+ });
+ }
+ });
+ }
- },
- // In the future, with this to false, we'll be add groups to groups!
- true);
+ });
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -33,6 +33,7 @@
import com.google.inject.Inject;
public class AddNewBuddiesAction extends AbstractExtendedAction {
+ public static final String ADD_NEW_BUDDIES_TEXTBOX = "kune-add-newbuddies-tbox";
private final EntitySearchPanel searchPanel;
@@ -42,7 +43,7 @@
this.searchPanel = searchPanel;
putValue(Action.NAME, i18n.t("Add a new buddy"));
putValue(Action.SMALL_ICON, res.addGreen());
- searchPanel.init(new OnEntitySelectedInSearch() {
+ searchPanel.init(true, ADD_NEW_BUDDIES_TEXTBOX, new OnEntitySelectedInSearch() {
@Override
public void onSeleted(final String shortName) {
NotifyUser.askConfirmation(i18n.t("Are you sure?"),
@@ -59,7 +60,7 @@
}
});
}
- }, true);
+ });
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -55,7 +55,6 @@
private final EventBus eventBus;
private final HistoryWrapper history;
private StateToken previousGroupToken;
- private final StateToken previousToken;
/**
* When a historyChanged is interrupted (for instance because you are editing
* something), the new history token is stored here
@@ -75,7 +74,6 @@
this.session = session;
this.history = history;
this.previousGroupToken = null;
- this.previousToken = null;
this.resumedHistoryToken = null;
tokenMatcher.init(GwtWaverefEncoder.INSTANCE);
this.siteTokens = siteTokens;
@@ -126,7 +124,7 @@
final String newTokenTool = newState.getStateToken().getTool();
final String newToolName = newTokenTool == null ? "" : newTokenTool;
if (startingUp() || previousToolName == null || !previousToolName.equals(newToolName)) {
- ToolChangedEvent.fire(eventBus, previousToolName, newToolName);
+ ToolChangedEvent.fire(eventBus, previousGroupToken, newState.getStateToken());
}
}
@@ -233,8 +231,7 @@
eventBus.addHandler(ToolChangedEvent.getType(), handler);
final StateAbstractDTO currentState = session.getCurrentState();
if (fireNow && currentState != null) {
- handler.onToolChanged(new ToolChangedEvent(getPreviousTool(),
- currentState.getStateToken().getTool()));
+ handler.onToolChanged(new ToolChangedEvent(previousGroupToken, currentState.getStateToken()));
}
}
Modified: trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -19,12 +19,14 @@
*/
package cc.kune.core.client.state;
+import cc.kune.core.shared.domain.utils.StateToken;
+
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;
-public class ToolChangedEvent extends GwtEvent<ToolChangedEvent.ToolChangedHandler> {
+public class ToolChangedEvent extends GwtEvent<ToolChangedEvent.ToolChangedHandler> {
public interface HasToolChangedHandlers extends HasHandlers {
HandlerRegistration addToolChangedHandler(ToolChangedHandler handler);
@@ -36,80 +38,93 @@
private static final Type<ToolChangedHandler> TYPE = new Type<ToolChangedHandler>();
- public static void fire(HasHandlers source, java.lang.String previousTool, java.lang.String newTool) {
- source.fireEvent(new ToolChangedEvent(previousTool, newTool));
+ public static void fire(final HasHandlers source, final StateToken previousToken,
+ final StateToken newToken) {
+ source.fireEvent(new ToolChangedEvent(previousToken, newToken));
}
public static Type<ToolChangedHandler> getType() {
return TYPE;
}
- java.lang.String previousTool;
- java.lang.String newTool;
+ private StateToken newToken;
+ private StateToken previousToken;
- public ToolChangedEvent(java.lang.String previousTool, java.lang.String newTool) {
- this.previousTool = previousTool;
- this.newTool = newTool;
- }
-
protected ToolChangedEvent() {
// Possibly for serialization.
}
- @Override
- public Type<ToolChangedHandler> getAssociatedType() {
- return TYPE;
+ public ToolChangedEvent(final StateToken previousToken, final StateToken newToken) {
+ this.previousToken = previousToken;
+ this.newToken = newToken;
}
- public java.lang.String getPreviousTool() {
- return previousTool;
- }
-
- public java.lang.String getNewTool() {
- return newTool;
- }
-
@Override
- protected void dispatch(ToolChangedHandler handler) {
+ protected void dispatch(final ToolChangedHandler handler) {
handler.onToolChanged(this);
}
@Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final ToolChangedEvent other = (ToolChangedEvent) obj;
+ if (newToken == null) {
+ if (other.newToken != null) {
return false;
- if (getClass() != obj.getClass())
- return false;
- ToolChangedEvent other = (ToolChangedEvent) obj;
- if (previousTool == null) {
- if (other.previousTool != null)
- return false;
- } else if (!previousTool.equals(other.previousTool))
+ }
+ } else if (!newToken.equals(other.newToken)) {
return false;
- if (newTool == null) {
- if (other.newTool != null)
+ }
+ if (previousToken == null) {
+ if (other.previousToken != null) {
return false;
- } else if (!newTool.equals(other.newTool))
+ }
+ } else if (!previousToken.equals(other.previousToken)) {
return false;
+ }
return true;
}
@Override
+ public Type<ToolChangedHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ public StateToken getNewToken() {
+ return newToken;
+ }
+
+ public java.lang.String getNewTool() {
+ return newToken != null ? newToken.getTool() : null;
+ }
+
+ public StateToken getPreviousToken() {
+ return previousToken;
+ }
+
+ public java.lang.String getPreviousTool() {
+ return previousToken != null ? previousToken.getTool() : null;
+ }
+
+ @Override
public int hashCode() {
- int hashCode = 23;
- hashCode = (hashCode * 37) + (previousTool == null ? 1 : previousTool.hashCode());
- hashCode = (hashCode * 37) + (newTool == null ? 1 : newTool.hashCode());
- return hashCode;
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((newToken == null) ? 0 : newToken.hashCode());
+ result = prime * result + ((previousToken == null) ? 0 : previousToken.hashCode());
+ return result;
}
@Override
public String toString() {
- return "ToolChangedEvent["
- + previousTool
- + ","
- + newTool
- + "]";
+ return "ToolChangedEvent[" + getPreviousTool() + "," + getNewTool() + "]";
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -24,6 +24,7 @@
import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.log.Log;
+import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.state.GroupChangedEvent;
import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
import cc.kune.core.client.state.StateChangedEvent;
@@ -83,18 +84,10 @@
stateManager.onToolChanged(false, new ToolChangedHandler() {
@Override
public void onToolChanged(final ToolChangedEvent event) {
- ToolSelectorPresenter.this.onToolChanged(event.getPreviousTool(), event.getNewTool());
+ ToolSelectorPresenter.this.onToolChanged(event.getPreviousTool(), event.getNewTool(),
+ event.getPreviousToken(), event.getNewToken());
}
});
- stateManager.onStateChanged(true, new StateChangedHandler() {
- @Override
- public void onStateChanged(final StateChangedEvent event) {
- final StateToken token = event.getState().getStateToken();
- if (token.hasAll() || token.hasGroupToolAndFolder()) {
- tools.get(token.getTool()).setToken(token);
- }
- }
- });
}
@Override
@@ -124,17 +117,20 @@
}
}
- void onToolChanged(final String oldTool, final String newTool) {
+ void onToolChanged(final String oldTool, final String newTool, final StateToken oldToken,
+ final StateToken newToken) {
Log.debug("Registered tools: " + tools.keySet().toString());
- if (oldTool != null && !oldTool.equals("")) {
+ if (TextUtils.notEmpty(oldTool)) {
final ToolSelectorItem tool = tools.get(oldTool);
checkTool(tool);
tool.setSelected(false);
+ tool.setToken(oldToken);
}
- if (!newTool.equals("")) {
+ if (TextUtils.notEmpty(newTool)) {
final ToolSelectorItem tool = tools.get(newTool);
checkTool(tool);
tool.setSelected(true);
+ tool.setToken(newToken.copy().clearDocument().clearFolder());
}
}
Modified: trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -55,18 +55,28 @@
this.contentManager = contentManager;
}
+ private String composeListName(final StateToken parentToken, final String listname) {
+ // FIXME In the future use tabs here
+ return parentToken.getGroup() + "-" + listname;
+ }
+
@Override
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.container)
@Transactional
public StateContainerDTO createList(final String userHash, final StateToken parentToken,
- final String title, final String description, final boolean isPublic) {
- final StateContainerDTO result = contentRPC.addFolder(userHash, parentToken, title,
- ListsConstants.TYPE_LIST);
+ final String listaName, final String description, final boolean isPublic) {
+ final StateContainerDTO result = contentRPC.addFolder(userHash, parentToken,
+ composeListName(parentToken, listaName), ListsConstants.TYPE_LIST);
// Not public list, don't permit subscriptions neither view posts
return contentRPC.getState(setContainerAcl(result.getStateToken(), isPublic));
}
+ private Container getContainer(final StateToken token) {
+ final Container container = contentManager.find(ContentUtils.parseId(token.getFolder()));
+ return container;
+ }
+
private Group getUserGroup() {
return userSessionManager.getUser().getUserGroup();
}
@@ -75,14 +85,17 @@
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Viewer, actionLevel = ActionLevel.container)
@Transactional
- public StateContentDTO newPost(final String userHash, final StateToken parentToken, final String title) {
- final StateContentDTO content = contentRPC.addContent(userHash, parentToken, title,
- ListsConstants.TYPE_POST);
+ public StateContentDTO newPost(final String userHash, final StateToken parentToken,
+ final String postTitle) {
+ final Container container = getContainer(parentToken);
+ final StateContentDTO content = contentRPC.addContent(userHash, parentToken,
+ "[" + container.getName() + "] " + postTitle, ListsConstants.TYPE_POST);
+ // FIXME In the future use tabs here
return content;
}
private Container setContainerAcl(final StateToken token, final boolean isPublic) {
- final Container container = contentManager.find(ContentUtils.parseId(token.getFolder()));
+ final Container container = getContainer(token);
final AccessLists acl = new AccessLists();
acl.getAdmins().setMode(GroupListMode.NORMAL);
acl.getAdmins().add(getUserGroup());
@@ -102,7 +115,7 @@
}
private Container setPublicAcl(final StateToken token, final boolean isPublic) {
- final Container container = contentManager.find(ContentUtils.parseId(token.getFolder()));
+ final Container container = getContainer(token);
final AccessLists acl = container.getAccessLists();
setViewersAcl(isPublic, acl);
contentManager.setAccessList(container, acl);
@@ -120,7 +133,7 @@
@Transactional
public StateContainerDTO subscribeToList(final String userHash, final StateToken token,
final Boolean subscribe) {
- final Container container = contentManager.find(ContentUtils.parseId(token.getFolder()));
+ final Container container = getContainer(token);
final AccessLists acl = container.getAccessLists();
if (subscribe) {
if (!acl.getAdmins().includes(getUserGroup())
Modified: trunk/src/main/resources/TestConstants_en.properties
===================================================================
--- trunk/src/main/resources/TestConstants_en.properties 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/resources/TestConstants_en.properties 2011-11-19 13:15:24 UTC (rev 1615)
@@ -36,4 +36,6 @@
janeDoe = Jane Doe
janeexampleOrg = jane at example.org
thankYou = Thank you
-andYesFeedbackWelcome = and yes, feedback welcome
\ No newline at end of file
+andYesFeedbackWelcome = and yes, feedback welcome
+yourPersonalPublicSpace = Your personal public space
+hereYouCanHaveYourBlogEtc = here you can have your blog, etc
\ No newline at end of file
Modified: trunk/src/main/resources/TestConstants_es.properties
===================================================================
--- trunk/src/main/resources/TestConstants_es.properties 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/main/resources/TestConstants_es.properties 2011-11-19 13:15:24 UTC (rev 1615)
@@ -30,4 +30,6 @@
janeDoe = Ruth Mengana
janeexampleOrg = ruth at example.org
thankYou = Gracias
-andYesFeedbackWelcome = y sí, tu feedback es muy bienvenido
\ No newline at end of file
+andYesFeedbackWelcome = y sí, tu feedback es muy bienvenido
+yourPersonalPublicSpace = Tu espacio público personal
+hereYouCanHaveYourBlogEtc = aquí puedes tener tu blog, etc
\ No newline at end of file
Modified: trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -43,6 +43,10 @@
public class StateManagerDefaultTest {
+ private static final StateToken EMPTY_TOKEN = null;
+ private static final StateToken GROUP1_TOOL1 = new StateToken("group1.tool1");
+ private static final StateToken GROUP1_TOOL2 = new StateToken("group1.tool2");
+ private static final StateToken GROUP2_TOOL1 = new StateToken("group2.tool1");
private static final String HASH = "someUserHash";
private BeforeActionListener beforeChangeListener1;
private BeforeActionListener beforeChangeListener2;
@@ -134,9 +138,10 @@
new GroupChangedEvent("", "group2"));
Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
new GroupChangedEvent("group2", "group1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
- new ToolChangedEvent("tool1", "tool2"));
+ new ToolChangedEvent(EMPTY_TOKEN, GROUP2_TOOL1));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ new ToolChangedEvent(GROUP2_TOOL1, GROUP1_TOOL2));
}
@Test
@@ -156,7 +161,8 @@
new GroupChangedEvent("", "group1"));
Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
new GroupChangedEvent("group1", "group2"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ new ToolChangedEvent(null, GROUP1_TOOL1));
}
@@ -171,9 +177,10 @@
(ToolChangedEvent) Mockito.anyObject());
Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
new GroupChangedEvent("", "group1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
- new ToolChangedEvent("tool1", "tool2"));
+ new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ new ToolChangedEvent(GROUP1_TOOL1, GROUP1_TOOL2));
}
@Test
@@ -187,8 +194,10 @@
(ToolChangedEvent) Mockito.anyObject());
Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
new GroupChangedEvent("", "group1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("tool1", ""));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ new ToolChangedEvent(GROUP1_TOOL1, new StateToken("group1")));
}
@Test
@@ -202,7 +211,8 @@
(ToolChangedEvent) Mockito.anyObject());
Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
new GroupChangedEvent("", "group1"));
- Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(new ToolChangedEvent("", "tool1"));
+ Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+ new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
}
private String confBeforeStateChangeListeners(final boolean value, final boolean value2) {
Modified: trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java
===================================================================
--- trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -25,105 +25,106 @@
import cc.kune.core.client.state.EventBusTester;
import cc.kune.core.client.state.StateManager;
-import cc.kune.gspace.client.tool.selector.ToolSelectorItem;
-import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorProxy;
import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorView;
public class ToolSelectorPresenterTest {
- private static final String GROUP1_NAME = "group1";
- private static final String TOOL1_NAME = "tool1";
- private static final String TOOL2_NAME = "tool2";
- private ToolSelectorPresenter toolSelector;
- private ToolSelectorItem toolSelectorItem1;
- private ToolSelectorItem toolSelectorItem2;
+ private static final String GROUP1_NAME = "group1";
+ private static final StateToken GROUP1_TOOL1 = new StateToken("group1.tool1");
+ private static final StateToken GROUP1_TOOL2 = new StateToken("group1.tool2");
+ private static final String TOOL1_NAME = "tool1";
+ private static final String TOOL2_NAME = "tool2";
+ private ToolSelectorPresenter toolSelector;
+ private ToolSelectorItem toolSelectorItem1;
+ private ToolSelectorItem toolSelectorItem2;
- @Test
- public void addFirstToolMustNotSelect() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- Mockito.verify(toolSelectorItem1).setSelected(false);
- }
+ @Test
+ public void addFirstToolMustNotSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ }
- @Test(expected = RuntimeException.class)
- public void addToolWithoutNameMustGiveException() {
- toolSelector.addTool(toolSelectorItem1);
- }
+ @Test(expected = RuntimeException.class)
+ public void addToolWithoutNameMustGiveException() {
+ toolSelector.addTool(toolSelectorItem1);
+ }
- @Test
- public void addTwoToolsMustSelectNothing() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- Mockito.verify(toolSelectorItem1).setSelected(false);
- Mockito.verify(toolSelectorItem2).setSelected(false);
- }
+ @Test
+ public void addTwoToolsMustSelectNothing() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ Mockito.verify(toolSelectorItem2).setSelected(false);
+ }
- @Test(expected = RuntimeException.class)
- public void addTwoToolsWithSameNameMustGiveException() {
- setToolNames();
- final ToolSelectorItem toolSelectorItemCopy = Mockito.mock(ToolSelectorItem.class);
- Mockito.when(toolSelectorItemCopy.getShortName()).thenReturn(TOOL1_NAME);
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItemCopy);
- }
+ @Test(expected = RuntimeException.class)
+ public void addTwoToolsWithSameNameMustGiveException() {
+ setToolNames();
+ final ToolSelectorItem toolSelectorItemCopy = Mockito.mock(ToolSelectorItem.class);
+ Mockito.when(toolSelectorItemCopy.getShortName()).thenReturn(TOOL1_NAME);
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItemCopy);
+ }
- @Before
- public void begin() {
- final StateManager stateManager = Mockito.mock(StateManager.class);
- // final WsThemeManager themePresenter =
- // Mockito.mock(WsThemeManager.class);
- toolSelector = new ToolSelectorPresenter(new EventBusTester(), Mockito.mock(ToolSelectorView.class),
- Mockito.mock(ToolSelectorProxy.class), stateManager);
- toolSelectorItem1 = Mockito.mock(ToolSelectorItem.class);
- toolSelectorItem2 = Mockito.mock(ToolSelectorItem.class);
- }
+ @Before
+ public void begin() {
+ final StateManager stateManager = Mockito.mock(StateManager.class);
+ // final WsThemeManager themePresenter =
+ // Mockito.mock(WsThemeManager.class);
+ toolSelector = new ToolSelectorPresenter(new EventBusTester(), Mockito.mock(ToolSelectorView.class),
+ Mockito.mock(ToolSelectorProxy.class), stateManager);
+ toolSelectorItem1 = Mockito.mock(ToolSelectorItem.class);
+ toolSelectorItem2 = Mockito.mock(ToolSelectorItem.class);
+ }
- @Test
- public void setStateFirstMustSelect() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.onToolChanged("", TOOL1_NAME);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(true);
- }
+ @Test
+ public void setStateFirstMustSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.onToolChanged("", TOOL1_NAME, null, GROUP1_TOOL1);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(true);
+ }
- @Test
- public void setStateWithADifferentGroupMustSetLink() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onGroupChanged(GROUP1_NAME);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
- }
+ @Test
+ public void setStateWithADifferentGroupMustSetLink() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onGroupChanged(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ }
- @Test
- public void setStateWithADifferentToolNameMustSelectAndUnSelectTheOlder() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onToolChanged(TOOL1_NAME, TOOL2_NAME);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(true);
- }
+ @Test
+ public void setStateWithADifferentToolNameMustSelectAndUnSelectTheOlder() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onToolChanged(TOOL1_NAME, TOOL2_NAME, GROUP1_TOOL1, GROUP1_TOOL2);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(true);
+ }
- @Test
- public void setStateWithNoToolNameMustUnSelectTheOlder() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onToolChanged(TOOL1_NAME, "");
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
- Mockito.verify(toolSelectorItem2, Mockito.never()).setSelected(true);
- }
+ @Test
+ public void setStateWithNoToolNameMustUnSelectTheOlder() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onToolChanged(TOOL1_NAME, "", GROUP1_TOOL1, null);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
+ Mockito.verify(toolSelectorItem2, Mockito.never()).setSelected(true);
+ }
- public void setToolNames() {
- Mockito.when(toolSelectorItem1.getShortName()).thenReturn(TOOL1_NAME);
- Mockito.when(toolSelectorItem2.getShortName()).thenReturn(TOOL2_NAME);
- }
+ public void setToolNames() {
+ Mockito.when(toolSelectorItem1.getShortName()).thenReturn(TOOL1_NAME);
+ Mockito.when(toolSelectorItem2.getShortName()).thenReturn(TOOL2_NAME);
+ }
}
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -26,7 +26,8 @@
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.Dimension;
+import org.openqa.selenium.Point;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;
@@ -47,7 +48,7 @@
import cc.kune.selenium.login.RegisterPageObject;
import cc.kune.selenium.spaces.GroupSpacePageObject;
import cc.kune.selenium.spaces.HomeSpacePageObject;
-import cc.kune.selenium.spaces.SpacesPageObject;
+import cc.kune.selenium.spaces.SitePageObject;
import cc.kune.selenium.spaces.UserSpacePageObject;
import com.google.inject.Guice;
@@ -68,7 +69,7 @@
protected LoginPageObject login;
private final ResourceBundle messages;
protected RegisterPageObject register;
- protected final SpacesPageObject spaces;
+ protected final SitePageObject site;
protected UserSpacePageObject userSpace;
private final WebDriver webdriver;
@@ -95,7 +96,7 @@
login = injector.getInstance(LoginPageObject.class);
register = injector.getInstance(RegisterPageObject.class);
entityHeader = injector.getInstance(EntityHeaderPageObject.class);
- spaces = injector.getInstance(SpacesPageObject.class);
+ site = injector.getInstance(SitePageObject.class);
chat = injector.getInstance(ChatPageObject.class);
homeSpace = injector.getInstance(HomeSpacePageObject.class);
userSpace = injector.getInstance(UserSpacePageObject.class);
@@ -105,7 +106,7 @@
PageFactory.initElements(locator, login);
PageFactory.initElements(locator, register);
PageFactory.initElements(locator, entityHeader);
- PageFactory.initElements(locator, spaces);
+ PageFactory.initElements(locator, site);
PageFactory.initElements(locator, chat);
PageFactory.initElements(locator, homeSpace);
PageFactory.initElements(locator, userSpace);
@@ -124,8 +125,8 @@
@BeforeSuite
public void beforeSuite() {
+ resize();
home();
- resize();
SeleniumUtils.initCursor(webdriver);
SeleniumUtils.showCursor(webdriver);
SeleniumUtils.showCursor(webdriver, login.getAnonMsg());
@@ -202,8 +203,11 @@
// 1024,769
// 840,770
// 806,707
- final JavascriptExecutor js = (JavascriptExecutor) webdriver;
- js.executeScript("window.resizeTo(806,707); window.moveTo(0,0);");
+ webdriver.manage().window().setPosition(new Point(0, 0));
+ webdriver.manage().window().setSize(new Dimension(806, 707));
+ // Before we were using:
+ // final JavascriptExecutor js = (JavascriptExecutor) webdriver;
+ // js.executeScript("window.resizeTo(806,707); window.moveTo(0,0);");
}
public void showCursor(final int x, final int y) {
Modified: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -38,7 +38,7 @@
import cc.kune.selenium.general.EntityHeaderPageObject;
import cc.kune.selenium.login.LoginPageObject;
import cc.kune.selenium.login.RegisterPageObject;
-import cc.kune.selenium.spaces.SpacesPageObject;
+import cc.kune.selenium.spaces.SitePageObject;
import com.google.inject.Singleton;
@@ -69,7 +69,7 @@
bind(RegisterPageObject.class).in(Singleton.class);
bind(EntityHeaderPageObject.class).in(Singleton.class);
bind(ChatPageObject.class).in(Singleton.class);
- bind(SpacesPageObject.class).in(Singleton.class);
+ bind(SitePageObject.class).in(Singleton.class);
final ResourceBundle english = ResourceBundle.getBundle("TestConstants", Locale.ENGLISH);
final ResourceBundle spanish = ResourceBundle.getBundle("TestConstants", new Locale("es"));
Modified: trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -86,9 +86,14 @@
// group space
showTitleSlide(t("Your personal public space"), t("here you can have your blog, etc"));
- spaces.groupBtn().click();
+ site.groupBtn().click();
groupSpace.addBuddieBtn().click();
- groupSpace.searchEntitiesTextBox().sendKeys("admin\n");
+ groupSpace.addNewBuddieTextBox.click();
+ groupSpace.addNewBuddieTextBox.sendKeys("admin");
+ groupSpace.addNewBuddieTextBox.sendKeys(Keys.ARROW_DOWN);
+ sleep(500);
+ groupSpace.firstFromSuggestionBox.click();
+ site.confirmationOk.click();
groupSpace.searchEntitiesOk().click();
groupSpace.firstAvatarOfGroup().click();
sleep(2000);
@@ -112,7 +117,7 @@
chat.getSend(jids).click();
showMsg(t("And you can chat event while going back/forward with your browser"));
- spaces.homeBtn().click();
+ site.homeBtn().click();
sleep(2000);
chat.getTalkBox(jids).sendKeys(t("la la la"));
chat.getSend(jids).click();
@@ -135,5 +140,4 @@
showTitleSlide(t("Thank you"), t("and yes, feedback welcome"));
}
-
}
Modified: trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/test/java/cc/kune/selenium/spaces/GroupSpacePageObject.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -23,6 +23,8 @@
import org.openqa.selenium.support.FindBy;
import cc.kune.core.client.sitebar.search.EntitySearchPanel;
+import cc.kune.core.client.sn.actions.AddEntityToThisGroupAction;
+import cc.kune.core.client.sn.actions.AddNewBuddiesAction;
import cc.kune.core.client.sn.actions.registry.UserSNConfActions;
import cc.kune.selenium.PageObject;
import cc.kune.selenium.SeleniumConstants;
@@ -31,6 +33,10 @@
@FindBy(id = SeleniumConstants.GWTDEV + UserSNConfActions.ADD_BUDDIE_BTN)
private WebElement addBuddieBtn;
+ @FindBy(id = SeleniumConstants.GWTDEV + AddNewBuddiesAction.ADD_NEW_BUDDIES_TEXTBOX)
+ public WebElement addNewBuddieTextBox;
+ @FindBy(id = SeleniumConstants.GWTDEV + AddEntityToThisGroupAction.ADD_NEW_MEMBER_TEXTBOX)
+ public WebElement addNewMemberTextBox;
@FindBy(xpath = "//div[2]/div/div[3]/div/span")
private WebElement blogTool;
@FindBy(xpath = "//div[2]/div/div[4]/div/span")
@@ -41,12 +47,12 @@
private WebElement eventTool;
@FindBy(xpath = "//td/img")
private WebElement firstAvatarOfGroup;
+ @FindBy(xpath = "//td[2]/div/div/table/tbody/tr/td")
+ public WebElement firstFromSuggestionBox;
@FindBy(xpath = "//div[2]/div/div[5]/div/span")
private WebElement listTool;
@FindBy(id = SeleniumConstants.GWTDEV + EntitySearchPanel.OK_ID)
private WebElement searchEntitiesOk;
- @FindBy(id = SeleniumConstants.GWTDEV + EntitySearchPanel.ENTITY_SEARCH_TEXTBOX)
- private WebElement searchEntitiesTextBox;
@FindBy(xpath = "//div[3]/div/button")
private WebElement socialNetOptions;
@FindBy(xpath = "//div[2]/div/div[7]/div/span")
@@ -86,10 +92,6 @@
return searchEntitiesOk;
}
- public WebElement searchEntitiesTextBox() {
- return searchEntitiesTextBox;
- }
-
public WebElement socialNetOptions() {
return socialNetOptions;
}
Copied: trunk/src/test/java/cc/kune/selenium/spaces/SitePageObject.java (from rev 1611, trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java)
===================================================================
--- trunk/src/test/java/cc/kune/selenium/spaces/SitePageObject.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/spaces/SitePageObject.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -0,0 +1,75 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.selenium.spaces;
+
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.core.client.notify.confirm.UserConfirmPanel;
+import cc.kune.core.client.sitebar.search.SitebarSearchPanel;
+import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter.SpaceSelectorView;
+import cc.kune.selenium.PageObject;
+import cc.kune.selenium.SeleniumConstants;
+
+public class SitePageObject extends PageObject {
+
+ @FindBy(id = SeleniumConstants.GWTDEV + UserConfirmPanel.CANCEL_ID)
+ public WebElement confirmationCancel;
+ @FindBy(id = SeleniumConstants.GWTDEV + UserConfirmPanel.OK_ID)
+ public WebElement confirmationOk;
+ @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.GROUP_SPACE_ID)
+ protected WebElement groupSpaceBtn;
+ @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.HOME_SPACE_ID)
+ protected WebElement homeSpaceBtn;
+ @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.PUBLIC_SPACE_ID)
+ protected WebElement publicSpaceBtn;
+ @FindBy(id = SeleniumConstants.GWTDEV + SitebarSearchPanel.SITE_SEARCH_TEXTBOX)
+ public WebElement searchTextBox;
+ @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.USER_SPACE_ID)
+ protected WebElement userSpaceBtn;
+
+ public SitePageObject() {
+ }
+
+ public WebElement getConfirmationCancel() {
+ return confirmationCancel;
+ }
+
+ public WebElement getConfirmationOk() {
+ return confirmationOk;
+ }
+
+ public WebElement groupBtn() {
+ return groupSpaceBtn;
+ }
+
+ public WebElement homeBtn() {
+ return homeSpaceBtn;
+ }
+
+ public WebElement publicBtn() {
+ return publicSpaceBtn;
+ }
+
+ public WebElement userBtn() {
+ return userSpaceBtn;
+ }
+
+}
Deleted: trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java 2011-11-17 14:28:14 UTC (rev 1614)
+++ trunk/src/test/java/cc/kune/selenium/spaces/SpacesPageObject.java 2011-11-19 13:15:24 UTC (rev 1615)
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.selenium.spaces;
-
-import org.openqa.selenium.WebElement;
-import org.openqa.selenium.support.FindBy;
-
-import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter.SpaceSelectorView;
-import cc.kune.selenium.PageObject;
-import cc.kune.selenium.SeleniumConstants;
-
-public class SpacesPageObject extends PageObject {
-
- @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.GROUP_SPACE_ID)
- protected WebElement groupSpaceBtn;
- @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.HOME_SPACE_ID)
- protected WebElement homeSpaceBtn;
- @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.PUBLIC_SPACE_ID)
- protected WebElement publicSpaceBtn;
- @FindBy(id = SeleniumConstants.GWTDEV + SpaceSelectorView.USER_SPACE_ID)
- protected WebElement userSpaceBtn;
-
- public SpacesPageObject() {
- }
-
- public WebElement groupBtn() {
- return groupSpaceBtn;
- }
-
- public WebElement homeBtn() {
- return homeSpaceBtn;
- }
-
- public WebElement publicBtn() {
- return publicSpaceBtn;
- }
-
- public WebElement userBtn() {
- return userSpaceBtn;
- }
-
-}
More information about the kune-commits
mailing list