-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gwc - handles workspace-based paths (#380) #529
gwc - handles workspace-based paths (#380) #529
Conversation
Most of the files from this PR are due to adding a test datadir to src/test/resources in the microservice. Revisiting to have it into a zip file instead. |
aec8946
to
c317285
Compare
New version of the PR which includes a zipped test datadir in the gs-cloud-catalog-plugin module instead of having the 500+ files in src/test/resources. But going through the the geoserver dispatcher instead of the gwc dispatcher makes the regular GWC ui unreachable anymore. Tests are ok because they only test the http return code, which is actually a xml error page with a 200-OK HTTP return code. |
e45d9c9
to
af0a09d
Compare
Adding tests / splitting into different test methods
|
44460fe
to
7b8ba03
Compare
7b8ba03
to
bc7cf9b
Compare
Adding a class to override the default behaviour of the |
@Bean | ||
VirtualServiceVerifier virtualServiceVerifier(@Qualifier("rawCatalog") Catalog catalog) { | ||
return new VirtualServiceVerifier(catalog); | ||
} | ||
|
||
/** | ||
* GS's src/web/gwc/src/main/java/applicationContext.xml | ||
* <!-- Used for workspace-based demo requests so the requests to GS stay workspace-based --> | ||
* <bean id="gwcDemoUrlHandlerMapping" | ||
* class="org.geoserver.gwc.controller.GwcUrlHandlerMapping"> <constructor-arg ref="catalog" /> | ||
* <constructor-arg value="/gwc/demo"/> <property name="alwaysUseFullPath" value="true" /> | ||
* <property name="order" value="10" /> </bean> | ||
* <!-- Used for workspace-based web requests (i.e. for rest/web/openlayer/ol.js) --> | ||
* <bean id="gwcRestWebUrlHandlerMapping" | ||
* class="org.geoserver.gwc.controller.GwcUrlHandlerMapping"> <constructor-arg ref="catalog" /> | ||
* <constructor-arg type="java.lang.String" value="/gwc/rest/web"/> <property | ||
* name="alwaysUseFullPath" value="true" /> <property name="order" value="10" /> </bean> | ||
*/ | ||
@Bean | ||
@Qualifier("gwcDemoUrlHandlerMapping") | ||
GwcUrlHandlerMapping gwcDemoUrlHandlerMapping(@Qualifier("rawCatalog") Catalog catalog) { | ||
GwcUrlHandlerMapping handler = new GwcUrlHandlerMapping(catalog, "/gwc/demo"); | ||
handler.setAlwaysUseFullPath(true); | ||
handler.setOrder(10); | ||
|
||
return handler; | ||
} | ||
|
||
/* | ||
@Bean | ||
WebMvcRegistrations gwcDemoUrlHandlerMappingRegistrations( | ||
@Qualifier("gwcDemoUrlHandlerMapping") GwcUrlHandlerMapping handler) { | ||
return new WebMvcRegistrations() { | ||
@Override | ||
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { | ||
return handler; | ||
} | ||
}; | ||
}*/ | ||
|
||
@Bean | ||
@Qualifier("gwcRestWebUrlHandlerMapping") | ||
GwcUrlHandlerMapping gwcRestWebUrlHandlerMapping(@Qualifier("rawCatalog") Catalog catalog) { | ||
GwcUrlHandlerMapping handler = new GwcUrlHandlerMapping(catalog, "/gwc/rest/web"); | ||
handler.setAlwaysUseFullPath(true); | ||
handler.setOrder(10); | ||
|
||
return handler; | ||
} | ||
|
||
/* | ||
@Bean | ||
WebMvcRegistrations gwcRestWebUrlHandlerMappingRegistrations( | ||
@Qualifier("gwcRestWebUrlHandlerMapping") GwcUrlHandlerMapping handler) { | ||
return new WebMvcRegistrations() { | ||
@Override | ||
public RequestMappingHandlerMapping getRequestMappingHandlerMapping() { | ||
return handler; | ||
} | ||
}; | ||
}*/ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if this is still required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing them and the testsuite still pass.
See #380 for the context.
Extending the
geowebcacheDispatcher
to get full control of how the URLs are mangled in the geoserver cloud context.Introducing a new class which allows to unzip a functional geoserver datadir so that we could test the geowebcache microservice more easily. The default one which was being used was creating fake objects not usable to test GWC.
Adding some tests to actually make sure that the different possible GWC entry points can be queried, with the different expected URI formats.