summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorskygo <skygo@unknown>2012-08-04 14:56:07 +0000
committerskygo <skygo@unknown>2012-08-04 14:56:07 +0000
commitcba18e85b50894a3a46f91676ca97c2f64886cfc (patch)
tree5fa3f2fef1d905963faa36f57cf2e1624b6d2e24 /archiva-modules
parentd51dec36a7d5ae08bc0d54e83c6c15c81f7ba8e6 (diff)
downloadarchiva-cba18e85b50894a3a46f91676ca97c2f64886cfc.tar.gz
archiva-cba18e85b50894a3a46f91676ca97c2f64886cfc.zip
make to test method rerunable
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1369335 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java54
1 files changed, 29 insertions, 25 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java
index b54b85232..f971c792e 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/admin/ArchivaAdministrationTest.java
@@ -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.repository.AbstractRepositoryAdminTest;
import org.apache.archiva.audit.AuditEvent;
-import org.apache.maven.wagon.providers.http.HttpWagon;
import org.junit.Test;
import javax.inject.Inject;
-import java.lang.reflect.Field;
import java.util.Arrays;
/**
@@ -194,24 +192,27 @@ public class ArchivaAdministrationTest
public void organisationInfoUpdate()
throws Exception
{
- OrganisationInformation organisationInformation = archivaAdministration.getOrganisationInformation();
- assertNotNull( organisationInformation );
- assertNull( organisationInformation.getLogoLocation() );
- assertNull( organisationInformation.getName() );
- assertNull( organisationInformation.getUrl() );
-
- organisationInformation = new OrganisationInformation();
- organisationInformation.setLogoLocation( "http://foo.com/bar.png" );
- organisationInformation.setName( "foo org" );
- organisationInformation.setUrl( "http://foo.com" );
-
- archivaAdministration.setOrganisationInformation( organisationInformation );
-
- organisationInformation = archivaAdministration.getOrganisationInformation();
- assertNotNull( organisationInformation );
- assertEquals( "http://foo.com/bar.png", organisationInformation.getLogoLocation() );
- assertEquals( "foo org", organisationInformation.getName() );
- assertEquals( "http://foo.com", organisationInformation.getUrl() );
+ OrganisationInformation oldOrganisationInformation = archivaAdministration.getOrganisationInformation();
+ assertNotNull( oldOrganisationInformation );
+ assertNull( oldOrganisationInformation.getLogoLocation() );
+ assertNull( oldOrganisationInformation.getName() );
+ assertNull( oldOrganisationInformation.getUrl() );
+
+ OrganisationInformation newOrganisationInformation = new OrganisationInformation();
+ newOrganisationInformation.setLogoLocation( "http://foo.com/bar.png" );
+ newOrganisationInformation.setName( "foo org" );
+ newOrganisationInformation.setUrl( "http://foo.com" );
+
+ archivaAdministration.setOrganisationInformation( newOrganisationInformation );
+
+ newOrganisationInformation = archivaAdministration.getOrganisationInformation();
+ assertNotNull( newOrganisationInformation );
+ assertEquals( "http://foo.com/bar.png", newOrganisationInformation.getLogoLocation() );
+ assertEquals( "foo org", newOrganisationInformation.getName() );
+ 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()
throws Exception
{
- UiConfiguration ui = archivaAdministration.getUiConfiguration();
- assertNotNull( ui );
+ UiConfiguration oldUi = archivaAdministration.getUiConfiguration();
+ assertNotNull( oldUi );
// assert default values
- assertFalse( ui.isDisableEasterEggs() );
- assertTrue( ui.isAppletFindEnabled() );
- assertTrue( ui.isShowFindArtifacts() );
+ assertFalse( oldUi.isDisableEasterEggs() );
+ assertTrue( oldUi.isAppletFindEnabled() );
+ assertTrue( oldUi.isShowFindArtifacts() );
+ UiConfiguration ui = archivaAdministration.getUiConfiguration();
ui.setAppletFindEnabled( false );
ui.setShowFindArtifacts( false );
ui.setDisableEasterEggs( true );
@@ -237,6 +239,8 @@ public class ArchivaAdministrationTest
assertTrue( ui.isDisableEasterEggs() );
assertFalse( ui.isAppletFindEnabled() );
assertFalse( ui.isShowFindArtifacts() );
+
+ archivaAdministration.updateUiConfiguration( oldUi );
}
@Test