[kune-commits] r1629 - in trunk: . src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/init src/main/java/cc/kune/core/server/properties src/main/resources src/main/resources/META-INF src/test/java/cc/kune/core/server src/test/java/cc/kune/core/server/integration

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sun Nov 27 18:47:15 CET 2011


Author: vjrj_
Date: 2011-11-27 18:47:15 +0100 (Sun, 27 Nov 2011)
New Revision: 1629

Added:
   trunk/src/main/java/cc/kune/core/server/init/KuneJpaPersistModule.java
Removed:
   trunk/src/main/java/cc/kune/core/server/properties/PropertiesFileName.java
Modified:
   trunk/INSTALL
   trunk/TROUBLESHOOT
   trunk/pom.xml
   trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
   trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
   trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
   trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java
   trunk/src/main/resources/META-INF/persistence.xml
   trunk/src/main/resources/kune.properties
   trunk/src/test/java/cc/kune/core/server/TestHelper.java
   trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
Log:
CLOSED - # 160: Document and make more easy the way to select persistence units 
http://kune.ourproject.org/issues/ticket/160

Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/INSTALL	2011-11-27 17:47:15 UTC (rev 1629)
@@ -14,7 +14,7 @@
 
 ===MYSQL configuration===
 
-====Before db creation====	
+====Before db creation====
 
 You have to configure mysql to support UTF8 by editing your c:\Windows\my.ini or /etc/mysql/my.cnf (on Unix) file and adding something like:
 
@@ -65,7 +65,7 @@
  - src/main/resources/META-INF/persistence.xml
  - src/main/webapp/WEB-INF/publicspace/config/database.yml
 
-also if you want to select the database used (by default kune_dev). The db used in runtime is hardcoded (by now) in KuneRackModule.java
+also if you want to select the database used (by default kune_dev) you have to configure it in kune.properties.
 
 ===Source code (if you are installing Kune for development)===
 
@@ -75,7 +75,7 @@
  # (in the trunk directory)
  mvn compile -Dliquibase.should.run=false && mvn gwt:compile
 
-NOTE: If you change the previous db passwords after this compiling, you have to repeat the "mvn compile" because if not, probably you will use an old persistence.xml. See TROUBLESHOOT for more details.
+NOTE: If you change the previous db passwords after this compiling, you have to repeat the "mvn compile" because if not, probably you will use an old kune.properties. See TROUBLESHOOT for more details.
 
 ===Configure directories===
 
@@ -148,11 +148,11 @@
 
  bin/server.sh -j kune.jar # -h for more options
 
-Once started for the first time the db is initialized. Then you should stop (Ctrl-C) and start the db migration process: 
+Once started for the first time the db is initialized. Then you should stop (Ctrl-C) and start the db migration process:
 
  ./script/liquibase-migrate.sh
 
-=== Normal kune server start (after initialization) === 
+=== Normal kune server start (after initialization) ===
 
 After that, you can start the server using the script:
 
@@ -170,8 +170,8 @@
 
 ==Production environment instructions==
 
-With 
-  mvn package 
+With
+  mvn package
 an executable target/kune-VERSION-jar-with-dependencies.jar is generated in target directory. That you can use to start kune:
 
 bin/server.sh -j kune.jar
@@ -182,9 +182,9 @@
 
 Copy and adapt as much as possible to your needs these files:
 
-- src/main/resources/kune.properties 
-- src/main/resources/wave-server.properties 
-- src/main/resources/log4j.properties 
+- src/main/resources/kune.properties
+- src/main/resources/wave-server.properties
+- src/main/resources/log4j.properties
 - src/main/webapp/ws.html
 
 The best way to configure kune is to copy that files (for instance in /etc/kune/), to create a custom directory for ws.html and other of your custom html stuff (for instance /var/www/kune/), and add that directory to resources_base in wave-server.properties, for instance:
@@ -231,7 +231,7 @@
 Configure the 'Group chat service' (in Group Chat > Group Chat Settings tab) with "rooms" additionally or instead of "conference" (or change kune.chat.roomHost in <trunk>/src/main/resources/kune.properties)
 
 Change in 'Server > Server Manager > System Properties':
-  provider.auth.className to org.jivesoftware.openfire.auth.JDBCAuthProvider instead of 
+  provider.auth.className to org.jivesoftware.openfire.auth.JDBCAuthProvider instead of
     org.jivesoftware.openfire.auth.DefaultAuthProvider
   provider.user.className to org.jivesoftware.openfire.user.JDBCUserProvider instead of
     org.jivesoftware.openfire.user.DefaultUserProvider
@@ -247,7 +247,7 @@
 * In debian (with a .deb installation) you can to edit the configuration in /etc/openfire directory.
 * In Mac: /usr/local/openfire/conf
 
-Add these lines to conf/openfire.xml and check that the user/passwd of the db is the same here and in the persistence.xml:
+Add these lines to conf/openfire.xml and check that the user/passwd of the db is the same here and in kune.properties (the ones configured before):
 
 <pre>
 <jive>
@@ -284,7 +284,7 @@
 </jive>
 </pre>
 
-Instead of: 
+Instead of:
   <jdbcAuthProvider/>
   <jdbcUserProvider/>
   <admin/>
@@ -297,7 +297,7 @@
 Also you'll most likely want to change which usernames are authorized to login to the admin console adding then to <authorizedUsernames>.
 
 Restart openfire: /etc/init.d/openfire restart
-after that the previous values will be incorpored to Server > Server Manager > System Properties 
+after that the previous values will be incorpored to Server > Server Manager > System Properties
 
 After the section 'Run the server for the first time' you'll be able to use the password of the admin user of the kune instalation (specified in kune.properties), or other admin new users you want to register using kune and configure in the authorizedUsernames attribute.
 
@@ -337,7 +337,7 @@
 
     <Files *.nocache.*>
         ExpiresActive Off
-    </Files> 
+    </Files>
 
     ProxyPass / http://localhost:8080/
     ProxyPassReverse / http://localhost:8080/
@@ -351,11 +351,11 @@
 
 You should configure a SMTP server for use by Kune. See kune.site.smtp.* in kune.properties and check that your email system works propertly. For instance test something like:
 
- echo "Bests," | mailx -s "Testing mail in kune instalation" PUT_HERE at YOUR_EMAIL # or something similar 
+ echo "Bests," | mailx -s "Testing mail in kune instalation" PUT_HERE at YOUR_EMAIL # or something similar
 
 http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#ProtocolSMTP
 http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#JavaMailSending
 
-And: 
+And:
 http://javamail.kenai.com/nonav/javadocs/com/sun/mail/smtp/package-summary.html
 for more specific configuration parameters that maybe you need with your smtp server.

Modified: trunk/TROUBLESHOOT
===================================================================
--- trunk/TROUBLESHOOT	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/TROUBLESHOOT	2011-11-27 17:47:15 UTC (rev 1629)
@@ -75,9 +75,9 @@
 
 == Mysql: Caused by: java.sql.SQLException: Access denied for user 'kune'@'localhost' (using password: YES) ==
 
-Check that the password you have use in the database creation it's the same like the src/main/resources/META-INF/persistence.xml. If it's wrong maybe you have to remove the mysql user (DROP USER) and repeat the GRANT sentences of the INSTALL.
+Check that the password you have use in the database creation it's the same like the kune.properties. If it's wrong maybe you have to remove the mysql user (DROP USER) and repeat the GRANT sentences of the INSTALL.
 
-Also, be sure you do a "mvn compile" if you change the persistence.xml file to not use the old one.
+Also, be sure you do a "mvn compile" if you are running kune from the source and you change the kune.properties file to not use the old one.
 
 If you have this problem with openfire it's not enough to change the password in openfire.xml because probably it's already stored in the ofProperty openfire table and you need to change the password there.
 
@@ -89,16 +89,11 @@
 
 A check list:
 - these files should be the same:
+  diff src/main/resources/kune.properties target/kune-0.1.0-SNAPSHOT/WEB-INF/classes/kune.properties
+  and:
   diff src/main/resources/META-INF/persistence.xml target/kune-0.1.0-SNAPSHOT/WEB-INF/classes/META-INF/persistence.xml
-if not "mvn compile -Dliquibase.should.run=false"
-- the persistence-unit you use, that is hardcoded (by now) in  
-src/main/java/cc/kune/core/server/KuneRackModule.java
-(...)
-  public KuneRackModule() {
-    this("production", "/ws", null);
-  }
-(...)
-find that name in persistence.xml (we are using production, but can be other). The db user/password configured in persistence.xml for that name should be the same to that one you used in the GRANT sentence of mysql database creation.
+  if not "mvn compile -Dliquibase.should.run=false"
+also check the persistence unit that you are using and find that name in persistence.xml (we are using development, but can be other). The db user/password configured in kune.properties for that name should be the same to that one you used in the GRANT sentence of mysql database creation.
 
 To debug mysql logs, you can uncomment:
 #general_log_file        = /var/log/mysql/mysql.log
@@ -141,7 +136,7 @@
 
 Set M2_REPO to eclipse in Preferences > Java > Build Path > Classpath Variable (normally to /home/youruser/.m2/repository/)
 
-== Error generating CoreResources == 
+== Error generating CoreResources ==
 
 [INFO]       Computing all possible rebind results for 'cc.kune.core.client.resources.CoreResources' [INFO]          Rebinding cc.kune.core.client.resources.CoreResources [INFO]             Invoking generator com.google.gwt.resources.rebind.context.StaticClientBundleGenerator [INFO]                [ERROR] Generator 'com.google.gwt.resources.rebind.context.StaticClientBundleGenerator' threw an exception while rebinding 'cc.kune.cor
  [INFO]  at com.google.gwt.dev.util.Util.computeStrongName(Util.java:170) [INFO]  at com.google.gwt.dev.util.Util.computeStrongName(Util.java:145) [INFO]  at com.google.gwt.resources.rebind.context.StaticResourceContext.deploy(StaticResourceContext.java:61)

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/pom.xml	2011-11-27 17:47:15 UTC (rev 1629)
@@ -805,6 +805,13 @@
               <key>kune.server.config</key>
               <value>src/main/resources/kune.properties</value>
             </systemProperty>
+<!--             <systemProperty> -->
+<!--               <key>kune.db.persistence.name</key> -->
+              <!-- Persistence name, choose between: production, development,
+                test_db (testing environment using mysql db), test (testing environment using
+                h2 db). See persistence.xml -->
+<!--               <value>development</value> -->
+<!--             </systemProperty> -->
             <systemProperty>
               <key>wave.server.config</key>
               <value>src/main/resources/wave-server.properties</value>

Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java	2011-11-27 17:47:15 UTC (rev 1629)
@@ -19,6 +19,8 @@
  */
 package cc.kune.core.server;
 
+import java.util.Properties;
+
 import org.apache.commons.configuration.SystemConfiguration;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -41,7 +43,8 @@
 import cc.kune.core.server.manager.file.FileGwtUploadServlet;
 import cc.kune.core.server.manager.file.FileUploadManager;
 import cc.kune.core.server.manager.file.UserLogoDownloadManager;
-import cc.kune.core.server.properties.PropertiesFileName;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.server.properties.KunePropertiesDefault;
 import cc.kune.core.server.rack.RackBuilder;
 import cc.kune.core.server.rack.RackModule;
 import cc.kune.core.server.rack.filters.ForwardFilter;
@@ -75,24 +78,44 @@
   public static final Log LOG = LogFactory.getLog(KuneRackModule.class);
   private final Module configModule;
   private final String suffix;
+  final SystemConfiguration sysConf = new SystemConfiguration();
 
   public KuneRackModule() {
-    this("development", "/ws", null);
+    this(null, "/ws", null);
   }
 
-  public KuneRackModule(final String jpaUnit, final String suffix, final Scope sessionScope) {
-
+  public KuneRackModule(final String settedJpaUnit, final String suffix, final Scope sessionScope) {
     this.suffix = suffix;
-    final SystemConfiguration sysConf = new SystemConfiguration();
     final String kuneConfig = sysConf.getString("kune.server.config");
-
     configModule = new AbstractModule() {
       @Override
       public void configure() {
-        install(FinderRegistry.init(new JpaPersistModule(jpaUnit)));
+        final KunePropertiesDefault kuneProperties = new KunePropertiesDefault(kuneConfig);
+        bind(KuneProperties.class).toInstance(kuneProperties);
+        final String configuredJpaUnit = kuneProperties.get(KuneProperties.SITE_DB_PERSISTENCE_NAME);
+
+        // precedence method param > properties
+        final String jpaUnit = settedJpaUnit != null ? settedJpaUnit
+            : configuredJpaUnit != null ? configuredJpaUnit : "development";
+        LOG.info("Using persistence unit: " + jpaUnit);
+
+        final JpaPersistModule jpaPersistModule = new JpaPersistModule(jpaUnit);
+
+        if (!jpaUnit.equals("test")) {
+          final Properties dbProperties = new Properties();
+          dbProperties.setProperty("hibernate.connection.url",
+              kuneProperties.get(KuneProperties.SITE_DB_URL));
+          dbProperties.setProperty("hibernate.connection.username",
+              kuneProperties.get(KuneProperties.SITE_DB_USER));
+          dbProperties.setProperty("hibernate.connection.password",
+              kuneProperties.get(KuneProperties.SITE_DB_PASSWORD));
+          jpaPersistModule.properties(dbProperties);
+        }
+
+        install(FinderRegistry.init(jpaPersistModule));
         bindInterceptor(Matchers.annotatedWith(LogThis.class), new NotInObject(),
             new LoggerMethodInterceptor());
-        bindConstant().annotatedWith(PropertiesFileName.class).to(kuneConfig);
+        // bindConstant().annotatedWith(PropertiesFileName.class).to(kuneConfig);
         if (sessionScope != null) {
           bindScope(SessionScoped.class, sessionScope);
         }

Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java	2011-11-27 17:47:15 UTC (rev 1629)
@@ -85,8 +85,6 @@
 import cc.kune.core.server.manager.impl.UserManagerDefault;
 import cc.kune.core.server.mapper.DozerMapper;
 import cc.kune.core.server.mapper.Mapper;
-import cc.kune.core.server.properties.KuneProperties;
-import cc.kune.core.server.properties.KunePropertiesDefault;
 import cc.kune.core.server.rpc.ContentRPC;
 import cc.kune.core.server.rpc.GroupRPC;
 import cc.kune.core.server.rpc.I18nRPC;
@@ -179,7 +177,7 @@
     bindManagers();
     bindRPC();
     bindServices();
-    bind(KuneProperties.class).to(KunePropertiesDefault.class);
+    // bind(KuneProperties.class).to(KunePropertiesDefault.class);
     bind(Mapper.class).to(DozerMapper.class);
     bind(ServerToolRegistry.class);
     // bind(FileUploadManager.class).in(ServletScopes.REQUEST);

Added: trunk/src/main/java/cc/kune/core/server/init/KuneJpaPersistModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/init/KuneJpaPersistModule.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/init/KuneJpaPersistModule.java	2011-11-27 17:47:15 UTC (rev 1629)
@@ -0,0 +1,5 @@
+package cc.kune.core.server.init;
+
+public class KuneJpaPersistModule {
+
+}

Modified: trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java	2011-11-27 17:47:15 UTC (rev 1629)
@@ -43,6 +43,10 @@
   String SITE_ADMIN_PASSWD = "kune.admin.password";
   String SITE_ADMIN_SHORTNAME = "kune.admin.shortName";
   String SITE_COMMON_NAME = "kune.default.site.commonname";
+  String SITE_DB_PASSWORD = "kune.db.password";
+  String SITE_DB_PERSISTENCE_NAME = "kune.db.persistence.name";
+  String SITE_DB_URL = "kune.db.url";
+  String SITE_DB_USER = "kune.db.user";
   String SITE_DEF_LICENSE = "kune.default.license";
   String SITE_DOMAIN = "kune.site.domain";
   String SITE_GROUP_AVAILABLE_TOOLS = "kune.tools.groupSiteAvailableTools";

Modified: trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java	2011-11-27 17:47:15 UTC (rev 1629)
@@ -38,7 +38,7 @@
   private final String fileName;
 
   @Inject
-  public KunePropertiesDefault(@PropertiesFileName final String fileName) {
+  public KunePropertiesDefault(final String fileName) {
     this.fileName = fileName;
     try {
       config = new CompositeConfiguration();

Deleted: trunk/src/main/java/cc/kune/core/server/properties/PropertiesFileName.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/PropertiesFileName.java	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/main/java/cc/kune/core/server/properties/PropertiesFileName.java	2011-11-27 17:47:15 UTC (rev 1629)
@@ -1,31 +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.core.server.properties;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import com.google.inject.BindingAnnotation;
-
- at BindingAnnotation
- at Retention(RetentionPolicy.RUNTIME)
-public @interface PropertiesFileName {
-
-}

Modified: trunk/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/src/main/resources/META-INF/persistence.xml	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/main/resources/META-INF/persistence.xml	2011-11-27 17:47:15 UTC (rev 1629)
@@ -38,9 +38,13 @@
       <property name="use_sql_comments" value="true"/>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
       <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
+
+      <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.url"
         value="jdbc:mysql://localhost/kune_prod?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
+        <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.username" value="kune"/>
+      <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.password" value="db4kune"/>
 
       <!-- http://stackoverflow.com/questions/221379/hibernate-hbm2ddl-auto-update-in-production
@@ -97,9 +101,12 @@
       <property name="use_sql_comments" value="true"/>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
       <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
+      <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.url"
         value="jdbc:mysql://localhost/kune_dev?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
+        <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.username" value="kune"/>
+      <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.password" value="db4kune"/>
 
       <!-- http://stackoverflow.com/questions/221379/hibernate-hbm2ddl-auto-update-in-production
@@ -154,9 +161,12 @@
       <property name="use_sql_comments" value="false"/>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
       <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
+      <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.url"
         value="jdbc:mysql://localhost/kune_test?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=UTF-8"/>
+        <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.username" value="kune"/>
+      <!--  Configured and overrided by kune.properties -->
       <property name="hibernate.connection.password" value="db4kune"/>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       <!-- <property name="hibernate.hbm2ddl.auto" value="create" /> -->

Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/main/resources/kune.properties	2011-11-27 17:47:15 UTC (rev 1629)
@@ -22,14 +22,30 @@
 # ws.html has a similar value for UI client
 kune.default.site.commonname = this site
 
-# Email
+### Email
+
 kune.site.smtp.host = localhost
 kune.site.smtp.defaultfrom = noreply at localhost
 # If we should avoid the use of smtp (use only for avoid emails during development)
 kune.site.smtp.skip = true
 
-### licenses
+### Database
 
+# Persistence name, choose between:
+#   - production : production environment
+#   - development: development enviroment
+#   - test_db: testing environment using mysql db
+#   - test: testing environment using h2 db (memory)
+kune.db.persistence.name = development
+
+# check that the db, user and passwd exists and has the correct rights (see INSTALL)
+# This only used in production/develoment & test_db environment (not with h2 db):
+kune.db.url = jdbc:mysql://localhost/kune_dev?createDatabaseIfNotExist=true&amp;useUnicode=true&amp;characterEncoding=UTF-8
+kune.db.user = kune
+kune.db.password = db4kune
+
+### Licenses
+
 kune.default.license = by-sa-v3.0
 # Current CC version, see license table and shortname field (for instance by-sa-v3.0)
 kune.currentccversion = v3.0

Modified: trunk/src/test/java/cc/kune/core/server/TestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/TestHelper.java	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/test/java/cc/kune/core/server/TestHelper.java	2011-11-27 17:47:15 UTC (rev 1629)
@@ -35,7 +35,8 @@
 
 import cc.kune.core.server.init.FinderRegistry;
 import cc.kune.core.server.integration.HttpServletRequestMocked;
-import cc.kune.core.server.properties.PropertiesFileName;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.server.properties.KunePropertiesDefault;
 import cc.kune.wave.server.CustomSettingsBinder;
 
 import com.google.inject.Binder;
@@ -64,7 +65,7 @@
         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(KuneProperties.class).toInstance(new KunePropertiesDefault(propetiesFileName));
           binder.bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
         }
       });

Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java	2011-11-27 14:01:08 UTC (rev 1628)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java	2011-11-27 17:47:15 UTC (rev 1629)
@@ -36,7 +36,8 @@
 import cc.kune.core.server.PlatformServerModule;
 import cc.kune.core.server.TestConstants;
 import cc.kune.core.server.init.FinderRegistry;
-import cc.kune.core.server.properties.PropertiesFileName;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.server.properties.KunePropertiesDefault;
 import cc.kune.docs.server.DocumentServerModule;
 import cc.kune.events.server.EventsServerModule;
 import cc.kune.lists.server.ListsServerModule;
@@ -71,7 +72,7 @@
             protected void configure() {
               bindScope(SessionScoped.class, Scopes.SINGLETON);
               bindScope(RequestScoped.class, Scopes.SINGLETON);
-              bindConstant().annotatedWith(PropertiesFileName.class).to("kune.properties");
+              bind(KuneProperties.class).toInstance(new KunePropertiesDefault("kune.properties"));
               bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
             }
           });




More information about the kune-commits mailing list