 9d60d90661
			
		
	
	9d60d90661
	
	
	
		
			
			These are small tests using a custom subclass of ResourceServlet pointing at in in-memory filesystem using Jimfs. Larger tests that actually check the mappings in StaticModule are somewhat trickier. These tests are not yet comprehensive, but were enough to identify one bug in 404 behavior, where an uncaught NoSuchFileException turned what should have been a 404 into a 500. Change-Id: Iee8059444a66f9be608c6605ec16cc1b46c443e2
		
			
				
	
	
		
			41 lines
		
	
	
		
			848 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			848 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| java_library(
 | |
|   name = 'http',
 | |
|   srcs = glob(['src/main/java/**/*.java']),
 | |
|   provided_deps = ['//lib:servlet-api-3_1'],
 | |
|   visibility = ['PUBLIC'],
 | |
| )
 | |
| 
 | |
| TESTUTIL_SRCS = glob(['src/test/**/testutil/**/*.java'])
 | |
| 
 | |
| java_library(
 | |
|   name = 'testutil',
 | |
|   srcs = TESTUTIL_SRCS,
 | |
|   deps = [
 | |
|     '//gerrit-extension-api:api',
 | |
|     '//lib:guava',
 | |
|     '//lib:servlet-api-3_1',
 | |
|     '//lib/httpcomponents:httpclient',
 | |
|     '//lib/jgit:jgit',
 | |
|   ],
 | |
|   visibility = ['PUBLIC'],
 | |
| )
 | |
| 
 | |
| java_test(
 | |
|   name = 'http_tests',
 | |
|   srcs = glob(
 | |
|     ['src/test/java/**/*.java'],
 | |
|     excludes = TESTUTIL_SRCS,
 | |
|   ),
 | |
|   deps = [
 | |
|     ':http',
 | |
|     ':testutil',
 | |
|     '//lib:junit',
 | |
|     '//lib:servlet-api-3_1',
 | |
|     '//lib:truth',
 | |
|     '//lib/easymock:easymock',
 | |
|   ],
 | |
|   source_under_test = [':http'],
 | |
|   # TODO(sop) Remove after Buck supports Eclipse
 | |
|   visibility = ['//tools/eclipse:classpath'],
 | |
| )
 |