@@ -0,0 +1,3297 @@
+package org.commonjava.indy.ftest.core.content;%0A%0Aimport org.commonjava.indy.model.core.RemoteRepository;%0Aimport org.commonjava.indy.test.fixture.core.CoreServerFixture;%0Aimport org.junit.Test;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.Date;%0A%0Aimport static org.hamcrest.CoreMatchers.equalTo;%0Aimport static org.junit.Assert.assertThat;%0A%0Apublic class MetadataPassthroughTimeoutWorkingTest%0A        extends AbstractMetadataTimeoutWorkingTest%0A%7B%0A    private static final int CACHE_TIMEOUT_SECONDS = 2;%0A%0A    private static final int CACHE_TIMEOUT_WAITING_MILLISECONDS = 3000;%0A%0A    private static final int METADATA_TIMEOUT_SECONDS = 7;%0A%0A    private static final int METADATA_TIMEOUT_WAITING_MILLISECONDS = 5000;%0A%0A    private static final int PASSTHROUGH_TIMEOUT_SECONDS = 9;%0A%0A    private static final int PASSTHROUGH_TIMEOUT_WAITING_MILLISECONDS = 2000;%0A%0A    @Override%0A    protected void initTestConfig( CoreServerFixture fixture )%0A            throws IOException%0A    %7B%0A        writeConfigFile( %22main.conf%22, %22passthrough.timeout=%22 + PASSTHROUGH_TIMEOUT_SECONDS + %22%5Cn%22 + readTestResource(%0A                %22default-test-main.conf%22 ) );%0A    %7D%0A%0A    @Test%0A    public void timeout()%0A            throws Exception%0A    %7B%0A        Thread.sleep( CACHE_TIMEOUT_WAITING_MILLISECONDS );%0A        logger.debug( %22Verifying content timeouts at: %7B%7D (timeout: %7B%7Ds)%22, new Date(), CACHE_TIMEOUT_SECONDS );%0A        assertThat( %22artifact should not be removed because of passthrough%22, pomFile.exists(), equalTo( true ) );%0A        assertThat( %22metadata should not be removed because of passthrough%22, metadataFile.exists(), equalTo( true ) );%0A        assertThat( %22archetype should not be removed because of passthrough%22, archetypeFile.exists(), equalTo( true ) );%0A%0A        Thread.sleep( METADATA_TIMEOUT_WAITING_MILLISECONDS );%0A        logger.debug( %22Verifying metadata timeouts at: %7B%7D (timeout: %7B%7Ds)%22, new Date(), METADATA_TIMEOUT_SECONDS );%0A        assertThat( %22artifact should not be removed because of passthrough%22, pomFile.exists(), equalTo( true ) );%0A        assertThat( %22metadata should not be removed because of passthrough%22, metadataFile.exists(), equalTo( true ) );%0A        assertThat( %22archetype should not be removed because of passthrough%22, archetypeFile.exists(), equalTo( true ) );%0A%0A        Thread.sleep( PASSTHROUGH_TIMEOUT_WAITING_MILLISECONDS );%0A        logger.debug( %22Verifying passthrough timeouts at: %7B%7D (timeout: %7B%7Ds)%22, new Date(), PASSTHROUGH_TIMEOUT_SECONDS );%0A        assertThat( %22artifact should be removed because of passthrough timeout%22, pomFile.exists(), equalTo( false ) );%0A        assertThat( %22metadata should not be removed because of passthrough timeout%22, metadataFile.exists(),%0A                    equalTo( false ) );%0A        assertThat( %22archetype should not be removed because of passthrough timeout%22, archetypeFile.exists(),%0A                    equalTo( false ) );%0A    %7D%0A%0A    @Override%0A    protected RemoteRepository createRemoteRepository()%0A    %7B%0A        final RemoteRepository repository = new RemoteRepository( repoId, server.formatUrl( repoId ) );%0A        repository.setPassthrough( true );%0A        repository.setCacheTimeoutSeconds( CACHE_TIMEOUT_SECONDS );%0A        repository.setMetadataTimeoutSeconds( METADATA_TIMEOUT_SECONDS );%0A        return repository;%0A    %7D%0A%7D%0A

add passthrough enable test for metadata timeout