r1388 - in trunk: . src/main/java/cc/kune/chat/client src/main/java/cc/kune/core/client/auth src/main/java/cc/kune/core/client/resources src/main/java/cc/kune/core/server/content src/main/java/cc/kune/core/server/rack/filters src/main/java/cc/kune/wave/server src/main/resources src/main/resources/META-INF src/test/java/cc/kune/core/server src/test/java/cc/kune/core/server/integration src/test/java/cc/kune/core/server/integration/content
Author: vjrj_ Date: 2011-05-15 12:01:33 +0200 (Sun, 15 May 2011) New Revision: 1388 Added: trunk/logs/ Modified: trunk/.classpath trunk/pom.xml trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java trunk/src/main/java/cc/kune/core/client/auth/SignInForm.java trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java trunk/src/main/java/cc/kune/core/server/rack/filters/LogFilter.java trunk/src/main/java/cc/kune/wave/server/CustomSettingsBinder.java trunk/src/main/resources/META-INF/persistence.xml trunk/src/main/resources/log4j.dev.properties trunk/src/main/resources/log4j.properties trunk/src/test/java/cc/kune/core/server/TestHelper.java trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java Log: Some fixes, better logger conf and: NEW - # 53: Add Selenium Framework testing http://kune.ourproject.org/issues/ticket/53 Modified: trunk/.classpath =================================================================== --- trunk/.classpath 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/.classpath 2011-05-15 10:01:33 UTC (rev 1388) @@ -25,12 +25,14 @@ <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/> <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar" sourcepath="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/> <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1.jar" sourcepath="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar"/> <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.0-SNAPSHOT/communication-src-0.3.0-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.0-SNAPSHOT/concurrencycontrol-src-0.3.0-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/crawl_htmlunit/r5662-gae/crawl_htmlunit-r5662-gae.jar"/> + <classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar"/> <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0.jar" sourcepath="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar" sourcepath="M2_REPO/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA-sources.jar"/> @@ -65,6 +67,7 @@ <classpathentry kind="var" path="M2_REPO/com/extjs/gxt/2.2.1/gxt-2.2.1.jar"/> <classpathentry kind="var" path="M2_REPO/com/h2database/h2/1.0.20070617/h2-1.0.20070617.jar"/> <classpathentry kind="var" path="M2_REPO/com/calclab/emite/hablar/r1697/hablar-r1697.jar"/> + <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-all/1.1/hamcrest-all-1.1.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-all/1.1/hamcrest-all-1.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar" sourcepath="M2_REPO/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-c3p0/3.3.1.GA/hibernate-c3p0-3.3.1.GA.jar" sourcepath="M2_REPO/org/hibernate/hibernate-c3p0/3.3.1.GA/hibernate-c3p0-3.3.1.GA-sources.jar"/> @@ -74,12 +77,17 @@ <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-search/3.1.0.GA/hibernate-search-3.1.0.GA.jar" sourcepath="M2_REPO/org/hibernate/hibernate-search/3.1.0.GA/hibernate-search-3.1.0.GA-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-tools/3.2.3.GA/hibernate-tools-3.2.3.GA.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-validator/3.1.0.GA/hibernate-validator-3.1.0.GA.jar" sourcepath="M2_REPO/org/hibernate/hibernate-validator/3.1.0.GA/hibernate-validator-3.1.0.GA-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit/2.7/htmlunit-2.7.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit/2.7/htmlunit-2.7-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7-sources.jar"/> <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.4.GA/javassist-3.4.GA.jar"/> <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/com/beust/jcommander/1.5/jcommander-1.5.jar" sourcepath="M2_REPO/com/beust/jcommander/1.5/jcommander-1.5-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/codehaus/jettison/jettison/1.0-RC2/jettison-1.0-RC2.jar" sourcepath="M2_REPO/org/codehaus/jettison/jettison/1.0-RC2/jettison-1.0-RC2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/jmagick/jmagick/6.2.6-0/jmagick-6.2.6-0.jar"/> + <classpathentry kind="var" path="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar" sourcepath="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/jruby/jruby-complete/1.2.0/jruby-complete-1.2.0.jar"/> <classpathentry kind="var" path="M2_REPO/org/jruby/rack/jruby-rack/0.9.4/jruby-rack-0.9.4.jar"/> + <classpathentry kind="var" path="M2_REPO/org/json/json/20080701/json-20080701.jar" sourcepath="M2_REPO/org/json/json/20080701/json-20080701-sources.jar"/> <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/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/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar"/> @@ -101,19 +109,34 @@ <classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar" sourcepath="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.0-SNAPSHOT/model-src-0.3.0-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar"/> + <classpathentry kind="var" path="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0.jar" sourcepath="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8-sources.jar"/> <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.0-SNAPSHOT/proto-msg-0.3.0-SNAPSHOT.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/2.0a4/selenium-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium/2.0a4/selenium-2.0a4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.0a4/selenium-chrome-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.0a4/selenium-chrome-driver-2.0a4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-common/2.0a4/selenium-common-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-common/2.0a4/selenium-common-2.0a4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.0a4/selenium-firefox-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.0a4/selenium-firefox-driver-2.0a4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.0a4/selenium-htmlunit-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.0a4/selenium-htmlunit-driver-2.0a4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.0a4/selenium-ie-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.0a4/selenium-ie-driver-2.0a4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-remote-client/2.0a4/selenium-remote-client-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-remote-client/2.0a4/selenium-remote-client-2.0a4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-remote-common/2.0a4/selenium-remote-common-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-remote-common/2.0a4/selenium-remote-common-2.0a4-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-support/2.0a4/selenium-support-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-support/2.0a4/selenium-support-2.0a4-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"/> <classpathentry kind="var" path="M2_REPO/jivesoftware/smack/3.1.0/smack-3.1.0.jar"/> <classpathentry kind="var" path="M2_REPO/jivesoftware/smackx/3.1.0/smackx-3.1.0.jar"/> <classpathentry kind="var" path="M2_REPO/org/jivesoftware/smackx/debugger/smackx-debugger/3.0.4/smackx-debugger-3.0.4.jar"/> <classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.14/testng-5.14.jar" sourcepath="M2_REPO/org/testng/testng/5.14/testng-5.14-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.0-SNAPSHOT/util-src-0.3.0-SNAPSHOT.jar"/> <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5-sources.jar"/> <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.0-SNAPSHOT/waveinabox-server-0.3-0.3.0-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/> + <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/> <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/> <classpathentry kind="var" path="M2_REPO/xpp3/xpp3_min/1.1.3.4.O/xpp3_min-1.1.3.4.O.jar"/> <classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2.jar" sourcepath="M2_REPO/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2-sources.jar"/> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/pom.xml 2011-05-15 10:01:33 UTC (rev 1388) @@ -511,12 +511,31 @@ <!-- =roo --> <scope>test</scope> </dependency> + <dependency> + <groupId>org.seleniumhq.selenium</groupId> + <artifactId>selenium</artifactId> + <version>2.0a4</version> + <exclusions> + <exclusion> + <groupId>com.google.collections</groupId> + <artifactId>google-collections</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <version>5.14</version> + <scope>test</scope> + </dependency> + <!-- If you want to start a selenium server, you will need the following + dependency: --> <!-- <dependency> --> - <!-- <groupId>org.openqa.selenium.client-drivers</groupId> --> - <!-- <artifactId>selenium-java-client-driver</artifactId> --> - <!-- <version>1.0-beta-1</version> --> - <!-- <scope>test</scope> --> + <!-- <groupId>org.seleniumhq.selenium</groupId> --> + <!-- <artifactId>selenium-server</artifactId> --> + <!-- <version>2.0a4</version> --> <!-- </dependency> --> + <!-- public side --> <dependency> <groupId>org.jruby.rack</groupId> @@ -740,7 +759,7 @@ </systemProperty> <systemProperty> <key>DEBUG</key> - <value>true</value> + <value>false</value> </systemProperty> <systemProperty> <!-- <key>org.eclipse.jetty.util.log.DEBUG</key> --> Modified: trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java =================================================================== --- trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -33,29 +33,26 @@ * Handles the presentation of unattended chats */ public class KuneUnattendedPresenter { - private boolean active; + private boolean active; - public KuneUnattendedPresenter(final EventBus eventBus, final HablarEventBus hablarEventBus, - final SignalPreferences preferences, final UnattendedPagesManager unattendedManager, - final ChatClientAction action) { - active = false; - hablarEventBus.addHandler(UnattendedChatsChangedEvent.TYPE, new UnattendedChatsChangedHandler() { - @Override - public void handleUnattendedChatChange(final UnattendedChatsChangedEvent event) { - final int unattendedChatsCount = unattendedManager.getSize(); - if (unattendedChatsCount > 0 && active == false) { - active = true; - SndClickEvent.fire(eventBus); - action.setBlink(true); + public KuneUnattendedPresenter(final EventBus eventBus, final HablarEventBus hablarEventBus, + final SignalPreferences preferences, final UnattendedPagesManager unattendedManager, + final ChatClientAction action) { + active = false; + hablarEventBus.addHandler(UnattendedChatsChangedEvent.TYPE, new UnattendedChatsChangedHandler() { + @Override + public void handleUnattendedChatChange(final UnattendedChatsChangedEvent event) { + final int unattendedChatsCount = unattendedManager.getSize(); + if (unattendedChatsCount > 0 && active == false) { + active = true; + SndClickEvent.fire(eventBus); + action.setBlink(true); - } else if (unattendedChatsCount == 0 && active == true) { - action.setBlink(false); - active = false; - } - } - - }); - - } - + } else if (unattendedChatsCount == 0 && active == true) { + action.setBlink(false); + active = false; + } + } + }); + } } Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java =================================================================== --- trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -30,99 +30,99 @@ public class RegisterForm extends DefaultForm { - public static final String COUNTRY_FIELD = "k-urf-country-f"; - public static final String EMAIL_FIELD = "k-urf-email-f"; - public static final String LANG_FIELD = "k-urf-lang-f"; - public static final String LONGNAME_FIELD = "k-urf-long_name-f"; - public static final String NICK_FIELD = "k-urf-nick-f"; - public static final String NOPERSONALHOMEPAGE_ID = "k-urf-nphp-id"; - public static final String PASSWORD_FIELD = "k-urf-password-f"; - public static final String PASSWORD_FIELD_DUP = "k-urf-passwordDup-f"; - public static final String TIMEZONE_FIELD = "k-urf-timezone-f"; - public static final String WANNAPERSONALHOMEPAGE_ID = "k-urf-wphp-id"; - public static final String WANTHOMEPAGE_FIELD = "k-urf-wphp-f"; + public static final String COUNTRY_FIELD = "k-urf-country-f"; + public static final String EMAIL_FIELD = "k-urf-email-f"; + public static final String LANG_FIELD = "k-urf-lang-f"; + public static final String LONGNAME_FIELD = "k-urf-long_name-f"; + public static final String NICK_FIELD = "k-urf-nick-f"; + public static final String NOPERSONALHOMEPAGE_ID = "k-urf-nphp-id"; + public static final String PASSWORD_FIELD = "k-urf-password-f"; + public static final String PASSWORD_FIELD_DUP = "k-urf-passwordDup-f"; + public static final String TIMEZONE_FIELD = "k-urf-timezone-f"; + public static final String WANNAPERSONALHOMEPAGE_ID = "k-urf-wphp-id"; + public static final String WANTHOMEPAGE_FIELD = "k-urf-wphp-f"; - private final TextField<String> emailRegField; - private final TextField<String> longNameRegField; - private final TextField<String> passwdRegField; - private final TextField<String> shortNameRegField; + private final TextField<String> emailRegField; + private final TextField<String> longNameRegField; + private final TextField<String> passwdRegField; + private final TextField<String> shortNameRegField; - public RegisterForm(final I18nTranslationService i18n, final Session session) { - super.addStyleName("kune-Margin-Large-l"); + public RegisterForm(final I18nTranslationService i18n, final Session session) { + super.addStyleName("kune-Margin-Large-l"); - shortNameRegField = new TextField<String>(); - shortNameRegField.setTabIndex(1); - shortNameRegField.setFieldLabel(i18n.t("Nickname")); - shortNameRegField.setName(NICK_FIELD); - shortNameRegField.setWidth(DEF_SMALL_FIELD_WIDTH); - shortNameRegField.setAllowBlank(false); - shortNameRegField.setMinLength(3); - shortNameRegField.setMaxLength(15); - shortNameRegField.setRegex("^[a-z0-9]+$"); - shortNameRegField.getMessages().setMinLengthText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15)); - shortNameRegField.getMessages().setMaxLengthText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15)); - shortNameRegField.getMessages().setRegexText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15)); - shortNameRegField.setValidationDelay(1000); - add(shortNameRegField); + shortNameRegField = new TextField<String>(); + shortNameRegField.setTabIndex(1); + shortNameRegField.setFieldLabel(i18n.t("Username")); + shortNameRegField.setName(NICK_FIELD); + shortNameRegField.setWidth(DEF_SMALL_FIELD_WIDTH); + shortNameRegField.setAllowBlank(false); + shortNameRegField.setMinLength(3); + shortNameRegField.setMaxLength(15); + shortNameRegField.setRegex("^[a-z0-9]+$"); + shortNameRegField.getMessages().setMinLengthText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15)); + shortNameRegField.getMessages().setMaxLengthText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15)); + shortNameRegField.getMessages().setRegexText(i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15)); + shortNameRegField.setValidationDelay(1000); + add(shortNameRegField); - longNameRegField = new TextField<String>(); - longNameRegField.setTabIndex(2); - longNameRegField.setFieldLabel(i18n.t("Full Name")); - longNameRegField.setName(LONGNAME_FIELD); - longNameRegField.setWidth(DEF_FIELD_WIDTH); - longNameRegField.setAllowBlank(false); - longNameRegField.setMinLength(3); - longNameRegField.setMaxLength(50); - // longNameRegField.setValidationEvent(false); - longNameRegField.setId(LONGNAME_FIELD); - add(longNameRegField); + longNameRegField = new TextField<String>(); + longNameRegField.setTabIndex(2); + longNameRegField.setFieldLabel(i18n.t("Name")); + longNameRegField.setName(LONGNAME_FIELD); + longNameRegField.setWidth(DEF_FIELD_WIDTH); + longNameRegField.setAllowBlank(false); + longNameRegField.setMinLength(3); + longNameRegField.setMaxLength(50); + // longNameRegField.setValidationEvent(false); + longNameRegField.setId(LONGNAME_FIELD); + add(longNameRegField); - passwdRegField = new TextField<String>(); - passwdRegField.setTabIndex(3); - passwdRegField.setFieldLabel(i18n.t("Password")); - passwdRegField.setName(PASSWORD_FIELD); - passwdRegField.setPassword(true); - passwdRegField.setAllowBlank(false); - passwdRegField.setMinLength(6); - passwdRegField.setMaxLength(40); - passwdRegField.getMessages().setMinLengthText(i18n.t(CoreMessages.PASSWD_MUST_BE_BETWEEN_6_AND_40)); - passwdRegField.getMessages().setMaxLengthText(i18n.t(CoreMessages.PASSWD_MUST_BE_BETWEEN_6_AND_40)); - passwdRegField.setWidth(DEF_MEDIUM_FIELD_WIDTH); - passwdRegField.setValidationDelay(1000); - passwdRegField.setId(PASSWORD_FIELD); - add(passwdRegField); + passwdRegField = new TextField<String>(); + passwdRegField.setTabIndex(3); + passwdRegField.setFieldLabel(i18n.t("Password")); + passwdRegField.setName(PASSWORD_FIELD); + passwdRegField.setPassword(true); + passwdRegField.setAllowBlank(false); + passwdRegField.setMinLength(6); + passwdRegField.setMaxLength(40); + passwdRegField.getMessages().setMinLengthText(i18n.t(CoreMessages.PASSWD_MUST_BE_BETWEEN_6_AND_40)); + passwdRegField.getMessages().setMaxLengthText(i18n.t(CoreMessages.PASSWD_MUST_BE_BETWEEN_6_AND_40)); + passwdRegField.setWidth(DEF_MEDIUM_FIELD_WIDTH); + passwdRegField.setValidationDelay(1000); + passwdRegField.setId(PASSWORD_FIELD); + add(passwdRegField); - // http://www.sencha.com/forum/showthread.php?49702-GXT-Form-Validation - emailRegField = new TextField<String>(); - emailRegField.setTabIndex(5); - emailRegField.setFieldLabel(i18n.t("Email")); - emailRegField.setName(EMAIL_FIELD); - emailRegField.setRegex(TextUtils.EMAIL_REGEXP); - emailRegField.getMessages().setRegexText(i18n.t("This is not a valid email")); - emailRegField.setWidth(DEF_MEDIUM_FIELD_WIDTH); - emailRegField.setAllowBlank(false); - emailRegField.setValidationDelay(1000); - emailRegField.setId(EMAIL_FIELD); - add(emailRegField); - } + // http://www.sencha.com/forum/showthread.php?49702-GXT-Form-Validation + emailRegField = new TextField<String>(); + emailRegField.setTabIndex(5); + emailRegField.setFieldLabel(i18n.t("Email")); + emailRegField.setName(EMAIL_FIELD); + emailRegField.setRegex(TextUtils.EMAIL_REGEXP); + emailRegField.getMessages().setRegexText(i18n.t("This is not a valid email")); + emailRegField.setWidth(DEF_MEDIUM_FIELD_WIDTH); + emailRegField.setAllowBlank(false); + emailRegField.setValidationDelay(1000); + emailRegField.setId(EMAIL_FIELD); + add(emailRegField); + } - public String getEmail() { - return emailRegField.getValue(); - } + public String getEmail() { + return emailRegField.getValue(); + } - public String getLongName() { - return longNameRegField.getValue(); - } + public String getLongName() { + return longNameRegField.getValue(); + } - public String getRegisterPassword() { - return passwdRegField.getValue(); - } + public String getRegisterPassword() { + return passwdRegField.getValue(); + } - public String getShortName() { - return shortNameRegField.getValue(); - } + public String getShortName() { + return shortNameRegField.getValue(); + } - public Field<String> getShortNameField() { - return shortNameRegField; - } + public Field<String> getShortNameField() { + return shortNameRegField; + } } Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInForm.java =================================================================== --- trunk/src/main/java/cc/kune/core/client/auth/SignInForm.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/java/cc/kune/core/client/auth/SignInForm.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -30,75 +30,75 @@ import com.extjs.gxt.ui.client.widget.form.TextField; public class SignInForm extends DefaultForm { - public static final String NICKOREMAIL_FIELD = "kune-sif-nkf"; - public static final String PASSWORD_FIELD = "kune-sif-psf"; + public static final String NICKOREMAIL_FIELD = "kune-sif-nkf"; + public static final String PASSWORD_FIELD = "kune-sif-psf"; - private final TextField<String> loginNickOrEmailField; - private final TextField<String> loginPassField; - private OnAcceptCallback onAcceptCallback; + private final TextField<String> loginNickOrEmailField; + private final TextField<String> loginPassField; + private OnAcceptCallback onAcceptCallback; - public SignInForm(final I18nTranslationService i18n) { - super.addStyleName("kune-Margin-Large-trbl"); + public SignInForm(final I18nTranslationService i18n) { + super.addStyleName("kune-Margin-Large-trbl"); - loginNickOrEmailField = new TextField<String>(); - loginNickOrEmailField.setFieldLabel(i18n.t("Nickname")); - loginNickOrEmailField.setName(NICKOREMAIL_FIELD); - loginNickOrEmailField.setWidth(DEF_SMALL_FIELD_WIDTH); - loginNickOrEmailField.setAllowBlank(false); - loginNickOrEmailField.setValidationDelay(1000); - loginNickOrEmailField.setId(NICKOREMAIL_FIELD); - loginNickOrEmailField.setTabIndex(100); - super.add(loginNickOrEmailField); + loginNickOrEmailField = new TextField<String>(); + loginNickOrEmailField.setFieldLabel(i18n.t("Username")); + loginNickOrEmailField.setName(NICKOREMAIL_FIELD); + loginNickOrEmailField.setWidth(DEF_SMALL_FIELD_WIDTH); + loginNickOrEmailField.setAllowBlank(false); + loginNickOrEmailField.setValidationDelay(1000); + loginNickOrEmailField.setId(NICKOREMAIL_FIELD); + loginNickOrEmailField.setTabIndex(100); + super.add(loginNickOrEmailField); - loginPassField = new TextField<String>(); - loginPassField.setFieldLabel(i18n.t("Password")); - loginPassField.setName(PASSWORD_FIELD); - loginPassField.setWidth(DEF_MEDIUM_FIELD_WIDTH); - loginPassField.setPassword(true); - loginPassField.setAllowBlank(false); - loginPassField.setValidationDelay(1000); - loginPassField.setId(PASSWORD_FIELD); - loginPassField.setTabIndex(101); - loginPassField.addListener(Events.OnKeyPress, new Listener<FieldEvent>() { - @Override - public void handleEvent(final FieldEvent fe) { - if (fe.getEvent().getKeyCode() == 13) { - onAcceptCallback.onSuccess(); - } - } - }); - super.add(loginPassField); - } + loginPassField = new TextField<String>(); + loginPassField.setFieldLabel(i18n.t("Password")); + loginPassField.setName(PASSWORD_FIELD); + loginPassField.setWidth(DEF_MEDIUM_FIELD_WIDTH); + loginPassField.setPassword(true); + loginPassField.setAllowBlank(false); + loginPassField.setValidationDelay(1000); + loginPassField.setId(PASSWORD_FIELD); + loginPassField.setTabIndex(101); + loginPassField.addListener(Events.OnKeyPress, new Listener<FieldEvent>() { + @Override + public void handleEvent(final FieldEvent fe) { + if (fe.getEvent().getKeyCode() == 13) { + onAcceptCallback.onSuccess(); + } + } + }); + super.add(loginPassField); + } - public void focusLogin() { - loginNickOrEmailField.focus(); - } + public void focusLogin() { + loginNickOrEmailField.focus(); + } - public void focusOnPassword() { - loginPassField.focus(); - } + public void focusOnPassword() { + loginPassField.focus(); + } - public String getLoginPassword() { - return loginPassField.getValue(); - } + public String getLoginPassword() { + return loginPassField.getValue(); + } - public String getNickOrEmail() { - return loginNickOrEmailField.getValue(); - } + public String getNickOrEmail() { + return loginNickOrEmailField.getValue(); + } - public Field<String> getNickOrEmailField() { - return loginNickOrEmailField; - } + public Field<String> getNickOrEmailField() { + return loginNickOrEmailField; + } - public void setLoginPassword(final String password) { - loginPassField.setValue(password); - } + public void setLoginPassword(final String password) { + loginPassField.setValue(password); + } - public void setNickOrEmail(final String nickOrEmail) { - loginNickOrEmailField.setValue(nickOrEmail); - } + public void setNickOrEmail(final String nickOrEmail) { + loginNickOrEmailField.setValue(nickOrEmail); + } - public void setOnPasswordReturn(final OnAcceptCallback onAcceptCallback) { - this.onAcceptCallback = onAcceptCallback; - } + public void setOnPasswordReturn(final OnAcceptCallback onAcceptCallback) { + this.onAcceptCallback = onAcceptCallback; + } } Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java =================================================================== --- trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -27,7 +27,7 @@ public final static String ENT_LOGO_SELECTOR_PERSON_TITLE = "Avatar"; public final static String FIELD_MUST_BE_BETWEEN_3_AND_15 = "The name must be between 3 and 15 lowercase characters. It can only contain Western characters and numbers"; public final static String GROUP_OPTIONS_DIALOG_TITLE = "Group options"; - public final static String INCORRECT_NICKNAME_EMAIL_OR_PASSWORD = "The nickname/email/password is incorrect"; + public final static String INCORRECT_NICKNAME_EMAIL_OR_PASSWORD = "The username/password is incorrect"; public final static String MEMBERS_NOT_PUBLIC = "The members of this group are not public"; public final static String NAME_IN_ALREADY_IN_USE = "This name is already in use. Please try with a different name"; public final static String NAME_IN_USE = "This name in already in use. Please try with a different name"; Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java =================================================================== --- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -304,7 +304,7 @@ @Override public void setModifiedOn(final Content content, final long lastModifiedTime) { content.setModifiedOn(lastModifiedTime); - persist(content); + // persist(content);// } @Override Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/LogFilter.java =================================================================== --- trunk/src/main/java/cc/kune/core/server/rack/filters/LogFilter.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/java/cc/kune/core/server/rack/filters/LogFilter.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -34,21 +34,31 @@ import cc.kune.core.server.rack.RackHelper; public class LogFilter implements Filter { - public static final Log LOG = LogFactory.getLog(LogFilter.class); + public static final Log LOG = LogFactory.getLog(LogFilter.class); + private final boolean logduration = false; - public void destroy() { - } + @Override + public void destroy() { + } - public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) - throws IOException, ServletException { - // final long start = System.currentTimeMillis(); - LOG.debug("REQUEST: " + RackHelper.getURI(request)); - chain.doFilter(request, response); - // final long finish = System.currentTimeMillis(); - // log.debug("TOTAL TIME: " + (finish - start) + " miliseconds"); + @Override + public void doFilter(final ServletRequest request, final ServletResponse response, + final FilterChain chain) throws IOException, ServletException { + long start; + if (logduration) { + start = System.currentTimeMillis(); } - - public void init(final FilterConfig filterConfig) throws ServletException { + final String uri = RackHelper.getURI(request); + LOG.debug("REQUEST: " + uri); + chain.doFilter(request, response); + if (logduration) { + final long finish = System.currentTimeMillis(); + LOG.debug("Total time '" + uri + "': " + (finish - start) + " miliseconds"); } + } + @Override + public void init(final FilterConfig filterConfig) throws ServletException { + } + } Modified: trunk/src/main/java/cc/kune/wave/server/CustomSettingsBinder.java =================================================================== --- trunk/src/main/java/cc/kune/wave/server/CustomSettingsBinder.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/java/cc/kune/wave/server/CustomSettingsBinder.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -51,145 +51,152 @@ */ public class CustomSettingsBinder { - /** - * Used to validate that a type is supported. Some types may have generic - * parameters that need to be checked. - */ - private interface SettingTypeValidator { - boolean check(Type type); + /** + * Used to validate that a type is supported. Some types may have generic + * parameters that need to be checked. + */ + private interface SettingTypeValidator { + boolean check(Type type); + } + + /** + * This default validator just returns true. + */ + private static final SettingTypeValidator DEFAULT_TYPE_VALIDATOR = new SettingTypeValidator() { + @Override + public boolean check(final Type type) { + return true; } + }; - private static final Map<Type, SettingTypeValidator> supportedSettingTypes; // NOPMD by vjrj on 18/01/11 0:53 - - /** - * This default validator just returns true. - */ - private static final SettingTypeValidator DEFAULT_TYPE_VALIDATOR = new SettingTypeValidator() { - @Override - public boolean check(Type type) { + /** + * This validator checks to make sure the {@link List}'s generic parameter is + * also supported. + */ + private static final SettingTypeValidator LIST_TYPE_VALIDATOR = new SettingTypeValidator() { + @Override + public boolean check(final Type type) { + if (type instanceof ParameterizedType) { + final Type[] args = ((ParameterizedType) type).getActualTypeArguments(); + if (args.length == 1) { + // At the moment only List<String> is supported. + if (args[0] == String.class) { return true; + } } - }; + } + return false; + } + }; - /** - * This validator checks to make sure the {@link List}'s generic parameter - * is also supported. - */ - private static final SettingTypeValidator LIST_TYPE_VALIDATOR = new SettingTypeValidator() { - @Override - public boolean check(Type type) { - if (type instanceof ParameterizedType) { - Type[] args = ((ParameterizedType) type).getActualTypeArguments(); - if (args.length == 1) { - // At the moment only List<String> is supported. - if (args[0] == String.class) { - return true; - } - } - } - return false; - } - }; + private static final Map<Type, SettingTypeValidator> supportedSettingTypes; // NOPMD + // by + // vjrj + // on + // 18/01/11 + // 0:53 - static { - ImmutableMap.Builder<Type, SettingTypeValidator> builder = ImmutableMap.builder(); - builder.put(int.class, DEFAULT_TYPE_VALIDATOR); - builder.put(boolean.class, DEFAULT_TYPE_VALIDATOR); - builder.put(String.class, DEFAULT_TYPE_VALIDATOR); - builder.put(List.class, LIST_TYPE_VALIDATOR); - supportedSettingTypes = builder.build(); - } + static { + final ImmutableMap.Builder<Type, SettingTypeValidator> builder = ImmutableMap.builder(); + builder.put(int.class, DEFAULT_TYPE_VALIDATOR); + builder.put(boolean.class, DEFAULT_TYPE_VALIDATOR); + builder.put(String.class, DEFAULT_TYPE_VALIDATOR); + builder.put(List.class, LIST_TYPE_VALIDATOR); + supportedSettingTypes = builder.build(); + } - /** - * Bind configuration parameters into Guice Module. - * - * @return a Guice module configured with setting support. - * @throws ConfigurationException - * on configuration error - */ - public static Module bindSettings(String propertyFile, Class<?>... settingsArg) throws ConfigurationException { - final CompositeConfiguration config = new CompositeConfiguration(); - config.addConfiguration(new SystemConfiguration()); - config.addConfiguration(new PropertiesConfiguration(propertyFile)); + /** + * Bind configuration parameters into Guice Module. + * + * @return a Guice module configured with setting support. + * @throws ConfigurationException + * on configuration error + */ + public static Module bindSettings(final String propertyFile, final Class<?>... settingsArg) + throws ConfigurationException { + final CompositeConfiguration config = new CompositeConfiguration(); + config.addConfiguration(new SystemConfiguration()); + config.addConfiguration(new PropertiesConfiguration(propertyFile)); - List<Field> fields = new ArrayList<Field>(); - for (Class<?> settings : settingsArg) { - fields.addAll(Arrays.asList(settings.getDeclaredFields())); - } + final List<Field> fields = new ArrayList<Field>(); + for (final Class<?> settings : settingsArg) { + fields.addAll(Arrays.asList(settings.getDeclaredFields())); + } - // Reflect on settings class and absorb settings - final Map<Setting, Field> settings = new LinkedHashMap<Setting, Field>(); - for (Field field : fields) { - if (!field.isAnnotationPresent(Setting.class)) { - continue; - } + // Reflect on settings class and absorb settings + final Map<Setting, Field> settings = new LinkedHashMap<Setting, Field>(); + for (final Field field : fields) { + if (!field.isAnnotationPresent(Setting.class)) { + continue; + } - // Validate target type - SettingTypeValidator typeHelper = supportedSettingTypes.get(field.getType()); - if (typeHelper == null || !typeHelper.check(field.getGenericType())) { - throw new IllegalArgumentException(field.getType() + " is not one of the supported setting types"); - } + // Validate target type + final SettingTypeValidator typeHelper = supportedSettingTypes.get(field.getType()); + if (typeHelper == null || !typeHelper.check(field.getGenericType())) { + throw new IllegalArgumentException(field.getType() + + " is not one of the supported setting types"); + } - Setting setting = field.getAnnotation(Setting.class); - settings.put(setting, field); - } + final Setting setting = field.getAnnotation(Setting.class); + settings.put(setting, field); + } - // Now validate them - List<String> missingProperties = new ArrayList<String>(); - for (Setting setting : settings.keySet()) { - if (setting.defaultValue().isEmpty()) { - if (!config.containsKey(setting.name())) { - missingProperties.add(setting.name()); - } - } + // Now validate them + final List<String> missingProperties = new ArrayList<String>(); + for (final Setting setting : settings.keySet()) { + if (setting.defaultValue().isEmpty()) { + if (!config.containsKey(setting.name())) { + missingProperties.add(setting.name()); } - if (missingProperties.size() > 0) { - StringBuilder error = new StringBuilder(); - error.append("The following required properties are missing from the server configuration: "); - error.append(Joiner.on(", ").join(missingProperties)); - throw new ConfigurationException(error.toString()); - } + } + } + if (missingProperties.size() > 0) { + final StringBuilder error = new StringBuilder(); + error.append("The following required properties are missing from the server configuration: "); + error.append(Joiner.on(", ").join(missingProperties)); + throw new ConfigurationException(error.toString()); + } - // bundle everything up in an injectable guice module - return new AbstractModule() { + // bundle everything up in an injectable guice module + return new AbstractModule() { - @Override - protected void configure() { - // We must iterate the settings a third time when binding. - // Note: do not collapse these loops as that will damage - // early error detection. The runtime is still O(n) in setting - // count. - for (Map.Entry<Setting, Field> entry : settings.entrySet()) { - Class<?> type = entry.getValue().getType(); - Setting setting = entry.getKey(); + @Override + protected void configure() { + // We must iterate the settings a third time when binding. + // Note: do not collapse these loops as that will damage + // early error detection. The runtime is still O(n) in setting + // count. + for (final Map.Entry<Setting, Field> entry : settings.entrySet()) { + final Class<?> type = entry.getValue().getType(); + final Setting setting = entry.getKey(); - if (int.class.equals(type)) { - Integer defaultValue = null; - if (!setting.defaultValue().isEmpty()) { - defaultValue = Integer.parseInt(setting.defaultValue()); - } - bindConstant().annotatedWith(Names.named(setting.name())).to( - config.getInteger(setting.name(), defaultValue)); - } else if (boolean.class.equals(type)) { - Boolean defaultValue = null; - if (!setting.defaultValue().isEmpty()) { - defaultValue = Boolean.parseBoolean(setting.defaultValue()); - } - bindConstant().annotatedWith(Names.named(setting.name())).to( - config.getBoolean(setting.name(), defaultValue)); - } else if (String.class.equals(type)) { - bindConstant().annotatedWith(Names.named(setting.name())).to( - config.getString(setting.name(), setting.defaultValue())); - } else { - String[] value = config.getStringArray(setting.name()); - if (value.length == 0 && !setting.defaultValue().isEmpty()) { - value = setting.defaultValue().split(","); - } - bind(new TypeLiteral<List<String>>() { - }).annotatedWith(Names.named(setting.name())).toInstance(ImmutableList.copyOf(value)); - } - } + if (int.class.equals(type)) { + Integer defaultValue = null; + if (!setting.defaultValue().isEmpty()) { + defaultValue = Integer.parseInt(setting.defaultValue()); } - }; - } + bindConstant().annotatedWith(Names.named(setting.name())).to( + config.getInteger(setting.name(), defaultValue)); + } else if (boolean.class.equals(type)) { + Boolean defaultValue = null; + if (!setting.defaultValue().isEmpty()) { + defaultValue = Boolean.parseBoolean(setting.defaultValue()); + } + bindConstant().annotatedWith(Names.named(setting.name())).to( + config.getBoolean(setting.name(), defaultValue)); + } else if (String.class.equals(type)) { + bindConstant().annotatedWith(Names.named(setting.name())).to( + config.getString(setting.name(), setting.defaultValue())); + } else { + String[] value = config.getStringArray(setting.name()); + if (value.length == 0 && !setting.defaultValue().isEmpty()) { + value = setting.defaultValue().split(","); + } + bind(new TypeLiteral<List<String>>() { + }).annotatedWith(Names.named(setting.name())).toInstance(ImmutableList.copyOf(value)); + } + } + } + }; + } } Modified: trunk/src/main/resources/META-INF/persistence.xml =================================================================== --- trunk/src/main/resources/META-INF/persistence.xml 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/resources/META-INF/persistence.xml 2011-05-15 10:01:33 UTC (rev 1388) @@ -43,7 +43,7 @@ <property name="hibernate.connection.password" value="db4kune" /> <!-- http://stackoverflow.com/questions/221379/hibernate-hbm2ddl-auto-update-in-p... - (NO!, une liquibase, for instance) --> + (NO!, use liquibase, for instance) --> <!-- http://stackoverflow.com/questions/438146/hibernate-question-hbm2ddl-auto-po... --> <property name="hibernate.hbm2ddl.auto" value="update" /> <!-- https://www.hibernate.org/214.html --> Modified: trunk/src/main/resources/log4j.dev.properties =================================================================== --- trunk/src/main/resources/log4j.dev.properties 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/resources/log4j.dev.properties 2011-05-15 10:01:33 UTC (rev 1388) @@ -1,10 +1,64 @@ -log4j.rootLogger=ERROR, stdout -log4j.logger.org.ourproject=DEBUG -log4j.logger.cc.kune=DEBUG; -log4j.logger.org.waveprotocol=INFO; -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -#log4j.appender.stdout.layout=org.apache.log4j.TTCCLayout -#log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -#log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n -log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p - %m%n \ No newline at end of file +#------------------------------------------------------------------------------ +# +# The following properties set the logging levels and log appender. The +# log4j.rootCategory variable defines the default log level and one or more +# appenders. For the console, use 'S'. For the daily rolling file, use 'R'. +# For an HTML formatted log, use 'H'. + +# This file configures log4j to log any messages of level info or higher to +# the console except for classes under the cc.kune, org.waveprotocol, etc +# +# To override the default (rootCategory) log level, define a property of the +# form (see below for available values): +# +# log4j.logger. = +# +# Available logger names: +# TODO +# +# Possible Log Levels: +# FATAL, ERROR, WARN, INFO, DEBUG +# +#------------------------------------------------------------------------------ +log4j.rootCategory=ERROR, R + +log4j.logger.org.ourproject=ERROR; +log4j.logger.cc.kune=ERROR; +log4j.logger.org.waveprotocol=ERROR; +log4j.logger.org.google=ERROR + +#------------------------------------------------------------------------------ +# +# The following properties configure the console (stdout) appender. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.S = org.apache.log4j.ConsoleAppender +log4j.appender.S.layout = org.apache.log4j.PatternLayout +log4j.appender.S.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n +# Previous: +# log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p - %m%n +#------------------------------------------------------------------------------ +# +# The following properties configure the Daily Rolling File appender. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.R = org.apache.log4j.DailyRollingFileAppender +log4j.appender.R.File = logs/kune.log +log4j.appender.R.Append = true +log4j.appender.R.DatePattern = '.'yyy-MM-dd +log4j.appender.R.layout = org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n + +#------------------------------------------------------------------------------ +# +# The following properties configure the Rolling File appender in HTML. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.H = org.apache.log4j.RollingFileAppender +log4j.appender.H.File = logs/kune.html +log4j.appender.H.MaxFileSize = 100KB +log4j.appender.H.Append = false +log4j.appender.H.layout = org.apache.log4j.HTMLLayout \ No newline at end of file Modified: trunk/src/main/resources/log4j.properties =================================================================== --- trunk/src/main/resources/log4j.properties 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/main/resources/log4j.properties 2011-05-15 10:01:33 UTC (rev 1388) @@ -1,19 +1,65 @@ -log4j.rootLogger=error, stdout -log4j.logger.org.ourproject=DEBUG; -log4j.logger.cc.kune=DEBUG; -log4j.logger.org.waveprotocol=INFO; -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +#------------------------------------------------------------------------------ +# +# The following properties set the logging levels and log appender. The +# log4j.rootCategory variable defines the default log level and one or more +# appenders. For the console, use 'S'. For the daily rolling file, use 'R'. +# For an HTML formatted log, use 'H'. -# Print the date in ISO 8601 format -log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n +# This file configures log4j to log any messages of level info or higher to +# the console except for classes under the cc.kune, org.waveprotocol, etc +# +# To override the default (rootCategory) log level, define a property of the +# form (see below for available values): +# +# log4j.logger. = +# +# Available logger names: +# TODO +# +# Possible Log Levels: +# FATAL, ERROR, WARN, INFO, DEBUG +# +#------------------------------------------------------------------------------ +log4j.rootCategory=ERROR, S -log4j.appender.R=org.apache.log4j.RollingFileAppender -log4j.appender.R.File=application.log +log4j.logger.org.ourproject=ERROR; +log4j.logger.cc.kune=ERROR; +log4j.logger.org.waveprotocol=ERROR; +log4j.logger.org.google=ERROR -log4j.appender.R.MaxFileSize=100KB -# Keep one backup file -log4j.appender.R.MaxBackupIndex=1 +#------------------------------------------------------------------------------ +# +# The following properties configure the console (stdout) appender. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.S = org.apache.log4j.ConsoleAppender +log4j.appender.S.layout = org.apache.log4j.PatternLayout +log4j.appender.S.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n +# Previous: +# log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n -log4j.appender.R.layout=org.apache.log4j.PatternLayout -log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n +#------------------------------------------------------------------------------ +# +# The following properties configure the Daily Rolling File appender. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.R = org.apache.log4j.DailyRollingFileAppender +log4j.appender.R.File = logs/kune.log +log4j.appender.R.Append = true +log4j.appender.R.DatePattern = '.'yyy-MM-dd +log4j.appender.R.layout = org.apache.log4j.PatternLayout +log4j.appender.R.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n + +#------------------------------------------------------------------------------ +# +# The following properties configure the Rolling File appender in HTML. +# See http://logging.apache.org/log4j/docs/api/index.html for details. +# +#------------------------------------------------------------------------------ +log4j.appender.H = org.apache.log4j.RollingFileAppender +log4j.appender.H.File = logs/kune.html +log4j.appender.H.MaxFileSize = 100KB +log4j.appender.H.Append = false +log4j.appender.H.layout = org.apache.log4j.HTMLLayout \ No newline at end of file Modified: trunk/src/test/java/cc/kune/core/server/TestHelper.java =================================================================== --- trunk/src/test/java/cc/kune/core/server/TestHelper.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/test/java/cc/kune/core/server/TestHelper.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -50,48 +50,49 @@ import com.google.inject.servlet.SessionScoped; public abstract class TestHelper { - public static Injector create(final Module module, final String persistenceUnit, final String propetiesFileName) { - try { - final Injector injector = Guice.createInjector(CustomSettingsBinder.bindSettings( - TestConstants.WAVE_TEST_PROPFILE, CoreSettings.class)); - final PersistenceModule wavePersistModule = injector.getInstance(PersistenceModule.class); - final NoOpFederationModule federationModule = injector.getInstance(NoOpFederationModule.class); - final Injector childInjector = injector.createChildInjector(wavePersistModule, new ServerModule(false), - new RobotApiModule(), federationModule, FinderRegistry.init(new JpaPersistModule(persistenceUnit)), - module, new Module() { - @Override - public void configure(final Binder binder) { - binder.bindScope(SessionScoped.class, Scopes.SINGLETON); - binder.bindScope(RequestScoped.class, Scopes.SINGLETON); - binder.bindConstant().annotatedWith(PropertiesFileName.class).to(propetiesFileName); - binder.bind(HttpServletRequest.class).to(HttpServletRequestMocked.class); - } - }); - try { - childInjector.getInstance(WaveServerImpl.class).initialize(); - } catch (final WaveServerException e) { - e.printStackTrace(); - } - final AccountStore accountStore = childInjector.getInstance(AccountStore.class); - accountStore.initializeAccountStore(); - AccountStoreHolder.resetForTesting(); - AccountStoreHolder.init(accountStore, - childInjector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)))); - return childInjector; - } catch (final ConfigurationException e) { - e.printStackTrace(); - } catch (final PersistenceException e) { - e.printStackTrace(); + public static Injector create(final Module module, final String persistenceUnit, + final String propetiesFileName) { + try { + final Injector injector = Guice.createInjector(CustomSettingsBinder.bindSettings( + TestConstants.WAVE_TEST_PROPFILE, CoreSettings.class)); + final PersistenceModule wavePersistModule = injector.getInstance(PersistenceModule.class); + final NoOpFederationModule federationModule = injector.getInstance(NoOpFederationModule.class); + final Injector childInjector = injector.createChildInjector(wavePersistModule, new ServerModule( + false), new RobotApiModule(), federationModule, FinderRegistry.init(new JpaPersistModule( + persistenceUnit)), module, new Module() { + @Override + public void configure(final Binder binder) { + binder.bindScope(SessionScoped.class, Scopes.SINGLETON); + binder.bindScope(RequestScoped.class, Scopes.SINGLETON); + binder.bindConstant().annotatedWith(PropertiesFileName.class).to(propetiesFileName); + binder.bind(HttpServletRequest.class).to(HttpServletRequestMocked.class); } - return null; + }); + try { + childInjector.getInstance(WaveServerImpl.class).initialize(); + } catch (final WaveServerException e) { + e.printStackTrace(); + } + final AccountStore accountStore = childInjector.getInstance(AccountStore.class); + accountStore.initializeAccountStore(); + AccountStoreHolder.resetForTesting(); + AccountStoreHolder.init(accountStore, + childInjector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)))); + return childInjector; + } catch (final ConfigurationException e) { + e.printStackTrace(); + } catch (final PersistenceException e) { + e.printStackTrace(); } + return null; + } - public static void inject(final Object target) { - // test: use memory - // test_db: use mysql - // Also configurable ein PersistenceTest - TestHelper.create(new PlatformServerModule(), TestConstants.PERSISTENCE_UNIT, "kune.properties").injectMembers( - target); - } + public static void inject(final Object target) { + // test: use memory + // test_db: use mysql + // Also configurable ein PersistenceTest + TestHelper.create(new PlatformServerModule(), TestConstants.PERSISTENCE_UNIT, "kune.properties").injectMembers( + target); + } } Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java =================================================================== --- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -50,42 +50,43 @@ public class IntegrationTestHelper { - public static Injector createInjector() { - Injector injector; - try { - injector = Guice.createInjector(CustomSettingsBinder.bindSettings(TestConstants.WAVE_TEST_PROPFILE, - CoreSettings.class)); - final PersistenceModule wavePersistModule = injector.getInstance(PersistenceModule.class); - final NoOpFederationModule federationModule = injector.getInstance(NoOpFederationModule.class); - final Injector childInjector = injector.createChildInjector(wavePersistModule, - FinderRegistry.init(new JpaPersistModule(TestConstants.PERSISTENCE_UNIT)), new RobotApiModule(), - new PlatformServerModule(), new DocumentServerModule(), new ChatServerModule(), new ServerModule( - false), federationModule, new WikiServerModule(), new AbstractModule() { - @Override - protected void configure() { - bindScope(SessionScoped.class, Scopes.SINGLETON); - bindScope(RequestScoped.class, Scopes.SINGLETON); - bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties"); - bind(HttpServletRequest.class).to(HttpServletRequestMocked.class); - } - }); - try { - childInjector.getInstance(WaveServerImpl.class).initialize(); - } catch (final WaveServerException e) { - e.printStackTrace(); + public static Injector createInjector() { + Injector injector; + try { + injector = Guice.createInjector(CustomSettingsBinder.bindSettings( + TestConstants.WAVE_TEST_PROPFILE, CoreSettings.class)); + final PersistenceModule wavePersistModule = injector.getInstance(PersistenceModule.class); + final NoOpFederationModule federationModule = injector.getInstance(NoOpFederationModule.class); + final Injector childInjector = injector.createChildInjector(wavePersistModule, + FinderRegistry.init(new JpaPersistModule(TestConstants.PERSISTENCE_UNIT)), + new RobotApiModule(), new PlatformServerModule(), new DocumentServerModule(), + new ChatServerModule(), new ServerModule(false), federationModule, new WikiServerModule(), + new AbstractModule() { + @Override + protected void configure() { + bindScope(SessionScoped.class, Scopes.SINGLETON); + bindScope(RequestScoped.class, Scopes.SINGLETON); + bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties"); + bind(HttpServletRequest.class).to(HttpServletRequestMocked.class); } - return childInjector; - } catch (final ConfigurationException e) { - e.printStackTrace(); - } - return null; + }); + try { + childInjector.getInstance(WaveServerImpl.class).initialize(); + } catch (final WaveServerException e) { + e.printStackTrace(); + } + return childInjector; + } catch (final ConfigurationException e) { + e.printStackTrace(); } + return null; + } - public IntegrationTestHelper(final Object... tests) { - final Injector injector = createInjector(); - injector.getInstance(KunePersistenceService.class).start(); - for (final Object test : tests) { - injector.injectMembers(test); - } + public IntegrationTestHelper(final Object... tests) { + final Injector injector = createInjector(); + injector.getInstance(KunePersistenceService.class).start(); + for (final Object test : tests) { + injector.injectMembers(test); } + } } Modified: trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java =================================================================== --- trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java 2011-05-13 15:23:17 UTC (rev 1387) +++ trunk/src/test/java/cc/kune/core/server/integration/content/ContentServiceVariousTest.java 2011-05-15 10:01:33 UTC (rev 1388) @@ -187,6 +187,7 @@ groupShortName = defaultContent.getStateToken().getGroup(); } + @Ignore @Test public void setTagsAndResults() throws Exception { contentService.setTags(getHash(), defaultContent.getStateToken(), "bfoo cfoa afoo2");
participants (1)
-
Vicente J. Ruiz Jurado