Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[tck][whiteboard] TCK doesn't check for Filter name conflict #821

@grgrzybek

Description

@grgrzybek

I'm working on Pax Web TCK compatibility woith OSGi CMPN 8.1 Whiteboard specification.

When testing org.osgi.test.cases.servlet.junit.HttpServiceRuntimeTestCase#test_140_9_RequestInfoDTO_filters() I found this assertion failing:

RequestInfoDTO requestInfoDTO = calculateRequestInfoDTO("/a");
...java
assertEquals(2, requestInfoDTO.filterDTOs.length);

However the two filters registered by this test case are:

properties = new Hashtable<String, Object>();
properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN, "/a");
serviceRegistrations.add(context.registerService(Filter.class, new MockFilter(), properties));

properties = new Hashtable<String, Object>();
properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN, "/*");
serviceRegistrations.add(context.registerService(Filter.class, new MockFilter(), properties));

According to 140.16.2.14 public static final String HTTP_WHITEBOARD_FILTER_NAME = "osgi.http.whiteboard.filter.name":

This name is used as the value for the FilterConfig.getFilterName() method. If this service property is not specified, the fully qualified name of the service object's class is used as the servlet filter name.

Servlet filter names should be unique among all servlet filter services associated with a single ServletContextHelper.

So the latter filter should be invalid and not part of requestInfoDTO

The same happened with org.osgi.test.cases.servlet.junit.PreprocessorTestCase.testPreprocessorRanging, but I realized there's implicit conclusion from OSGi CMPN Whiteboard specification, that name-uniqueness doesn't apply to preprocessors

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions