Commits

Anonymous committed 7e0ccb9 Merge

Merge

Comments (0)

Files changed (90)

encuestame-business/pom.xml

                 </executions>
             </plugin>
         </plugins>
+        <resources>
+            <resource>
+              <directory>src/main/resources/</directory>
+              <includes>
+                <include>spring-test/*.*</include>
+                <include>org/**/*.*</include>
+                <include>properties-test/*.*</include>
+              </includes>
+              <filtering>true</filtering>
+            </resource>
+        </resources>
     </build>
     <dependencies>
      <dependency>

encuestame-business/src/main/java/org/encuestame/business/config/EncuestameConfig.java

             final String enviromentPropertyFile = System.getProperty(overwriteJvmParam);
             if(enviromentPropertyFile != null && enviromentPropertyFile.length() > 0) {
                 customEncuestameFile = new File(enviromentPropertyFile);
-
                 // make sure the file exists, then try and load it
                 if(customEncuestameFile != null && customEncuestameFile.exists()) {
                     is = new FileInputStream(customEncuestameFile);

encuestame-business/src/main/java/org/encuestame/business/mail/MailServiceImpl.java

               Map model = new HashMap();
               model.put("invitation", invitation);
               String text = VelocityEngineUtils.mergeTemplateIntoString(
-                 velocityEngine, "invitation.vm", model);
+                 velocityEngine, "/org/encuestame/business/mail/templates/invitation.vm", model);
               message.setText(text, true);
            }
         };
               Map model = new HashMap();
               model.put("notification", notification);
               String text = VelocityEngineUtils.mergeTemplateIntoString(
-                 velocityEngine, "notification.vm", model);
+                 velocityEngine, "/org/encuestame/business/mail/templates/notification.vm", model);
               message.setText(text, true);
            }
         };
               Map model = new HashMap();
               model.put("user", user);
               String text = VelocityEngineUtils.mergeTemplateIntoString(
-                 velocityEngine, "password-confirmation.vm", model);
+                 velocityEngine, "/org/encuestame/business/mail/templates/password-confirmation.vm", model);
               message.setText(text, true);
            }
         };
               model.put("user", user);
               model.put("inviteCode", inviteCode);
               String text = VelocityEngineUtils.mergeTemplateIntoString(
-                              velocityEngine, "confirm-your-account.vm", model);
+                              velocityEngine, "/org/encuestame/business/mail/templates/confirm-your-account.vm", model);
               message.setText(text, true);
            }
         };
         final Map<String, UserAccountBean> model = new HashMap<String, UserAccountBean>();
         model.put("user", unitUserBean);
         this.sendMimeEmail(model, unitUserBean.getEmail(), "Your New Password", this.noEmailResponse,
-                           "renew-password.vm");
+                           "/org/encuestame/business/mail/templates/renew-password.vm");
     }
 
     /**

encuestame-business/src/main/resources/org/encuestame/business/config/encuestame-config.properties

+#
+# License Agreement.
+#
+# encuestame system online surveys
+# Copyright (C) 2005-2008 encuestame Development Team
+#
+# This product is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
+#
+
+#-----------------------------------------------------------------------------
+# Required configuration settings
+#-----------------------------------------------------------------------------
+
+# Installation type 'auto' or 'manual'
+setup.installation.type = manual
+# Installation type 'sql' or 'hibernate'
+setup.installation.handler = sql
+
+#----------------------------------------------------------------------------
+# Database configuration settings
+#----------------------------------------------------------------------------
+
+datasource.userbd =
+datasource.pass =
+datasource.classname =
+datasource.dialect =
+datasource.showsql = false
+datasource.delimited =
+## In production this property should change to "none"
+datasource.hbm2ddl.auto = none
+
+#---------------------------------------------------------------
+# Security Config
+#---------------------------------------------------------------
+#Force SSL on login
+spring.sec.forceLoginSSL=false
+#Retrieve permission by group
+spring.sec.roleByGroup = true
+#Retrieve permission by author
+spring.sec.roleByAuthor = true
+#Default Rol
+spring.sec.role.prefix = ENCUESTAME_
+#Path to login
+spring.sec.loginPath=/user/signin
+#After success log in this is the default path user will sent
+spring.sec.defaultLoginUrl=/account/dashboard
+#Path if login fail
+spring.sec.login.error=/user/signin?failure=true
+#Path if recourse is denided
+spring.sec.login.denied=/error
+#Log out
+spring.sec.logout.url=/user/logout
+#After log out the path will send user
+spring.sec.logout.sucess=/home
+#spring.sec.invalidate.session=true
+# Security Keys
+spring.sec.rememberMe.key=9Mdj7MVvkXOXJ8uRgtg/Xb/3eJyW0
+spring.sec.anonymous.key=MU7kyU0he1MvXEDZ9Mdj7MVvkXOXJ8uRgtg/Xb/3eJyW0HZa3csBoyvinGEC4vmi
+spring.sec.encrypt.algorithm.key=PBEWithMD5AndTripleDES
+spring.sec.encrypt.password.key=password
+sec.suspendedNotification = true
+sec.forceLogin = true
+sec.reCaptcha = ${encuestame.recaptcha}
+
+#----------------------------------------------------------------------
+# Required app config.
+#----------------------------------------------------------------------
+application.name = encuestame
+application.context = true
+application.urlImg = /images
+application.encoding = UTF-8
+application.apiKeygoogle = ${google.maps.key}
+application.domain = http://localhost:8080/
+
+#----------------------------------
+# Proxy configuration
+#----------------------------------
+
+application.proxyPass = ${app.proxypass}
+
+#-----------------------------------------------------------------------------
+# Social Provider Configuration
+#-----------------------------------------------------------------------------
+
+# Twitter Provider
+twitter.tinyUrl = http://tinyurl.com/api-create.php
+twitter.oauth.request.token = http://twitter.com/oauth/request_token
+twitter.oauth.access.token = http://twitter.com/oauth/access_token
+twitter.oauth.authorize = http://twitter.com/oauth/authorize?oauth_token={token}
+twitter.url.domain = http://twitter.com/
+## Should be update with your twitter account.
+twitter.oauth.consumerKey = nFboU4T1Zhv8cqMC4cP0ug
+twitter.oauth.consumerSecret = GwOPUEJEaCbNBiBzq6J8StDhb7FOmwDcjfX6zMe0
+## value no required. --------------------------------------------------------
+twitter.oauth.accessToken = 114054787-I17YXofo0576XoQe76I0xI2ecjgNWn9YDJRW8gQI
+twitter.oauth.accessTokenSecret = 1YzYMWOobF2EfegPQXKpmkWqNc6W8sLOQI6vtZFpbQs
+# ----------------------------------------------------------------------------
+# LinkedIn Provider
+linkedIn.oauth.api.key = 5hkdPhtfkRwR0uRhIftai57FA0xbpH7m2fsBFfELvVLf6KMqw1X_FdzsgPkFORuS
+linkedIn.oauth.api.secret = 3Tuj7nXvACdCwffnbh-NkUXQ_Re0t1FPakogEPApw_3DBsfowdQuoggCCTd38a9o
+linkedIn.oauth.authorize.url = https://www.linkedin.com/uas/oauth/authorize?oauth_token={token}
+linkedIn.oauth.request.token = https://api.linkedin.com/uas/oauth/requestToken
+# Facebook Provider
+facebook.api.key = db89ecfed3c7f3e212e01b3fc919838ff04049503d8402034b7148d5d3b7976fe4a314a31db0a42d
+facebook.api.secret = f85145c9f11fd9d920759b89a29c8e3f4ca05864257eeb4e394557f21588ad41a5f44f16242b14d7
+facebook.api.id = 140372495981006
+# TripIt
+tripIt.oauth.api.key = ed00208afc958b1d6fbd06f7a20faa03e810fa27
+tripIt.oauth.api.secret = 47c29a0bb66df8c633580e3810536b9b25ff3a59
+tripIt.oauth.api.request.url = https://api.tripit.com/oauth/request_token
+tripIt.oauth.api.authorize.url = https://www.tripit.com/oauth/authorize?oauth_token={token}&oauth_callback=https://xxxx.com/connect/tripit
+tripIt.oauth.api.accessToken.url = https://api.tripit.com/oauth/access_token
+# Google Api Key
+google.api.key = AIzaSyCvEMnlGa4q4Suayx1bMYXg-Wkf1jYmmaQ
+
+
+# -----------------------------------------------------------------------------
+# Survey/TweetPoll/Poll vote configuration
+# -----------------------------------------------------------------------------
+
+answers.answerPoll = /poll/view
+answers.tweetPollResults = /tweet/view
+answers.tweetPath = /tweet/vote
+answers.tweetPathVote = /tweet/vote
+
+
+#-----------------------------------------------------------------------------
+# Directory settings
+#-----------------------------------------------------------------------------
+dir.data.warehouse = ${user.home}/encuestame
+dir.data.picture = dir.data.warehouse/pictures
+dir.data.profiles = dir.data.warehouse/profiles
+dir.data.index = dir.data.warehouse/indexes

encuestame-business/src/main/resources/org/encuestame/business/mail/templates/confirm-your-account.vm

+<html>
+<body>
+    <div style="padding:14px;margin-bottom:4px;background-color:#008eb9">
+        <div style="font-size:16px;font-weidth:bold:padding:5px;">
+            Encuestame Survey System
+        </div>
+    </div>
+    <h2>Hi, ${user.username} </h2>
+    <p>
+    <div>Please confirm your encuestame account by clicking this link:</div>
+    <a href="http://localhost:8080/encuestame/account/confirm/email/${user.username}/${inviteCode}">
+        http://localhost:8080/encuestame/account/confirm/email/${user.username}/${inviteCode}
+    </a><br/>
+    <div>Once you have confirmed your account, you can access full access.</div><br/>
+
+    <div>${app.url}</div><br/>
+
+    <div>If you have received this message in error, please <a href="#">click here.</a></div><br/>
+
+    <div style="font-size:10px;">
+        footer message footer message footer message footer message footer message footer message footer message
+        footer message footer message footer messagefooter message footer message footer message footer message
+         footer message footer message footer message footer messagefooter message footer message
+    </div>
+    </p>
+</body>
+</html>

encuestame-business/src/main/resources/org/encuestame/business/mail/templates/invitation.vm

+<html>
+<body>
+    <h3>Hi, You received this message because you are subscribed to ${invitation.listName} in "Encuestame"</h3>
+    <div>
+       To subscribe to this Email List, follow this link ${invitation.urlInvitation}
+    </div>
+</body>
+</html>
+

encuestame-business/src/main/resources/org/encuestame/business/mail/templates/notification.vm

+<html>
+<body>
+    <h3>Hi, This notification has sended to you from Encuestame </h3>
+    <div>
+     ${notification.message}
+    </div>
+
+    <div>
+       To Unsubscribe to this Email List, follow this link ${notification.urlUnsuscribe}
+    </div>
+</body>
+</html>
+
+ml>

encuestame-business/src/main/resources/org/encuestame/business/mail/templates/password-confirmation.vm

+<html>
+<body>
+    <h3>Hi ${user.username}, welcome to Encuestame!</h3>
+    <div>
+       Your new password  is <b>${user.password}</b>
+    </div>
+    <div>
+        Login <a href="#">here !!</a>
+    </div>
+</body>
+</html>

encuestame-business/src/main/resources/org/encuestame/business/mail/templates/renew-password.vm

+<html>
+<body>
+    <h3>Hi ${user.username}, we send your new passowrd!</h3>
+    <div>
+       Your new password  is <b>${user.password}</b>
+    </div>
+    <div>
+        Login <a href="#">here !!</a>
+    </div>
+</body>
+</html>

encuestame-business/src/main/resources/org/encuestame/config/encuestame-config.properties

-#
-# License Agreement.
-#
-# encuestame system online surveys
-# Copyright (C) 2005-2008 encuestame Development Team
-#
-# This product is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
-#
-
-#-----------------------------------------------------------------------------
-# Required configuration settings
-#-----------------------------------------------------------------------------
-
-# Installation type 'auto' or 'manual'
-setup.installation.type = manual
-# Installation type 'sql' or 'hibernate'
-setup.installation.handler = sql
-
-#----------------------------------------------------------------------------
-# Database configuration settings
-#----------------------------------------------------------------------------
-
-datasource.userbd =
-datasource.pass =
-datasource.classname =
-datasource.dialect =
-datasource.showsql = false
-datasource.delimited =
-## In production this property should change to "none"
-datasource.hbm2ddl.auto = none
-
-#---------------------------------------------------------------
-# Security Config
-#---------------------------------------------------------------
-#Force SSL on login
-spring.sec.forceLoginSSL=false
-#Retrieve permission by group
-spring.sec.roleByGroup = true
-#Retrieve permission by author
-spring.sec.roleByAuthor = true
-#Default Rol
-spring.sec.role.prefix = ENCUESTAME_
-#Path to login
-spring.sec.loginPath=/user/signin
-#After success log in this is the default path user will sent
-spring.sec.defaultLoginUrl=/account/dashboard
-#Path if login fail
-spring.sec.login.error=/user/signin?failure=true
-#Path if recourse is denided
-spring.sec.login.denied=/error
-#Log out
-spring.sec.logout.url=/user/logout
-#After log out the path will send user
-spring.sec.logout.sucess=/home
-#spring.sec.invalidate.session=true
-# Security Keys
-spring.sec.rememberMe.key=9Mdj7MVvkXOXJ8uRgtg/Xb/3eJyW0
-spring.sec.anonymous.key=MU7kyU0he1MvXEDZ9Mdj7MVvkXOXJ8uRgtg/Xb/3eJyW0HZa3csBoyvinGEC4vmi
-spring.sec.encrypt.algorithm.key=PBEWithMD5AndTripleDES
-spring.sec.encrypt.password.key=password
-sec.suspendedNotification = true
-sec.forceLogin = true
-sec.reCaptcha = ${encuestame.recaptcha}
-
-#----------------------------------------------------------------------
-# Required app config.
-#----------------------------------------------------------------------
-application.name = encuestame
-application.context = true
-application.urlImg = /images
-application.encoding = UTF-8
-application.apiKeygoogle = ${google.maps.key}
-application.domain = http://localhost:8080/
-
-#----------------------------------
-# Proxy configuration
-#----------------------------------
-
-application.proxyPass = ${app.proxypass}
-
-#-----------------------------------------------------------------------------
-# Social Provider Configuration
-#-----------------------------------------------------------------------------
-
-# Twitter Provider
-twitter.tinyUrl = http://tinyurl.com/api-create.php
-twitter.oauth.request.token = http://twitter.com/oauth/request_token
-twitter.oauth.access.token = http://twitter.com/oauth/access_token
-twitter.oauth.authorize = http://twitter.com/oauth/authorize?oauth_token={token}
-twitter.url.domain = http://twitter.com/
-## Should be update with your twitter account.
-twitter.oauth.consumerKey = nFboU4T1Zhv8cqMC4cP0ug
-twitter.oauth.consumerSecret = GwOPUEJEaCbNBiBzq6J8StDhb7FOmwDcjfX6zMe0
-## value no required. --------------------------------------------------------
-twitter.oauth.accessToken = 114054787-I17YXofo0576XoQe76I0xI2ecjgNWn9YDJRW8gQI
-twitter.oauth.accessTokenSecret = 1YzYMWOobF2EfegPQXKpmkWqNc6W8sLOQI6vtZFpbQs
-# ----------------------------------------------------------------------------
-# LinkedIn Provider
-linkedIn.oauth.api.key = 5hkdPhtfkRwR0uRhIftai57FA0xbpH7m2fsBFfELvVLf6KMqw1X_FdzsgPkFORuS
-linkedIn.oauth.api.secret = 3Tuj7nXvACdCwffnbh-NkUXQ_Re0t1FPakogEPApw_3DBsfowdQuoggCCTd38a9o
-linkedIn.oauth.authorize.url = https://www.linkedin.com/uas/oauth/authorize?oauth_token={token}
-linkedIn.oauth.request.token = https://api.linkedin.com/uas/oauth/requestToken
-# Facebook Provider
-facebook.api.key = db89ecfed3c7f3e212e01b3fc919838ff04049503d8402034b7148d5d3b7976fe4a314a31db0a42d
-facebook.api.secret = f85145c9f11fd9d920759b89a29c8e3f4ca05864257eeb4e394557f21588ad41a5f44f16242b14d7
-facebook.api.id = 140372495981006
-# TripIt
-tripIt.oauth.api.key = ed00208afc958b1d6fbd06f7a20faa03e810fa27
-tripIt.oauth.api.secret = 47c29a0bb66df8c633580e3810536b9b25ff3a59
-tripIt.oauth.api.request.url = https://api.tripit.com/oauth/request_token
-tripIt.oauth.api.authorize.url = https://www.tripit.com/oauth/authorize?oauth_token={token}&oauth_callback=https://xxxx.com/connect/tripit
-tripIt.oauth.api.accessToken.url = https://api.tripit.com/oauth/access_token
-# Google Api Key
-google.api.key = AIzaSyCvEMnlGa4q4Suayx1bMYXg-Wkf1jYmmaQ
-
-
-# -----------------------------------------------------------------------------
-# Survey/TweetPoll/Poll vote configuration
-# -----------------------------------------------------------------------------
-
-answers.answerPoll = /poll/view
-answers.tweetPollResults = /tweet/view
-answers.tweetPath = /tweet/vote
-answers.tweetPathVote = /tweet/vote
-
-
-#-----------------------------------------------------------------------------
-# Directory settings
-#-----------------------------------------------------------------------------
-dir.data.warehouse = ${user.home}/encuestame
-dir.data.picture = dir.data.warehouse/pictures
-dir.data.profiles = dir.data.warehouse/profiles
-dir.data.index = dir.data.warehouse/indexes

encuestame-business/src/main/resources/org/encuestame/email/templates/confirm-your-account.vm

-<html>
-<body>
-    <div style="padding:14px;margin-bottom:4px;background-color:#008eb9">
-        <div style="font-size:16px;font-weidth:bold:padding:5px;">
-            Encuestame Survey System
-        </div>
-    </div>
-    <h2>Hi, ${user.username} </h2>
-    <p>
-    <div>Please confirm your encuestame account by clicking this link:</div>
-    <a href="http://localhost:8080/encuestame/account/confirm/email/${user.username}/${inviteCode}">
-        http://localhost:8080/encuestame/account/confirm/email/${user.username}/${inviteCode}
-    </a><br/>
-    <div>Once you have confirmed your account, you can access full access.</div><br/>
-
-    <div>${app.url}</div><br/>
-
-    <div>If you have received this message in error, please <a href="#">click here.</a></div><br/>
-
-    <div style="font-size:10px;">
-        footer message footer message footer message footer message footer message footer message footer message
-        footer message footer message footer messagefooter message footer message footer message footer message
-         footer message footer message footer message footer messagefooter message footer message
-    </div>
-    </p>
-</body>
-</html>

encuestame-business/src/main/resources/org/encuestame/email/templates/invitation.vm

-<html>
-<body>
-    <h3>Hi, You received this message because you are subscribed to ${invitation.listName} in "Encuestame"</h3>
-    <div>
-       To subscribe to this Email List, follow this link ${invitation.urlInvitation}
-    </div>
-</body>
-</html>
-

encuestame-business/src/main/resources/org/encuestame/email/templates/notification.vm

-<html>
-<body>
-    <h3>Hi, This notification has sended to you from Encuestame </h3>
-    <div>
-     ${notification.message}
-    </div>
-
-    <div>
-       To Unsubscribe to this Email List, follow this link ${notification.urlUnsuscribe}
-    </div>
-</body>
-</html>
-
-ml>

encuestame-business/src/main/resources/org/encuestame/email/templates/password-confirmation.vm

-<html>
-<body>
-    <h3>Hi ${user.username}, welcome to Encuestame!</h3>
-    <div>
-       Your new password  is <b>${user.password}</b>
-    </div>
-    <div>
-        Login <a href="#">here !!</a>
-    </div>
-</body>
-</html>

encuestame-business/src/main/resources/org/encuestame/email/templates/renew-password.vm

-<html>
-<body>
-    <h3>Hi ${user.username}, we send your new passowrd!</h3>
-    <div>
-       Your new password  is <b>${user.password}</b>
-    </div>
-    <div>
-        Login <a href="#">here !!</a>
-    </div>
-</body>
-</html>

encuestame-business/src/main/resources/spring-test/encuestame-report-context.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+</beans>

encuestame-business/src/main/resources/spring-test/encuestame-security-context.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:security="http://www.springframework.org/schema/security"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+       http://www.springframework.org/schema/security
+       http://www.springframework.org/schema/security/spring-security-3.0.xsd">
+
+  <!-- To enable @Pre and @Post Annotations -->
+  <security:global-method-security pre-post-annotations="enabled"/>
+
+  <!-- Authentication Manager -->
+  <security:authentication-manager alias="authenticationManager">
+    <security:authentication-provider  user-service-ref="enMeAuthenticationDao">
+        <security:password-encoder ref="passwordEncoder" />
+    </security:authentication-provider>
+  </security:authentication-manager>
+
+  <bean id="passwordEncoder" class="org.jasypt.spring.security3.PasswordEncoder">
+    <property name="passwordEncryptor">
+      <ref bean="jasyptPasswordEncryptor" />
+    </property>
+  </bean>
+
+  <bean id="jasyptPasswordEncryptor" class="org.jasypt.util.password.StrongPasswordEncryptor" />
+
+
+  <bean id="enMeAuthenticationDao" class="org.encuestame.core.security.EnMeUserServiceImp">
+    <property name="roleGroupAuth" value="${spring.sec.roleByGroup}" />
+    <property name="roleUserAuth" value="${spring.sec.roleByAuthor}" />
+  </bean>
+
+  <bean id="authenticationEntryPoint"
+    class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
+    <property name="loginFormUrl" value="${spring.sec.loginPath}" />
+    <property name="forceHttps" value="${spring.sec.forceLoginSSL}" />
+  </bean>
+
+  <security:http auto-config="false"
+                 entry-point-ref="authenticationEntryPoint"
+                 access-decision-manager-ref="voteAccessDecisionManager"
+                 access-denied-page="${spring.sec.login.denied}">
+    <security:intercept-url pattern="index.jsp" filters="none" />
+
+    <!-- Public Paths -->
+    <security:intercept-url pattern="/index.jspx" filters="none"/>
+    <security:intercept-url pattern="/error.jspx" filters="none"/>
+    <security:intercept-url pattern="/home" filters="none"/>
+    <security:intercept-url pattern="/users.jspx" filters="none"/>
+    <security:intercept-url pattern="/tags.jspx" filters="none"/>
+    <security:intercept-url pattern="/signin.jspx" filters="none"/>
+    <security:intercept-url pattern="/forgot.jspx" filters="none"/>
+    <security:intercept-url pattern="/signup.jspx" filters="none"/>
+
+    <!-- Admon Paths -->
+    <security:intercept-url pattern="/admon/**/*" access="ENCUESTAME_ADMIN, ENCUESTAME_USER"/>
+
+    <!-- Account Paths
+    <security:intercept-url pattern="/user/signin.jspx" access="ENCUESTAME_ANONYMOUS"/>
+    <security:intercept-url pattern="/user/forgot.jspx" access="ENCUESTAME_ANONYMOUS" />
+    <security:intercept-url pattern="/user/signup.jspx" access="ENCUESTAME_ANONYMOUS"/>
+    -->
+
+    <security:intercept-url pattern="/user/logout" access="ENCUESTAME_USER"/>
+
+    <!-- Super Admin -->
+    <security:intercept-url pattern="/superAdmin.jspx" access="ENCUESTAME_SUPER"/>
+
+    <!-- Shared areas -->
+    <security:intercept-url pattern="/settings/**/*" access="ENCUESTAME_USER"/>
+
+    <!-- Surveys / Poll / TweetPoll Paths -->
+    <security:intercept-url pattern="/tweetpoll.jspx" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"   />
+    <security:intercept-url pattern="/poll.jspx" access="ENCUESTAME_USER"/>
+    <security:intercept-url pattern="/survey.jspx" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"/>
+
+    <!-- Vote Paths
+    <security:intercept-url pattern="/tweet/*" access="ENCUESTAME_USER" />
+    -->
+
+    <!-- Resources Path -->
+    <security:intercept-url pattern="/resources/*"  filters="none" />
+
+    <security:remember-me key="${spring.sec.rememberMe.key}" services-alias="_rememberMeServices" token-validity-seconds="10080"/>
+    <security:anonymous enabled="true" granted-authority="ENCUESTAME_ANONYMOUS" key="${spring.sec.anonymous.key}" />
+    <security:logout logout-success-url="${spring.sec.logout.sucess}" invalidate-session="true"
+                     logout-url="${spring.sec.logout.url}"/>
+    <security:custom-filter position="FORM_LOGIN_FILTER" ref="authenticationProcessingFilter" />
+  </security:http>
+
+  <!--  Enable OAuth Security.
+  <import resource="encuestame-security-oauth-context.xml"/>
+    -->
+
+  <bean id="authenticationProcessingFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
+      <property name="authenticationManager" ref="authenticationManager"/>
+      <property name="authenticationFailureHandler" ref="authenticationFailureHandler"/>
+      <property name="authenticationSuccessHandler" ref="authenticationSuccessHandler"/>
+      <property name="filterProcessesUrl" value="/j_spring_security_check"/>
+  </bean>
+
+   <bean id="authenticationSuccessHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler">
+       <property name="defaultTargetUrl" value="${spring.sec.defaultLoginUrl}"/>
+   </bean>
+
+   <bean id="authenticationFailureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
+       <property name="defaultFailureUrl" value="${spring.sec.login.error}"/>
+   </bean>
+
+  <bean id="voteAccessDecisionManager"
+    class="org.springframework.security.access.vote.AffirmativeBased">
+    <property name="allowIfAllAbstainDecisions">
+      <value>false</value>
+    </property>
+    <property name="decisionVoters">
+      <list>
+        <ref bean="roleVoter" />
+      </list>
+    </property>
+  </bean>
+
+  <bean id="roleVoter" class="org.encuestame.core.security.EnMeRoleVoter">
+    <property name="rolePrefix" value="${spring.sec.role.prefix}" />
+  </bean>
+
+  <!--  reCaptcha -->
+
+   <bean id="reCaptcha" class="net.tanesha.recaptcha.ReCaptchaImpl" scope="singleton">
+        <property name="privateKey" value="6LdyFwUAAAAAAGB3BsjX-j5EgYzULsR3ftiUvwUd" />
+        <property name="publicKey" value="6LdyFwUAAAAAAP6p1IeqUM7uMKUYyPazw-haEAUU" />
+        <property name="recaptchaServer" value="${encuestame.recaptcha.recaptchaserver}" />
+        <property name="includeNoscript" value="${encuestame.recaptcha.includenoscript}" />
+   </bean>
+
+</beans>

encuestame-business/src/main/resources/spring-test/encuestame-security-oauth-context.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:oauth="http://www.springframework.org/schema/security/oauth"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+        http://www.springframework.org/schema/security/oauth
+        http://www.springframework.org/schema/security/spring-security-oauth.xsd">
+
+    <!-- Steps of OAuth 1.0
+        POST /oauth/request_token?oauth_consumer_key&oauth_callback (returns unauthorized token)
+        GET /oauth/confirm_access?oauth_token (returns secure authorization form)
+        (User) POST /oauth/authorize?requestToken&callbackUrl (authorizes oauth token, redirect to callbackUrl)
+        POST /oauth/access_token?oauth_consumer_key&oauth_token&oauth_verifier
+     -->
+
+    <!-- Spring Security OAuth 1.0 Provider Configuration -->
+    <oauth:provider
+        consumer-details-service-ref="oauthConsumerDetails"
+        token-services-ref="oauthProviderTokenServices"
+        request-token-url="/oauth/request_token"
+        authenticate-token-url="/oauth/authorize"
+        authentication-failed-url="/oauth/confirm_access"
+        access-token-url="/oauth/access_token"
+        require10a="false" />
+
+    <!-- ConsumerDetailsService that constructs ConsumerDetails objects from Apps loaded by App Dao. -->
+    <bean id="oauthConsumerDetails"
+          autowire="byName"
+          class="org.encuestame.business.security.oauth.EnMeConsumerDetailsService" />
+
+    <!-- OAuthProviderTokenServices that uses a OAuthSessionManager to manage OAuthSession storage -->
+    <bean id="oauthProviderTokenServices"
+          autowire="byName"
+          class="org.encuestame.business.security.oauth.EnMeOAuthSessionManagerProviderTokenService">
+    </bean>
+
+    <!-- Stores OAuthSessions in a ConcurrentMap with soft values and 2 minutes time idle -->
+    <bean id="oauthSessionManager"
+          autowire="byName"
+          class="org.encuestame.business.security.oauth.ConcurrentMapOAuthSessionManager" />
+
+    <!-- Sends a UNAUTHORIZED response back to clients attempting to access protected resources but who have not yet authenticated via OAuth -->
+    <bean id="oauthAuthenticationEntryPoint" autowire="byName"
+        class="org.springframework.security.oauth.provider.OAuthProcessingFilterEntryPoint">
+        <property name="realmName" value="encuestame" />
+    </bean>
+
+</beans>

encuestame-business/src/main/resources/spring-test/encuestame-service-context.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+       http://www.springframework.org/schema/context
+       http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+  <!-- Message Resources -->
+  <bean id="resourceBundleMessageSource"
+    class="org.springframework.context.support.ResourceBundleMessageSource">
+    <property name="basename">
+      <value>messages</value>
+    </property>
+  </bean>
+
+  <bean id="chartService" class="org.encuestame.business.service.ChartService" parent="abstractchart"/>
+
+  <bean id="abstractchart" class="org.encuestame.business.service.AbstractChartService"
+        abstract="true" parent="service">
+  </bean>
+
+  <bean id="abstractsurvey" class="org.encuestame.business.service.AbstractSurveyService"
+        abstract="true" parent="abstractchart">
+        <property name="twitterService">
+          <ref bean="twitterService" />
+        </property>
+        <property name="tweetPollDao">
+          <ref bean="tweetPollDao" />
+        </property>
+         <property name="hashTagDao">
+          <ref bean="hashTagDao" />
+        </property>
+  </bean>
+
+   <bean id="tweetPollService" class="org.encuestame.business.service.TweetPollService"
+       parent="abstractsurvey">
+       <property name="answerPollPath">
+           <value>${answers.answerPoll}</value>
+       </property>
+       <property name="tweetPollResultsPath">
+           <value>${answers.tweetPollResults}</value>
+       </property>
+       <property name="tweetPath">
+           <value>${answers.tweetPath}/</value>
+       </property>
+       <property name="twitterDomain">
+            <value>${twitter.url.domain}</value>
+       </property>
+   </bean>
+
+    <bean id="abstractConfig" class="org.encuestame.business.service.AbstractBaseService"
+     abstract="true" parent="dataEnMeSource">
+       <property name="domainUrl">
+           <value>${application.domain}</value>
+       </property>
+       <property name="proxyPass">
+           <value>${application.proxyPass}</value>
+       </property>
+       <property name="name">
+            <value>${application.name}</value>
+       </property>
+       <property name="encoding">
+            <value>${application.encoding}</value>
+       </property>
+       <property name="apiKeygoogle">
+            <value>${application.apiKeygoogle}</value>
+       </property>
+     </bean>
+
+  <bean id="service" class="org.encuestame.business.service.AbstractBaseService"
+      abstract="true" parent="abstractConfig">
+      <property name="messageSource">
+          <ref bean="messageSource" />
+      </property>
+      <property name="serviceMail">
+           <ref bean="serviceMail"></ref>
+      </property>
+  </bean>
+
+  <bean id="dataEnMeSource" class="org.encuestame.business.service.AbstractDataSource" abstract="true">
+  </bean>
+
+  <bean id="messageSource"
+    class="org.encuestame.core.util.MessageSourceFactoryBean">
+    <property name="messagesource" ref="resourceBundleMessageSource" />
+  </bean>
+
+  <bean id="servicesManager" class="org.encuestame.business.service.ServiceManager">
+    <property name="applicationServices">
+      <ref bean="applicationServices"></ref>
+    </property>
+    <property name="messageSource">
+          <ref bean="messageSource" />
+    </property>
+  </bean>
+
+  <bean id="twitterService" class="org.encuestame.business.service.social.provider.TwitterService"
+        parent="service">
+    <property name="tinyApi" value="${twitter.tinyUrl}" />
+  </bean>
+
+  <bean id="linkedInService" class="org.encuestame.business.service.social.provider.LinkedInService"
+        parent="service">
+  </bean>
+
+  <bean id="surveyService" class="org.encuestame.business.service.SurveyService"
+    parent="abstractsurvey">
+  </bean>
+
+  <bean id="securityService" class="org.encuestame.business.service.SecurityService"
+    parent="service">
+    <property name="suspendedNotification">
+      <value>${sec.suspendedNotification}</value>
+    </property>
+  </bean>
+
+  <bean id="frontEndService" class="org.encuestame.business.service.FrontEndService" parent="service"/>
+
+  <bean id="pollService" class="org.encuestame.business.service.PollService" parent="abstractsurvey"/>
+
+  <bean id="projectService" class="org.encuestame.business.service.ProjectService" parent="service"/>
+
+  <bean id="locationService" class="org.encuestame.business.service.LocationService" parent="service"/>
+
+  <bean id="pictureService" class="org.encuestame.business.service.PictureService" parent="service"/>
+
+  <bean id="applicationServices" class="org.encuestame.business.service.ApplicationServices" parent="service">
+    <property name="securityService">
+      <ref bean="securityService"></ref>
+    </property>
+    <property name="surveyService">
+        <ref bean="surveyService"></ref>
+    </property>
+    <property name="pollService">
+        <ref bean="pollService"></ref>
+    </property>
+    <property name="tweetPollService">
+         <ref bean="tweetPollService"></ref>
+    </property>
+    <property name="locationService">
+         <ref bean="locationService"></ref>
+    </property>
+     <property name="projectService">
+         <ref bean="projectService"></ref>
+    </property>
+    <property name="chartService">
+         <ref bean="chartService"></ref>
+    </property>
+    <property name="frontEndService">
+         <ref bean="frontEndService"/>
+    </property>
+    <property name="pictureService">
+         <ref bean="pictureService"/>
+    </property>
+  </bean>
+
+  <bean id="serviceMail" class="org.encuestame.business.mail.MailServiceImpl"  parent="service">
+      <property name="mailSender" ref="mailSender" />
+      <property name="templateMessage" ref="templateMessage" />
+      <property name="noEmailResponse" value="${mail.noresponse}" />
+      <property name="velocityEngine" ref="velocityEngine"/>
+  </bean>
+
+  <!--
+        Social Accounts Beans
+        This beans provide next features:
+        * Facebook Connect
+        * Twitter Connect
+        * LinkedIn Connect
+        Future
+        * TripIt
+  -->
+
+     <bean id="abstractSocialProvider" class="org.encuestame.business.service.social.connect.AbstractSocialProvider"
+          abstract="true">
+    </bean>
+
+    <!-- Twitter Service Provider Consumer -->
+    <bean id="twitterServiceConnect" autowire="byName"
+          class="org.encuestame.business.service.social.connect.TwitterSocialService" parent="abstractSocialProvider">
+    </bean>
+
+    <!-- Facebook OAuth Consumer -->
+    <bean id="facebookServiceConnect" autowire="byName"
+          class="org.encuestame.business.service.social.connect.FacebookSocialService"
+          parent="abstractSocialProvider">
+    </bean>
+
+    <!-- LinkedIn OAuth Consumer
+    <bean id="linkedInServiceConnect" autowire="byName"
+          class="org.encuestame.business.service.social.connect.LinkedInSocialService"
+          parent="abstractSocialProvider">
+    </bean>
+    -->
+
+  <bean id="applicationStartup" class="org.encuestame.business.setup.ApplicationStartup"/>
+
+
+</beans>

encuestame-business/src/test/java/org/encuestame/test/business/service/config/AbstractServiceBase.java

  * @version Id:
  */
 @ContextConfiguration(locations = {
-        "classpath:encuestame-email-context.xml",
-        "classpath:encuestame-security-context.xml",
-        "classpath:encuestame-service-context.xml",
-        "classpath:encuestame-integration.xml"
+        "classpath:spring-test/encuestame-email-context.xml",
+        "classpath:spring-test/encuestame-security-context.xml",
+        "classpath:spring-test/encuestame-service-context.xml",
+        "classpath:spring-test/encuestame-integration.xml"
          })
 public class AbstractServiceBase extends AbstractBaseUnitBeans{
 

encuestame-business/src/test/resources/encuestame-report-context.xml

-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
-</beans>

encuestame-business/src/test/resources/encuestame-security-context.xml

-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:security="http://www.springframework.org/schema/security"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-       http://www.springframework.org/schema/security
-       http://www.springframework.org/schema/security/spring-security-3.0.xsd">
-
-  <!-- To enable @Pre and @Post Annotations -->
-  <security:global-method-security pre-post-annotations="enabled"/>
-
-  <!-- Authentication Manager -->
-  <security:authentication-manager alias="authenticationManager">
-    <security:authentication-provider  user-service-ref="enMeAuthenticationDao">
-        <security:password-encoder ref="passwordEncoder" />
-    </security:authentication-provider>
-  </security:authentication-manager>
-
-  <bean id="passwordEncoder" class="org.jasypt.spring.security3.PasswordEncoder">
-    <property name="passwordEncryptor">
-      <ref bean="jasyptPasswordEncryptor" />
-    </property>
-  </bean>
-
-  <bean id="jasyptPasswordEncryptor" class="org.jasypt.util.password.StrongPasswordEncryptor" />
-
-
-  <bean id="enMeAuthenticationDao" class="org.encuestame.core.security.EnMeUserServiceImp">
-    <property name="roleGroupAuth" value="${spring.sec.roleByGroup}" />
-    <property name="roleUserAuth" value="${spring.sec.roleByAuthor}" />
-  </bean>
-
-  <bean id="authenticationEntryPoint"
-    class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
-    <property name="loginFormUrl" value="${spring.sec.loginPath}" />
-    <property name="forceHttps" value="${spring.sec.forceLoginSSL}" />
-  </bean>
-
-  <security:http auto-config="false"
-                 entry-point-ref="authenticationEntryPoint"
-                 access-decision-manager-ref="voteAccessDecisionManager"
-                 access-denied-page="${spring.sec.login.denied}">
-    <security:intercept-url pattern="index.jsp" filters="none" />
-
-    <!-- Public Paths -->
-    <security:intercept-url pattern="/index.jspx" filters="none"/>
-    <security:intercept-url pattern="/error.jspx" filters="none"/>
-    <security:intercept-url pattern="/home" filters="none"/>
-    <security:intercept-url pattern="/users.jspx" filters="none"/>
-    <security:intercept-url pattern="/tags.jspx" filters="none"/>
-    <security:intercept-url pattern="/signin.jspx" filters="none"/>
-    <security:intercept-url pattern="/forgot.jspx" filters="none"/>
-    <security:intercept-url pattern="/signup.jspx" filters="none"/>
-
-    <!-- Admon Paths -->
-    <security:intercept-url pattern="/admon/**/*" access="ENCUESTAME_ADMIN, ENCUESTAME_USER"/>
-
-    <!-- Account Paths
-    <security:intercept-url pattern="/user/signin.jspx" access="ENCUESTAME_ANONYMOUS"/>
-    <security:intercept-url pattern="/user/forgot.jspx" access="ENCUESTAME_ANONYMOUS" />
-    <security:intercept-url pattern="/user/signup.jspx" access="ENCUESTAME_ANONYMOUS"/>
-    -->
-
-    <security:intercept-url pattern="/user/logout" access="ENCUESTAME_USER"/>
-
-    <!-- Super Admin -->
-    <security:intercept-url pattern="/superAdmin.jspx" access="ENCUESTAME_SUPER"/>
-
-    <!-- Shared areas -->
-    <security:intercept-url pattern="/settings/**/*" access="ENCUESTAME_USER"/>
-
-    <!-- Surveys / Poll / TweetPoll Paths -->
-    <security:intercept-url pattern="/tweetpoll.jspx" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"   />
-    <security:intercept-url pattern="/poll.jspx" access="ENCUESTAME_USER"/>
-    <security:intercept-url pattern="/survey.jspx" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"/>
-
-    <!-- Vote Paths
-    <security:intercept-url pattern="/tweet/*" access="ENCUESTAME_USER" />
-    -->
-
-    <!-- Resources Path -->
-    <security:intercept-url pattern="/resources/*"  filters="none" />
-
-    <security:remember-me key="${spring.sec.rememberMe.key}" services-alias="_rememberMeServices" token-validity-seconds="10080"/>
-    <security:anonymous enabled="true" granted-authority="ENCUESTAME_ANONYMOUS" key="${spring.sec.anonymous.key}" />
-    <security:logout logout-success-url="${spring.sec.logout.sucess}" invalidate-session="true"
-                     logout-url="${spring.sec.logout.url}"/>
-    <security:custom-filter position="FORM_LOGIN_FILTER" ref="authenticationProcessingFilter" />
-  </security:http>
-
-  <!--  Enable OAuth Security.
-  <import resource="encuestame-security-oauth-context.xml"/>
-    -->
-
-  <bean id="authenticationProcessingFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
-      <property name="authenticationManager" ref="authenticationManager"/>
-      <property name="authenticationFailureHandler" ref="authenticationFailureHandler"/>
-      <property name="authenticationSuccessHandler" ref="authenticationSuccessHandler"/>
-      <property name="filterProcessesUrl" value="/j_spring_security_check"/>
-  </bean>
-
-   <bean id="authenticationSuccessHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler">
-       <property name="defaultTargetUrl" value="${spring.sec.defaultLoginUrl}"/>
-   </bean>
-
-   <bean id="authenticationFailureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
-       <property name="defaultFailureUrl" value="${spring.sec.login.error}"/>
-   </bean>
-
-  <bean id="voteAccessDecisionManager"
-    class="org.springframework.security.access.vote.AffirmativeBased">
-    <property name="allowIfAllAbstainDecisions">
-      <value>false</value>
-    </property>
-    <property name="decisionVoters">
-      <list>
-        <ref bean="roleVoter" />
-      </list>
-    </property>
-  </bean>
-
-  <bean id="roleVoter" class="org.encuestame.core.security.EnMeRoleVoter">
-    <property name="rolePrefix" value="${spring.sec.role.prefix}" />
-  </bean>
-
-  <!--  reCaptcha -->
-
-   <bean id="reCaptcha" class="net.tanesha.recaptcha.ReCaptchaImpl" scope="singleton">
-        <property name="privateKey" value="6LdyFwUAAAAAAGB3BsjX-j5EgYzULsR3ftiUvwUd" />
-        <property name="publicKey" value="6LdyFwUAAAAAAP6p1IeqUM7uMKUYyPazw-haEAUU" />
-        <property name="recaptchaServer" value="${encuestame.recaptcha.recaptchaserver}" />
-        <property name="includeNoscript" value="${encuestame.recaptcha.includenoscript}" />
-   </bean>
-
-</beans>

encuestame-business/src/test/resources/encuestame-security-oauth-context.xml

-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-    xmlns:oauth="http://www.springframework.org/schema/security/oauth"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-        http://www.springframework.org/schema/security/oauth
-        http://www.springframework.org/schema/security/spring-security-oauth.xsd">
-
-    <!-- Steps of OAuth 1.0
-        POST /oauth/request_token?oauth_consumer_key&oauth_callback (returns unauthorized token)
-        GET /oauth/confirm_access?oauth_token (returns secure authorization form)
-        (User) POST /oauth/authorize?requestToken&callbackUrl (authorizes oauth token, redirect to callbackUrl)
-        POST /oauth/access_token?oauth_consumer_key&oauth_token&oauth_verifier
-     -->
-
-    <!-- Spring Security OAuth 1.0 Provider Configuration -->
-    <oauth:provider
-        consumer-details-service-ref="oauthConsumerDetails"
-        token-services-ref="oauthProviderTokenServices"
-        request-token-url="/oauth/request_token"
-        authenticate-token-url="/oauth/authorize"
-        authentication-failed-url="/oauth/confirm_access"
-        access-token-url="/oauth/access_token"
-        require10a="false" />
-
-    <!-- ConsumerDetailsService that constructs ConsumerDetails objects from Apps loaded by App Dao. -->
-    <bean id="oauthConsumerDetails"
-          autowire="byName"
-          class="org.encuestame.business.security.oauth.EnMeConsumerDetailsService" />
-
-    <!-- OAuthProviderTokenServices that uses a OAuthSessionManager to manage OAuthSession storage -->
-    <bean id="oauthProviderTokenServices"
-          autowire="byName"
-          class="org.encuestame.business.security.oauth.EnMeOAuthSessionManagerProviderTokenService">
-    </bean>
-
-    <!-- Stores OAuthSessions in a ConcurrentMap with soft values and 2 minutes time idle -->
-    <bean id="oauthSessionManager"
-          autowire="byName"
-          class="org.encuestame.business.security.oauth.ConcurrentMapOAuthSessionManager" />
-
-    <!-- Sends a UNAUTHORIZED response back to clients attempting to access protected resources but who have not yet authenticated via OAuth -->
-    <bean id="oauthAuthenticationEntryPoint" autowire="byName"
-        class="org.springframework.security.oauth.provider.OAuthProcessingFilterEntryPoint">
-        <property name="realmName" value="encuestame" />
-    </bean>
-
-</beans>

encuestame-business/src/test/resources/encuestame-service-context.xml

-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xmlns:context="http://www.springframework.org/schema/context"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
-       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-       http://www.springframework.org/schema/context
-       http://www.springframework.org/schema/context/spring-context-3.0.xsd">
-
-  <!-- Message Resources -->
-  <bean id="resourceBundleMessageSource"
-    class="org.springframework.context.support.ResourceBundleMessageSource">
-    <property name="basename">
-      <value>messages</value>
-    </property>
-  </bean>
-
-  <bean id="chartService" class="org.encuestame.business.service.ChartService" parent="abstractchart"/>
-
-  <bean id="abstractchart" class="org.encuestame.business.service.AbstractChartService"
-        abstract="true" parent="service">
-  </bean>
-
-  <bean id="abstractsurvey" class="org.encuestame.business.service.AbstractSurveyService"
-        abstract="true" parent="abstractchart">
-        <property name="twitterService">
-          <ref bean="twitterService" />
-        </property>
-        <property name="tweetPollDao">
-          <ref bean="tweetPollDao" />
-        </property>
-         <property name="hashTagDao">
-          <ref bean="hashTagDao" />
-        </property>
-  </bean>
-
-   <bean id="tweetPollService" class="org.encuestame.business.service.TweetPollService"
-       parent="abstractsurvey">
-       <property name="answerPollPath">
-           <value>${answers.answerPoll}</value>
-       </property>
-       <property name="tweetPollResultsPath">
-           <value>${answers.tweetPollResults}</value>
-       </property>
-       <property name="tweetPath">
-           <value>${answers.tweetPath}/</value>
-       </property>
-       <property name="twitterDomain">
-            <value>${twitter.url.domain}</value>
-       </property>
-   </bean>
-
-    <bean id="abstractConfig" class="org.encuestame.business.service.AbstractBaseService"
-     abstract="true" parent="dataEnMeSource">
-       <property name="domainUrl">
-           <value>${application.domain}</value>
-       </property>
-       <property name="proxyPass">
-           <value>${application.proxyPass}</value>
-       </property>
-       <property name="name">
-            <value>${application.name}</value>
-       </property>
-       <property name="encoding">
-            <value>${application.encoding}</value>
-       </property>
-       <property name="apiKeygoogle">
-            <value>${application.apiKeygoogle}</value>
-       </property>
-     </bean>
-
-  <bean id="service" class="org.encuestame.business.service.AbstractBaseService"
-      abstract="true" parent="abstractConfig">
-      <property name="messageSource">
-          <ref bean="messageSource" />
-      </property>
-      <property name="serviceMail">
-           <ref bean="serviceMail"></ref>
-      </property>
-  </bean>
-
-  <bean id="dataEnMeSource" class="org.encuestame.business.service.AbstractDataSource" abstract="true">
-  </bean>
-
-  <bean id="messageSource"
-    class="org.encuestame.core.util.MessageSourceFactoryBean">
-    <property name="messagesource" ref="resourceBundleMessageSource" />
-  </bean>
-
-  <bean id="servicesManager" class="org.encuestame.business.service.ServiceManager">
-    <property name="applicationServices">
-      <ref bean="applicationServices"></ref>
-    </property>
-    <property name="messageSource">
-          <ref bean="messageSource" />
-    </property>
-  </bean>
-
-  <bean id="twitterService" class="org.encuestame.business.service.social.provider.TwitterService"
-        parent="service">
-    <property name="tinyApi" value="${twitter.tinyUrl}" />
-  </bean>
-
-  <bean id="linkedInService" class="org.encuestame.business.service.social.provider.LinkedInService"
-        parent="service">
-  </bean>
-
-  <bean id="surveyService" class="org.encuestame.business.service.SurveyService"
-    parent="abstractsurvey">
-  </bean>
-
-  <bean id="securityService" class="org.encuestame.business.service.SecurityService"
-    parent="service">
-    <property name="suspendedNotification">
-      <value>${sec.suspendedNotification}</value>
-    </property>
-  </bean>
-
-  <bean id="frontEndService" class="org.encuestame.business.service.FrontEndService" parent="service"/>
-
-  <bean id="pollService" class="org.encuestame.business.service.PollService" parent="abstractsurvey"/>
-
-  <bean id="projectService" class="org.encuestame.business.service.ProjectService" parent="service"/>
-
-  <bean id="locationService" class="org.encuestame.business.service.LocationService" parent="service"/>
-
-  <bean id="pictureService" class="org.encuestame.business.service.PictureService" parent="service"/>
-
-  <bean id="applicationServices" class="org.encuestame.business.service.ApplicationServices" parent="service">
-    <property name="securityService">
-      <ref bean="securityService"></ref>
-    </property>
-    <property name="surveyService">
-        <ref bean="surveyService"></ref>
-    </property>
-    <property name="pollService">
-        <ref bean="pollService"></ref>
-    </property>
-    <property name="tweetPollService">
-         <ref bean="tweetPollService"></ref>
-    </property>
-    <property name="locationService">
-         <ref bean="locationService"></ref>
-    </property>
-     <property name="projectService">
-         <ref bean="projectService"></ref>
-    </property>
-    <property name="chartService">
-         <ref bean="chartService"></ref>
-    </property>
-    <property name="frontEndService">
-         <ref bean="frontEndService"/>
-    </property>
-    <property name="pictureService">
-         <ref bean="pictureService"/>
-    </property>
-  </bean>
-
-  <bean id="serviceMail" class="org.encuestame.business.mail.MailServiceImpl"  parent="service">
-      <property name="mailSender" ref="mailSender" />
-      <property name="templateMessage" ref="templateMessage" />
-      <property name="noEmailResponse" value="${mail.noresponse}" />
-      <property name="velocityEngine" ref="velocityEngine"/>
-  </bean>
-
-  <!--
-        Social Accounts Beans
-        This beans provide next features:
-        * Facebook Connect
-        * Twitter Connect
-        * LinkedIn Connect
-        Future
-        * TripIt
-  -->
-
-     <bean id="abstractSocialProvider" class="org.encuestame.business.service.social.connect.AbstractSocialProvider"
-          abstract="true">
-    </bean>
-
-    <!-- Twitter Service Provider Consumer -->
-    <bean id="twitterServiceConnect" autowire="byName"
-          class="org.encuestame.business.service.social.connect.TwitterSocialService" parent="abstractSocialProvider">
-    </bean>
-
-    <!-- Facebook OAuth Consumer -->
-    <bean id="facebookServiceConnect" autowire="byName"
-          class="org.encuestame.business.service.social.connect.FacebookSocialService"
-          parent="abstractSocialProvider">
-    </bean>
-
-    <!-- LinkedIn OAuth Consumer
-    <bean id="linkedInServiceConnect" autowire="byName"
-          class="org.encuestame.business.service.social.connect.LinkedInSocialService"
-          parent="abstractSocialProvider">
-    </bean>
-    -->
-
-  <bean id="applicationStartup" class="org.encuestame.business.setup.ApplicationStartup"/>
-
-
-</beans>

encuestame-core/pom.xml

             <resource>
               <directory>src/main/resources/</directory>
               <includes>
-                <include>*.*</include>
+                 <include>spring-test/*.*</include>
+                 <include>properties-test/*.*</include>
               </includes>
               <filtering>true</filtering>
             </resource>

encuestame-core/src/main/resources/spring-test/TwitterSearch-context.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
+		http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
+		http://www.springframework.org/schema/integration/twitter http://www.springframework.org/schema/integration/twitter/spring-integration-twitter-2.0.xsd"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:int="http://www.springframework.org/schema/integration"
+	xmlns:int-twitter="http://www.springframework.org/schema/integration/twitter">
+	
+	<context:property-placeholder location="classpath:oauth.properties"/>
+
+	<bean id="twitterTemplate"
+		class="org.springframework.integration.twitter.core.Twitter4jTemplate">
+		<constructor-arg value="${twitter.oauth.consumerKey}" />
+		<constructor-arg value="${twitter.oauth.consumerSecret}" />
+		<constructor-arg value="${twitter.oauth.accessToken}" />
+		<constructor-arg value="${twitter.oauth.accessTokenSecret}" />
+	</bean>
+	
+	<int-twitter:search-inbound-channel-adapter id="searchAdapter" channel="sourceExtractor" query="#springintegration">
+    	<int:poller fixed-rate="3000" max-messages-per-poll="5" />
+    </int-twitter:search-inbound-channel-adapter>
+   
+	<int:transformer input-channel="sourceExtractor" output-channel="twitterOut" expression="payload.getText()"/>
+	
+	<int:logging-channel-adapter id="twitterOut"/>
+</beans>

encuestame-core/src/main/resources/spring-test/TwitterSendUpdates-context.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
+        http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
+        http://www.springframework.org/schema/integration/twitter http://www.springframework.org/schema/integration/twitter/spring-integration-twitter-2.0.xsd"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:i="http://www.springframework.org/schema/integration"
+    xmlns:twitter="http://www.springframework.org/schema/integration/twitter">
+
+    <context:property-placeholder location="classpath:properties-test/twitter-config.properties"/>
+
+
+    <bean id="twitterTemplate"
+        class="org.springframework.integration.twitter.core.Twitter4jTemplate">
+        <constructor-arg value="${twitter.oauth.consumerKey}" />
+        <constructor-arg value="${twitter.oauth.consumerSecret}" />
+        <constructor-arg value="${twitter.oauth.accessToken}" />
+        <constructor-arg value="${twitter.oauth.accessTokenSecret}" />
+    </bean>
+
+    <bean id="twitterRejector" class="org.encuestame.core.integration.TwitterMessageSelector"></bean>
+
+    <i:channel id="twitterChannel" />
+
+    <i:transformer id="tinyUrlTransformer" ref="tinyUrlTransformerBean"
+        input-channel="twitterChannel" method="transform" output-channel="twitterTransformedChannel" />
+
+    <bean id="tinyUrlTransformerBean"
+        class="org.encuestame.core.integration.transformer.TinyUrlTransformer" />
+
+    <i:channel id="twitterTransformedChannel">
+        <i:queue capacity="25" />
+    </i:channel>
+
+    <twitter:outbound-channel-adapter id="twitterAdapter"
+        twitter-template="twitterTemplate" channel="twitterChannel" />
+        <i:poller max-messages-per-poll="1" id="defaultPoller"
+        default="true">
+        <i:interval-trigger interval="30000" />
+    </i:poller>
+
+    <i:channel id="errorChannel">
+         <i:queue capacity="500"/>
+    </i:channel>
+
+</beans>

encuestame-core/src/main/resources/spring-test/TwitterTimelineUpdates-context.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
+		http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-2.0.xsd
+		http://www.springframework.org/schema/integration/twitter http://www.springframework.org/schema/integration/twitter/spring-integration-twitter-2.0.xsd"
+	xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:int="http://www.springframework.org/schema/integration"
+	xmlns:int-twitter="http://www.springframework.org/schema/integration/twitter">
+	
+	<context:property-placeholder location="classpath:oauth.properties"/>
+
+	<bean id="twitterTemplate"
+		class="org.springframework.integration.twitter.core.Twitter4jTemplate">
+		<constructor-arg value="${twitter.oauth.consumerKey}" />
+		<constructor-arg value="${twitter.oauth.consumerSecret}" />
+		<constructor-arg value="${twitter.oauth.accessToken}" />
+		<constructor-arg value="${twitter.oauth.accessTokenSecret}" />
+	</bean>
+	
+	<int-twitter:inbound-channel-adapter id="twitterInbound"
+		twitter-template="twitterTemplate" channel="sourceExtractor">
+		<int:poller fixed-rate="1000" max-messages-per-poll="3" />
+	</int-twitter:inbound-channel-adapter>
+	
+	<int:transformer input-channel="sourceExtractor" output-channel="twitterOut" expression="payload.getText()"/>
+	
+	<int:logging-channel-adapter id="twitterOut"/>
+</beans>

encuestame-core/src/main/resources/spring-test/encuestame-email-context.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+    <bean id="mailSender" scope="singleton"
+        class="org.springframework.mail.javamail.JavaMailSenderImpl">
+        <property name="host" value="${mail.host}" />
+        <property name="port" value="${mail.port}" />
+        <property name="protocol" value="${mail.protocol}" />
+        <property name="username" value="${mail.username}" />
+        <property name="password" value="${mail.password}" />
+        <property name="defaultEncoding" value="UTF-8" />
+        <property name="javaMailProperties">
+            <props>
+                <prop key="mail.smtps.auth">true</prop>
+                <prop key="mail.smtps.debug">true</prop>
+                <prop key="mail.smtps.starttls.enable">false</prop>
+            </props>
+        </property>
+    </bean>
+
+  <bean id="templateMessage" class="org.springframework.mail.SimpleMailMessage" />
+
+  <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
+      <property name="velocityProperties">
+         <value>
+            resource.loader=class
+            class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
+         </value>
+      </property>
+   </bean>
+</beans>

encuestame-core/src/main/resources/spring-test/encuestame-integration.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:i="http://www.springframework.org/schema/integration"
+    xmlns:twitter="http://www.springframework.org/schema/integration/twitter"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:file="http://www.springframework.org/schema/integration/file"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+            http://www.springframework.org/schema/beans/spring-beans.xsd
+            http://www.springframework.org/schema/integration
+            http://www.springframework.org/schema/integration/spring-integration.xsd
+            http://www.springframework.org/schema/integration/twitter
+            http://www.springframework.org/schema/integration/twitter/spring-integration-twitter-2.0.xsd
+            http://www.springframework.org/schema/integration/file
+            http://www.springframework.org/schema/integration/file/spring-integration-file-2.0.xsd">
+
+   <i:gateway id="twitterGateway"
+        default-request-channel="actionChannel"
+        service-interface="org.encuestame.core.integration.gateway.TwitterGateway" />
+
+   <i:gateway id="emailGateway" default-request-channel="actionChannel"
+        service-interface="org.encuestame.core.integration.gateway.EmailGateway" />
+
+    <i:channel id="actionChannel">
+        <i:queue capacity="6000"/>
+    </i:channel>
+
+    <i:bridge input-channel="actionChannel" output-channel="twitterChannel" />
+
+    <i:channel id="errorChannel">
+         <i:queue capacity="500"/>
+     </i:channel>
+
+     <!--    <import resource="classpath:encuestame-mail-sender.xml" />-->