Permalink
Browse files

Revert changes for NXCM-5131

This reverts commits 683c647 and
d4f21a0.
  • Loading branch information...
nabcos committed Mar 25, 2013
1 parent 99591af commit 8e479a3678b5cc827928b4e630f393a9b4d5ec8a
@@ -42,7 +42,7 @@ public void getProxySnapshotTemplate()
Assert.assertTrue( result instanceof RepositoryProxyResource );
Assert.assertEquals( 1440, ( (RepositoryProxyResource) result ).getArtifactMaxAge() );
Assert.assertEquals( 1440, ( (RepositoryProxyResource) result ).getMetadataMaxAge() );
- Assert.assertEquals( 1440, ( (RepositoryProxyResource) result ).getItemMaxAge() );
+ Assert.assertEquals( Integer.valueOf( 1440 ), ( (RepositoryProxyResource) result ).getItemMaxAge() );
}
@Test
@@ -54,6 +54,6 @@ public void getProxyReleaseTemplate()
Assert.assertTrue( result instanceof RepositoryProxyResource );
Assert.assertEquals( -1, ( (RepositoryProxyResource) result ).getArtifactMaxAge() );
Assert.assertEquals( 1440, ( (RepositoryProxyResource) result ).getMetadataMaxAge() );
- Assert.assertEquals( 1440, ( (RepositoryProxyResource) result ).getItemMaxAge() );
+ Assert.assertEquals( Integer.valueOf( 1440 ), ( (RepositoryProxyResource) result ).getItemMaxAge() );
}
}
@@ -958,7 +958,7 @@
<field>
<name>itemMaxAge</name>
<version>1.0.0+</version>
- <type>int</type>
+ <type>Integer</type>
<required>false</required>
<description>The max age of items (not artifact not metadata) before we will check remote again for updated (in minutes, -1 for never).</description>
</field>
@@ -304,7 +304,10 @@ public CRepository getRepositoryProxyAppModel( RepositoryProxyResource model, CR
exConf.setMetadataMaxAge( model.getMetadataMaxAge() );
- exConf.setItemMaxAge( model.getItemMaxAge() );
+ if ( model.getItemMaxAge() != null )
+ {
+ exConf.setItemMaxAge( model.getItemMaxAge() );
+ }
// set auto block
exConf.setAutoBlockActive( model.isAutoBlockActive() );
@@ -292,7 +292,10 @@ public Object put( Context context, Request request, Response response, Object p
pRepository.setMetadataMaxAge( proxyModel.getMetadataMaxAge() );
- pRepository.setItemMaxAge( proxyModel.getItemMaxAge() );
+ if ( proxyModel.getItemMaxAge() != null )
+ {
+ pRepository.setItemMaxAge( proxyModel.getItemMaxAge() );
+ }
}
}
else
@@ -317,7 +320,7 @@ public Object put( Context context, Request request, Response response, Object p
{
metadataMethod.invoke( repository, proxyModel.getMetadataMaxAge() );
}
- if ( itemMethod != null )
+ if ( itemMethod != null && proxyModel.getItemMaxAge() != null)
{
itemMethod.invoke( repository, proxyModel.getItemMaxAge() );
}
@@ -76,7 +76,7 @@ public void testCreate()
Assert.assertEquals( "maven2", result.getFormat() );
Assert.assertEquals( false, result.isIndexable() );
Assert.assertEquals( 23, result.getMetadataMaxAge() );
- Assert.assertEquals( 234, result.getItemMaxAge() );
+ Assert.assertEquals( Integer.valueOf( 234 ), result.getItemMaxAge() );
Assert.assertEquals( "test-name", result.getName() );
Assert.assertEquals( 11, result.getNotFoundCacheTTL() );
Assert.assertEquals( "maven2", result.getProvider() );
@@ -180,7 +180,7 @@ public void testUpdate()
Assert.assertEquals( "maven2", result.getFormat() );
Assert.assertEquals( false, result.isIndexable() );
Assert.assertEquals( 23, result.getMetadataMaxAge() );
- Assert.assertEquals( 234, result.getItemMaxAge() );
+ Assert.assertEquals( Integer.valueOf( 234 ), result.getItemMaxAge() );
Assert.assertEquals( "test-name", result.getName() );
Assert.assertEquals( 11, result.getNotFoundCacheTTL() );
Assert.assertEquals( "maven2", result.getProvider() );

0 comments on commit 8e479a3

Please sign in to comment.