felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1662128 - in /felix/trunk/http: api/src/main/java/org/osgi/service/http/runtime/dto/ base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/
Date Tue, 24 Feb 2015 22:09:50 GMT
Author: cziegeler
Date: Tue Feb 24 22:09:49 2015
New Revision: 1662128

URL: http://svn.apache.org/r1662128
Log:
FELIX-4060 : Update to latest http whiteboard api : ServletContextDTO.contextName has been
removed

Modified:
    felix/trunk/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java
    felix/trunk/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java

Modified: felix/trunk/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java?rev=1662128&r1=1662127&r2=1662128&view=diff
==============================================================================
--- felix/trunk/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java
(original)
+++ felix/trunk/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java
Tue Feb 24 22:09:49 2015
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -17,6 +17,7 @@
 package org.osgi.service.http.runtime.dto;
 
 import java.util.Map;
+
 import org.osgi.dto.DTO;
 
 /**
@@ -24,31 +25,22 @@ import org.osgi.dto.DTO;
  * resources, servlet Filters, and listeners associated with that servlet
  * context. The Servlet Context is usually backed by a
  * {@link org.osgi.service.http.context.ServletContextHelper} service.
- * 
+ *
  * @NotThreadSafe
  * @author $Id$
  */
 public class ServletContextDTO extends DTO {
 	/**
 	 * The name of the servlet context.
-	 * 
+	 *
 	 * The name of the corresponding
 	 * {@link org.osgi.service.http.context.ServletContextHelper}.
 	 */
 	public String				name;
 
 	/**
-	 * The context name of the servlet context.
-	 * 
-	 * <p>
-	 * This is the value returned by the
-	 * {@code ServletContext.getServletContextName()} method.
-	 */
-	public String				contextName;
-
-	/**
 	 * The servlet context path.
-	 * 
+	 *
 	 * This is the value returned by the {@code ServletContext.getContextPath()}
 	 * method.
 	 */
@@ -64,7 +56,7 @@ public class ServletContextDTO extends D
 
 	/**
 	 * The servlet context attributes.
-	 * 
+	 *
 	 * <p>
 	 * The value type must be a numerical type, {@code Boolean}, {@code String},
 	 * {@code DTO} or an array of any of the former. Therefore this method will
@@ -88,7 +80,7 @@ public class ServletContextDTO extends D
 	/**
 	 * Returns the representations of the {@code Servlet} services associated
 	 * with this context.
-	 * 
+	 *
 	 * The representations of the {@code Servlet} services associated with this
 	 * context. The returned array may be empty if this context is currently not
 	 * associated with any {@code Servlet} services.
@@ -98,7 +90,7 @@ public class ServletContextDTO extends D
 	/**
 	 * Returns the representations of the resource services associated with this
 	 * context.
-	 * 
+	 *
 	 * The representations of the resource services associated with this
 	 * context. The returned array may be empty if this context is currently not
 	 * associated with any resource services.
@@ -108,7 +100,7 @@ public class ServletContextDTO extends D
 	/**
 	 * Returns the representations of the servlet {@code Filter} services
 	 * associated with this context.
-	 * 
+	 *
 	 * The representations of the servlet {@code Filter} services associated
 	 * with this context. The returned array may be empty if this context is
 	 * currently not associated with any servlet {@code Filter} services.
@@ -118,7 +110,7 @@ public class ServletContextDTO extends D
 	/**
 	 * Returns the representations of the error page {@code Servlet} services
 	 * associated with this context.
-	 * 
+	 *
 	 * The representations of the error page {@code Servlet} services associated
 	 * with this context. The returned array may be empty if this context is
 	 * currently not associated with any error pages.
@@ -128,7 +120,7 @@ public class ServletContextDTO extends D
 	/**
 	 * Returns the representations of the listener services associated with this
 	 * context.
-	 * 
+	 *
 	 * The representations of the listener services associated with this
 	 * context. The returned array may be empty if this context is currently not
 	 * associated with any listener services.

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java?rev=1662128&r1=1662127&r2=1662128&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java
Tue Feb 24 22:09:49 2015
@@ -79,13 +79,12 @@ final class ServletContextDTOBuilder
 
         ServletContextDTO contextDTO = new ServletContextDTO();
         contextDTO.attributes = getAttributes(context);
-        contextDTO.contextName = context.getServletContextName();
         contextDTO.contextPath = context.getContextPath();
         contextDTO.errorPageDTOs = errorPageDTOs;
         contextDTO.filterDTOs = filterDTOs;
         contextDTO.initParams = getInitParameters(context);
         contextDTO.listenerDTOs = listenerDTOs;
-        contextDTO.name = contextId >= 0 ? contextInfo.getName() : null;
+        contextDTO.name = context.getServletContextName();
         contextDTO.resourceDTOs = resourceDTOs;
         contextDTO.servletDTOs = servletDTOs;
         contextDTO.serviceId = contextId;

Modified: felix/trunk/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java?rev=1662128&r1=1662127&r2=1662128&view=diff
==============================================================================
--- felix/trunk/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java
(original)
+++ felix/trunk/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java
Tue Feb 24 22:09:49 2015
@@ -34,7 +34,6 @@ import static org.apache.felix.http.base
 import static org.apache.felix.http.base.internal.runtime.WhiteboardServiceHelper.createTestServletWithServiceId;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -59,9 +58,9 @@ import javax.servlet.ServletContext;
 import org.apache.felix.http.base.internal.context.ExtServletContext;
 import org.apache.felix.http.base.internal.handler.FilterHandler;
 import org.apache.felix.http.base.internal.handler.ServletHandler;
+import org.apache.felix.http.base.internal.runtime.FilterInfo;
 import org.apache.felix.http.base.internal.runtime.HandlerRuntime;
 import org.apache.felix.http.base.internal.runtime.HandlerRuntime.ErrorPage;
-import org.apache.felix.http.base.internal.runtime.FilterInfo;
 import org.apache.felix.http.base.internal.runtime.RegistryRuntime;
 import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo;
 import org.apache.felix.http.base.internal.runtime.ServletInfo;
@@ -233,12 +232,10 @@ public class RuntimeDTOBuilderTest
 
         for (ServletContextDTO servletContextDTO : runtimeDTO.servletContextDTOs)
         {
-            String contextName = servletContextDTO.contextName;
+            String contextName = servletContextDTO.name;
             assertTrue(CONTEXT_NAMES.contains(contextName));
             if (contextName.equals("0"))
             {
-                assertNull(contextName,
-                        servletContextDTO.name);
                 assertTrue(contextName,
                         servletContextDTO.serviceId < 0);
                 assertEquals(contextName,
@@ -252,9 +249,6 @@ public class RuntimeDTOBuilderTest
             }
             else
             {
-                assertEquals(contextName,
-                        contextName, servletContextDTO.name);
-
                 int expectedId = CONTEXT_NAMES.indexOf(contextName) + 1;
                 assertEquals(contextName,
                         expectedId, servletContextDTO.serviceId);



Mime
View raw message