import com.meterware.httpunit.HttpUnitOptions;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;
-
+import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
import org.apache.maven.archiva.policies.SnapshotsPolicy;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
+import java.util.ArrayList;
/**
- * RepositoryServlet Tests, Proxied, Get of Timestamped Snapshot Artifacts, with varying policy settings.
+ * RepositoryServlet Tests, Proxied, Get of Timestamped Snapshot Artifacts, with varying policy settings.
*
* @version $Id$
*/
public void setup()
throws Exception
{
+ archivaConfiguration.getConfiguration().setProxyConnectors( new ArrayList<ProxyConnectorConfiguration>() );
super.setUp();
}
public void tearDown()
throws Exception
{
+ archivaConfiguration.getConfiguration().setProxyConnectors( new ArrayList<ProxyConnectorConfiguration>() );
+
super.tearDown();
}
public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer()
throws Exception
{
- assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ALWAYS,
- HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) );
+ assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ALWAYS, HAS_MANAGED_COPY,
+ ( NEWER * OVER_ONE_DAY ) );
}
@Test
public void testGetProxiedSnapshotsArtifactPolicyRejectFail()
throws Exception
{
- assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER,
- HAS_MANAGED_COPY );
+ assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER, HAS_MANAGED_COPY );
}
@Test
public void testGetProxiedSnapshotsArtifactPolicyRejectPass()
throws Exception
{
- assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER,
- HAS_MANAGED_COPY );
+ assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER, HAS_MANAGED_COPY );
}
@Test
}
private void assertGetProxiedSnapshotsArtifactWithPolicy( int expectation, String snapshotsPolicy,
- boolean hasManagedCopy, long deltaManagedToRemoteTimestamp )
+ boolean hasManagedCopy,
+ long deltaManagedToRemoteTimestamp )
throws Exception
{
// --- Setup
case EXPECT_MANAGED_CONTENTS:
assertResponseOK( response );
assertTrue( "Invalid Test Case: Can't expect managed contents with "
- + "test that doesn't have a managed copy in the first place.", hasManagedCopy );
+ + "test that doesn't have a managed copy in the first place.", hasManagedCopy );
assertEquals( "Expected managed file contents", expectedManagedContents, response.getText() );
break;
case EXPECT_REMOTE_CONTENTS: