make to test method rerunable

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1369335 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
skygo 2012-08-04 14:56:07 +00:00
parent d51dec36a7
commit cba18e85b5
1 changed files with 26 additions and 22 deletions

View File

@ -27,11 +27,9 @@ import org.apache.archiva.admin.model.beans.OrganisationInformation;
import org.apache.archiva.admin.model.beans.UiConfiguration; import org.apache.archiva.admin.model.beans.UiConfiguration;
import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest; import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest;
import org.apache.archiva.audit.AuditEvent; import org.apache.archiva.audit.AuditEvent;
import org.apache.maven.wagon.providers.http.HttpWagon;
import org.junit.Test; import org.junit.Test;
import javax.inject.Inject; import javax.inject.Inject;
import java.lang.reflect.Field;
import java.util.Arrays; import java.util.Arrays;
/** /**
@ -194,24 +192,27 @@ public class ArchivaAdministrationTest
public void organisationInfoUpdate() public void organisationInfoUpdate()
throws Exception throws Exception
{ {
OrganisationInformation organisationInformation = archivaAdministration.getOrganisationInformation(); OrganisationInformation oldOrganisationInformation = archivaAdministration.getOrganisationInformation();
assertNotNull( organisationInformation ); assertNotNull( oldOrganisationInformation );
assertNull( organisationInformation.getLogoLocation() ); assertNull( oldOrganisationInformation.getLogoLocation() );
assertNull( organisationInformation.getName() ); assertNull( oldOrganisationInformation.getName() );
assertNull( organisationInformation.getUrl() ); assertNull( oldOrganisationInformation.getUrl() );
organisationInformation = new OrganisationInformation(); OrganisationInformation newOrganisationInformation = new OrganisationInformation();
organisationInformation.setLogoLocation( "http://foo.com/bar.png" ); newOrganisationInformation.setLogoLocation( "http://foo.com/bar.png" );
organisationInformation.setName( "foo org" ); newOrganisationInformation.setName( "foo org" );
organisationInformation.setUrl( "http://foo.com" ); newOrganisationInformation.setUrl( "http://foo.com" );
archivaAdministration.setOrganisationInformation( organisationInformation ); archivaAdministration.setOrganisationInformation( newOrganisationInformation );
organisationInformation = archivaAdministration.getOrganisationInformation(); newOrganisationInformation = archivaAdministration.getOrganisationInformation();
assertNotNull( organisationInformation ); assertNotNull( newOrganisationInformation );
assertEquals( "http://foo.com/bar.png", organisationInformation.getLogoLocation() ); assertEquals( "http://foo.com/bar.png", newOrganisationInformation.getLogoLocation() );
assertEquals( "foo org", organisationInformation.getName() ); assertEquals( "foo org", newOrganisationInformation.getName() );
assertEquals( "http://foo.com", organisationInformation.getUrl() ); assertEquals( "http://foo.com", newOrganisationInformation.getUrl() );
// back to initial OrganisationInformation //MRM-1638
archivaAdministration.setOrganisationInformation( oldOrganisationInformation );
} }
@ -219,13 +220,14 @@ public class ArchivaAdministrationTest
public void uiConfiguration() public void uiConfiguration()
throws Exception throws Exception
{ {
UiConfiguration ui = archivaAdministration.getUiConfiguration(); UiConfiguration oldUi = archivaAdministration.getUiConfiguration();
assertNotNull( ui ); assertNotNull( oldUi );
// assert default values // assert default values
assertFalse( ui.isDisableEasterEggs() ); assertFalse( oldUi.isDisableEasterEggs() );
assertTrue( ui.isAppletFindEnabled() ); assertTrue( oldUi.isAppletFindEnabled() );
assertTrue( ui.isShowFindArtifacts() ); assertTrue( oldUi.isShowFindArtifacts() );
UiConfiguration ui = archivaAdministration.getUiConfiguration();
ui.setAppletFindEnabled( false ); ui.setAppletFindEnabled( false );
ui.setShowFindArtifacts( false ); ui.setShowFindArtifacts( false );
ui.setDisableEasterEggs( true ); ui.setDisableEasterEggs( true );
@ -237,6 +239,8 @@ public class ArchivaAdministrationTest
assertTrue( ui.isDisableEasterEggs() ); assertTrue( ui.isDisableEasterEggs() );
assertFalse( ui.isAppletFindEnabled() ); assertFalse( ui.isAppletFindEnabled() );
assertFalse( ui.isShowFindArtifacts() ); assertFalse( ui.isShowFindArtifacts() );
archivaAdministration.updateUiConfiguration( oldUi );
} }
@Test @Test