|
Lines 153-158
Link Here
|
| 153 |
assertFalse( "Resource must not be written twice", jarFile.exists() ); |
153 |
assertFalse( "Resource must not be written twice", jarFile.exists() ); |
| 154 |
} |
154 |
} |
| 155 |
|
155 |
|
|
|
156 |
public void testRegistrationForDiskWithInputStreamIsIdempotent() { |
| 157 |
IResourceManager manager = getResourceManager( DELIVER_FROM_DISK ); |
| 158 |
String resource = TEST_RESOURCE_1_JAR; |
| 159 |
manager.register( resource, openStream( TEST_RESOURCE_1_JAR ) ); |
| 160 |
clearTempFile(); |
| 161 |
File jarFile = getResourceCopyFile( resource ); |
| 162 |
|
| 163 |
manager.register( resource, openStream( TEST_RESOURCE_1_JAR ) ); |
| 164 |
|
| 165 |
assertFalse( "Resource must not be written twice", jarFile.exists() ); |
| 166 |
} |
| 167 |
|
| 156 |
public void testRegistrationServletWithNotExistingResource() { |
168 |
public void testRegistrationServletWithNotExistingResource() { |
| 157 |
IResourceManager manager = getResourceManager( DELIVER_BY_SERVLET ); |
169 |
IResourceManager manager = getResourceManager( DELIVER_BY_SERVLET ); |
| 158 |
String doesNotExist = "doesNotExist"; |
170 |
String doesNotExist = "doesNotExist"; |
|
Lines 213-218
Link Here
|
| 213 |
assertFalse( "Resource must not be written twice", tmpFile.exists() ); |
225 |
assertFalse( "Resource must not be written twice", tmpFile.exists() ); |
| 214 |
} |
226 |
} |
| 215 |
|
227 |
|
|
|
228 |
public void testRegistrationForServletTempDirWithInputStreamIsIdempotent() { |
| 229 |
ResourceManagerImpl manager = getResourceManager( DELIVER_BY_SERVLET ); |
| 230 |
String resourceName = "resource-name"; |
| 231 |
manager.register( resourceName, new ByteArrayInputStream( new byte[] { 1 } ) ); |
| 232 |
manager.register( resourceName, new ByteArrayInputStream( new byte[] { 2 } ) ); |
| 233 |
|
| 234 |
byte[] registeredBytes = manager.findResource( resourceName, null ); |
| 235 |
|
| 236 |
assertEquals( 1, registeredBytes[ 0 ] ); |
| 237 |
} |
| 238 |
|
| 216 |
public void testRegistrationWithNullParams() { |
239 |
public void testRegistrationWithNullParams() { |
| 217 |
IResourceManager manager = getResourceManager( DELIVER_FROM_DISK ); |
240 |
IResourceManager manager = getResourceManager( DELIVER_FROM_DISK ); |
| 218 |
try { |
241 |
try { |