[kune-commits] r1815 - in trunk/src: main/java/cc/kune/common/client/actions/gwtui test/java/cc/kune/core/server test/java/cc/kune/core/server/integration

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sun Apr 1 12:43:49 CEST 2012


Author: vjrj_
Date: 2012-04-01 12:43:49 +0200 (Sun, 01 Apr 2012)
New Revision: 1815

Removed:
   trunk/src/test/java/cc/kune/core/server/integration/HttpServletRequestMocked.java
Modified:
   trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java
   trunk/src/test/java/cc/kune/core/server/TestHelper.java
   trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
Log:
Fix some compilation error

Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java	2012-04-01 02:50:08 UTC (rev 1814)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java	2012-04-01 10:43:49 UTC (rev 1815)
@@ -19,13 +19,11 @@
  */
 package cc.kune.common.client.actions.gwtui;
 
-import cc.kune.common.client.actions.Action;
 import cc.kune.common.client.actions.ActionEvent;
 import cc.kune.common.client.actions.ui.AbstractChildGuiItem;
 import cc.kune.common.client.actions.ui.AbstractGuiItem;
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.common.client.log.Log;
 import cc.kune.common.client.tooltip.Tooltip;
 import cc.kune.common.client.ui.IconLabel;
 
@@ -113,8 +111,9 @@
 
   @Override
   public void setEnabled(final boolean enabled) {
-    Log.info("Set button" + descriptor.getValue(Action.NAME) + " enabled " + enabled
-        + " ----------------------------------");
+    // Log.info("Set button" + descriptor.getValue(Action.NAME) + " enabled " +
+    // enabled
+    // + " ----------------------------------");
     button.setEnabled(enabled);
     button.getElement().getStyle().setOpacity(enabled ? 1d : 0.6d);
   }

Modified: trunk/src/test/java/cc/kune/core/server/TestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/TestHelper.java	2012-04-01 02:50:08 UTC (rev 1814)
+++ trunk/src/test/java/cc/kune/core/server/TestHelper.java	2012-04-01 10:43:49 UTC (rev 1815)
@@ -22,6 +22,7 @@
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.configuration.ConfigurationException;
+import org.mockito.Mockito;
 import org.waveprotocol.box.server.CoreSettings;
 import org.waveprotocol.box.server.ServerModule;
 import org.waveprotocol.box.server.authentication.AccountStoreHolder;
@@ -35,7 +36,6 @@
 
 import cc.kune.barters.server.BarterServerModule;
 import cc.kune.chat.server.ChatServerModule;
-import cc.kune.core.server.integration.HttpServletRequestMocked;
 import cc.kune.core.server.persist.DataSourceKunePersistModule;
 import cc.kune.core.server.persist.DataSourceOpenfirePersistModule;
 import cc.kune.docs.server.DocumentServerModule;
@@ -68,9 +68,9 @@
           "kune.properties", TestConstants.PERSISTENCE_UNIT);
       final Injector childInjector = injector.createChildInjector(wavePersistModule, new ServerModule(
           false, 1, 2, 2), new RobotApiModule(), federationModule, new ListsServerModule(),
-          new DocumentServerModule(), new ChatServerModule(), federationModule,
-          new WikiServerModule(), new TaskServerModule(), new BarterServerModule(),
-          new EventsServerModule(), new TrashServerModule(), kuneDataSource,
+          new DocumentServerModule(), new ChatServerModule(), federationModule, new WikiServerModule(),
+          new TaskServerModule(), new BarterServerModule(), new EventsServerModule(),
+          new TrashServerModule(), kuneDataSource,
           new DataSourceOpenfirePersistModule(kuneDataSource.getKuneProperties()), module, new Module() {
             @Override
             public void configure(final Binder binder) {
@@ -78,7 +78,8 @@
               binder.bindScope(RequestScoped.class, Scopes.SINGLETON);
               // binder.bind(KuneProperties.class).toInstance(new
               // KunePropertiesDefault(propetiesFileName));
-              binder.bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
+              // Used by I18nRPC to detect user lang
+              binder.bind(HttpServletRequest.class).toInstance(Mockito.mock(HttpServletRequest.class));
             }
           });
       try {

Deleted: trunk/src/test/java/cc/kune/core/server/integration/HttpServletRequestMocked.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/HttpServletRequestMocked.java	2012-04-01 02:50:08 UTC (rev 1814)
+++ trunk/src/test/java/cc/kune/core/server/integration/HttpServletRequestMocked.java	2012-04-01 10:43:49 UTC (rev 1815)
@@ -1,444 +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.integration;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.servlet.AsyncContext;
-import javax.servlet.DispatcherType;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletInputStream;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.Part;
-
-public class HttpServletRequestMocked implements HttpServletRequest {
-
-  @Override
-  public boolean authenticate(final HttpServletResponse arg0) throws IOException, ServletException {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public AsyncContext getAsyncContext() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Object getAttribute(final String arg0) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Enumeration<String> getAttributeNames() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getAuthType() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getCharacterEncoding() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public int getContentLength() {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public String getContentType() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getContextPath() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Cookie[] getCookies() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public long getDateHeader(final String arg0) {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public DispatcherType getDispatcherType() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getHeader(final String arg0) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Enumeration<String> getHeaderNames() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Enumeration<String> getHeaders(final String arg0) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public ServletInputStream getInputStream() throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public int getIntHeader(final String arg0) {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public String getLocalAddr() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Locale getLocale() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Enumeration<Locale> getLocales() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getLocalName() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public int getLocalPort() {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public String getMethod() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getParameter(final String arg0) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Map<String, String[]> getParameterMap() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Enumeration<String> getParameterNames() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String[] getParameterValues(final String arg0) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Part getPart(final String arg0) throws IOException, ServletException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Collection<Part> getParts() throws IOException, ServletException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getPathInfo() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getPathTranslated() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getProtocol() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getQueryString() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public BufferedReader getReader() throws IOException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getRealPath(final String arg0) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getRemoteAddr() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getRemoteHost() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public int getRemotePort() {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public String getRemoteUser() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public RequestDispatcher getRequestDispatcher(final String arg0) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getRequestedSessionId() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getRequestURI() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public StringBuffer getRequestURL() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getScheme() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getServerName() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public int getServerPort() {
-    // TODO Auto-generated method stub
-    return 0;
-  }
-
-  @Override
-  public ServletContext getServletContext() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String getServletPath() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public HttpSession getSession() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public HttpSession getSession(final boolean arg0) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Principal getUserPrincipal() {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public boolean isAsyncStarted() {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean isAsyncSupported() {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean isRequestedSessionIdFromCookie() {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean isRequestedSessionIdFromUrl() {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean isRequestedSessionIdFromURL() {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean isRequestedSessionIdValid() {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean isSecure() {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public boolean isUserInRole(final String arg0) {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public void login(final String arg0, final String arg1) throws ServletException {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void logout() throws ServletException {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void removeAttribute(final String arg0) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void setAttribute(final String arg0, final Object arg1) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void setCharacterEncoding(final String arg0) throws UnsupportedEncodingException {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public AsyncContext startAsync() throws IllegalStateException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public AsyncContext startAsync(final ServletRequest arg0, final ServletResponse arg1)
-      throws IllegalStateException {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-}

Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java	2012-04-01 02:50:08 UTC (rev 1814)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java	2012-04-01 10:43:49 UTC (rev 1815)
@@ -25,6 +25,7 @@
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.configuration.ConfigurationException;
+import org.mockito.Mockito;
 import org.waveprotocol.box.server.CoreSettings;
 import org.waveprotocol.box.server.ServerModule;
 import org.waveprotocol.box.server.persistence.PersistenceModule;
@@ -76,8 +77,8 @@
             protected void configure() {
               bindScope(SessionScoped.class, Scopes.SINGLETON);
               bindScope(RequestScoped.class, Scopes.SINGLETON);
-
-              bind(HttpServletRequest.class).to(HttpServletRequestMocked.class);
+              // Used by I18nRPC to detect user lang
+              bind(HttpServletRequest.class).toInstance(Mockito.mock(HttpServletRequest.class));
               bindInterceptor(annotatedWith(KuneTransactional.class), any(),
                   kuneDataSource.getTransactionInterceptor());
               bindInterceptor(any(), annotatedWith(KuneTransactional.class),




More information about the kune-commits mailing list