From d305c64646a5b166177a6316c6b921af64cc61c5 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Thu, 23 May 2013 12:26:15 +0200 Subject: [PATCH] move basepac names to hostsharing package --- hsarback/src/de/hsadmin/hostsharing/BasePacType.java | 10 ++++++++++ .../de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java | 3 ++- .../src/de/hsadmin/mods/db/MySqlUserModuleImpl.java | 3 ++- .../de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java | 3 ++- .../src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java | 3 ++- hsarback/src/de/hsadmin/mods/dom/Domain.java | 4 ++-- hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java | 3 ++- .../de/hsadmin/mods/email/EMailAddressModuleImpl.java | 4 ++-- .../de/hsadmin/mods/email/EMailAliasModuleImpl.java | 3 ++- hsarback/src/de/hsadmin/mods/pac/Pac.java | 10 +++------- hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java | 5 +++-- .../src/de/hsadmin/mods/pac/PacProcessorFactory.java | 7 ++++--- .../src/de/hsadmin/mods/user/UnixUserModuleImpl.java | 3 ++- hsarback/test/de/hsadmin/remote/InitDataTest.java | 4 ++-- hsarback/test/de/hsadmin/remote/PacMigrationTest.java | 10 +++++----- hsarback/test/de/hsadmin/remote/PacTest.java | 8 ++++---- hsarback/test/de/hsadmin/remote/SSLCertDomainTest.java | 6 +++--- 17 files changed, 52 insertions(+), 37 deletions(-) create mode 100644 hsarback/src/de/hsadmin/hostsharing/BasePacType.java diff --git a/hsarback/src/de/hsadmin/hostsharing/BasePacType.java b/hsarback/src/de/hsadmin/hostsharing/BasePacType.java new file mode 100644 index 0000000..a804c1e --- /dev/null +++ b/hsarback/src/de/hsadmin/hostsharing/BasePacType.java @@ -0,0 +1,10 @@ +package de.hsadmin.hostsharing; + +public class BasePacType { + + public static final String PAC_DW = "PAC/DW"; + public static final String PAC_SW = "PAC/SW"; + public static final String PAC_WEB = "PAC/WEB"; + public static final String PAC_SRV = "SRV/MGD"; + +} diff --git a/hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java b/hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java index ba2a995..90a0b63 100644 --- a/hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/db/MySqlDatabaseModuleImpl.java @@ -10,6 +10,7 @@ import de.hsadmin.core.model.AbstractModuleImpl; import de.hsadmin.core.model.AuthorisationException; import de.hsadmin.core.model.HSAdminException; import de.hsadmin.core.model.Transaction; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.hostsharing.MultiOption; import de.hsadmin.mods.pac.Pac; import de.hsadmin.mods.user.UnixUser; @@ -57,7 +58,7 @@ public class MySqlDatabaseModuleImpl extends AbstractModuleImpl { } //TODO: Needs better implementation String pacType = pac.getBasepac().getName(); - if (!pacType.equals(Pac.PAC_WEB) && !pacType.equals(Pac.PAC_DW)) { + if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW)) { throw new HSAdminException("not allowed for this packet type"); } //TODO: Needs better implementation diff --git a/hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java b/hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java index f5f64d1..29a458e 100644 --- a/hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/db/MySqlUserModuleImpl.java @@ -10,6 +10,7 @@ import de.hsadmin.core.model.AbstractModuleImpl; import de.hsadmin.core.model.AuthorisationException; import de.hsadmin.core.model.HSAdminException; import de.hsadmin.core.model.Transaction; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.hostsharing.MultiOption; import de.hsadmin.mods.pac.Pac; import de.hsadmin.mods.user.UnixUser; @@ -38,7 +39,7 @@ public class MySqlUserModuleImpl extends AbstractModuleImpl { } //TODO: Needs better implementation String pacType = pac.getBasepac().getName(); - if (!pacType.equals(Pac.PAC_WEB) && !pacType.equals(Pac.PAC_DW)) { + if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW)) { throw new HSAdminException("not allowed for this packet type"); } //TODO: Needs better implementation diff --git a/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java b/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java index fd165a4..12ad13f 100644 --- a/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/db/PgSqlDatabaseModuleImpl.java @@ -10,6 +10,7 @@ import de.hsadmin.core.model.AbstractModuleImpl; import de.hsadmin.core.model.AuthorisationException; import de.hsadmin.core.model.HSAdminException; import de.hsadmin.core.model.Transaction; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.hostsharing.MultiOption; import de.hsadmin.mods.pac.Pac; import de.hsadmin.mods.user.UnixUser; @@ -56,7 +57,7 @@ public class PgSqlDatabaseModuleImpl extends AbstractModuleImpl { } //TODO: Needs better implementation String pacType = pac.getBasepac().getName(); - if (!pacType.equals(Pac.PAC_WEB) && !pacType.equals(Pac.PAC_DW)) { + if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW)) { throw new HSAdminException("not allowed for this packet type"); } //TODO: Needs better implementation diff --git a/hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java b/hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java index 802efe0..c6034e4 100644 --- a/hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/db/PgSqlUserModuleImpl.java @@ -9,6 +9,7 @@ import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AbstractModuleImpl; import de.hsadmin.core.model.AuthorisationException; import de.hsadmin.core.model.HSAdminException; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.hostsharing.MultiOption; import de.hsadmin.mods.pac.Pac; import de.hsadmin.mods.user.UnixUser; @@ -33,7 +34,7 @@ public class PgSqlUserModuleImpl extends AbstractModuleImpl { } //TODO: Needs better implementation String pacType = pac.getBasepac().getName(); - if (!pacType.equals(Pac.PAC_WEB) && !pacType.equals(Pac.PAC_DW)) { + if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW)) { throw new HSAdminException("not allowed for this packet type"); } //TODO: Needs better implementation diff --git a/hsarback/src/de/hsadmin/mods/dom/Domain.java b/hsarback/src/de/hsadmin/mods/dom/Domain.java index 47bdd7c..d149c22 100644 --- a/hsarback/src/de/hsadmin/mods/dom/Domain.java +++ b/hsarback/src/de/hsadmin/mods/dom/Domain.java @@ -25,7 +25,7 @@ import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AnnFieldIO; import de.hsadmin.core.model.AnnModuleImpl; import de.hsadmin.core.model.ReadWriteAccess; -import de.hsadmin.mods.pac.Pac; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.mods.user.UnixUser; @Entity(name = "Domains") @@ -183,7 +183,7 @@ public class Domain extends AbstractEntity { public boolean isDynamic() { String basepacName = getUser().getPac().getBasepac().getName(); - return isPacDomain() || basepacName.equals(Pac.PAC_DW) || basepacName.equals(Pac.PAC_WEB); + return isPacDomain() || basepacName.equals(BasePacType.PAC_DW) || basepacName.equals(BasePacType.PAC_WEB); } public boolean isStatic() { diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java index 85d1167..84449a9 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java @@ -13,6 +13,7 @@ import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AbstractModuleImpl; import de.hsadmin.core.model.AuthorisationException; import de.hsadmin.core.model.HSAdminException; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.mods.email.EMailAddress; import de.hsadmin.mods.pac.Pac; import de.hsadmin.mods.user.UnixUser; @@ -108,7 +109,7 @@ public class DomainModuleImpl extends AbstractModuleImpl { admin = (UnixUser) userQuery.getSingleResult(); //TODO: Needs better implementation String pacType = admin.getPac().getBasepac().getName(); - if (!pacType.equals(Pac.PAC_WEB) && !pacType.equals(Pac.PAC_DW) && !pacType.equals(Pac.PAC_SW)) { + if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW) && !pacType.equals(BasePacType.PAC_SW)) { throw new HSAdminException("not allowed for this packet type"); } // Standard domainoptions setzen. TODO: Alle defaults über eigene Klasse aus der Datenbank holen. diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAddressModuleImpl.java b/hsarback/src/de/hsadmin/mods/email/EMailAddressModuleImpl.java index 292719a..d4a773d 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAddressModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAddressModuleImpl.java @@ -10,8 +10,8 @@ import de.hsadmin.core.model.AuthorisationException; import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.HSAdminException; import de.hsadmin.core.model.Transaction; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.mods.dom.Domain; -import de.hsadmin.mods.pac.Pac; import de.hsadmin.mods.user.UnixUser; public class EMailAddressModuleImpl extends AbstractModuleImpl { @@ -56,7 +56,7 @@ public class EMailAddressModuleImpl extends AbstractModuleImpl { } //TODO: Needs better implementation String pacType = dom.getUser().getPac().getBasepac().getName(); - if (!pacType.equals(Pac.PAC_WEB) && !pacType.equals(Pac.PAC_DW) && !pacType.equals(Pac.PAC_SW)) { + if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW) && !pacType.equals(BasePacType.PAC_SW)) { throw new HSAdminException("not allowed for this packet type"); } //TODO: Needs better implementation diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java b/hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java index 0587de2..2825386 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAliasModuleImpl.java @@ -10,6 +10,7 @@ import de.hsadmin.core.model.AbstractModuleImpl; import de.hsadmin.core.model.AuthorisationException; import de.hsadmin.core.model.HSAdminException; import de.hsadmin.core.model.Transaction; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.hostsharing.MultiOption; import de.hsadmin.mods.pac.Pac; import de.hsadmin.mods.user.UnixUser; @@ -47,7 +48,7 @@ public class EMailAliasModuleImpl extends AbstractModuleImpl { } //TODO: Needs better implementation String pacType = pac.getBasepac().getName(); - if (!pacType.equals(Pac.PAC_WEB) && !pacType.equals(Pac.PAC_DW) && !pacType.equals(Pac.PAC_SW)) { + if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW) && !pacType.equals(BasePacType.PAC_SW)) { throw new HSAdminException("not allowed for this packet type"); } //TODO: Needs better implementation diff --git a/hsarback/src/de/hsadmin/mods/pac/Pac.java b/hsarback/src/de/hsadmin/mods/pac/Pac.java index 3daa6a0..d9f4def 100644 --- a/hsarback/src/de/hsadmin/mods/pac/Pac.java +++ b/hsarback/src/de/hsadmin/mods/pac/Pac.java @@ -26,6 +26,7 @@ import javax.persistence.TemporalType; import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AnnModuleImpl; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.mods.cust.Customer; import de.hsadmin.mods.user.UnixUser; @@ -39,11 +40,6 @@ public class Pac extends AbstractEntity implements Serializable { public static final int UNDEFINED_QUANTITY = -1; - public static final String PAC_DW = "PAC/DW"; - public static final String PAC_SW = "PAC/SW"; - public static final String PAC_WEB = "PAC/WEB"; - public static final String PAC_SRV = "SRV/MGD"; - @Id @GeneratedValue(strategy = SEQUENCE, generator = "PacsSeqGen") @Column(name = "packet_id", columnDefinition = "integer") @@ -290,11 +286,11 @@ public class Pac extends AbstractEntity implements Serializable { public boolean isDynamic() { String basepacName = getBasepac().getName(); - return PAC_DW.equals(basepacName) || PAC_WEB.equals(basepacName); + return BasePacType.PAC_DW.equals(basepacName) || BasePacType.PAC_WEB.equals(basepacName); } public boolean isManagedServer() { String basepacName = getBasepac().getName(); - return PAC_SRV.equals(basepacName); + return BasePacType.PAC_SRV.equals(basepacName); } } diff --git a/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java b/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java index 7009e67..f4c580d 100644 --- a/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java @@ -16,6 +16,7 @@ import de.hsadmin.core.model.AuthorisationException; import de.hsadmin.core.model.GenericModuleImpl; import de.hsadmin.core.model.HSAdminException; import de.hsadmin.core.util.TextUtil; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.mods.cust.Contact; import de.hsadmin.mods.cust.Customer; import de.hsadmin.mods.dom.Domain; @@ -94,7 +95,7 @@ public class PacModuleImpl extends AbstractModuleImpl { pac.setPacComponents(pacComponents); AbstractEntity newPacEntity = null; String pacType = pac.getBasepac().getName(); - if (pacType.equals(Pac.PAC_WEB) || pacType.equals(Pac.PAC_DW) || pacType.equals(Pac.PAC_SW)) { + if (pacType.equals(BasePacType.PAC_WEB) || pacType.equals(BasePacType.PAC_DW) || pacType.equals(BasePacType.PAC_SW)) { Set users = new HashSet(); pac.setUnixUser(users); UnixUser admin = new UnixUser(); @@ -196,7 +197,7 @@ public class PacModuleImpl extends AbstractModuleImpl { throw new AuthorisationException(getTransaction().getLoginUser(), "delete", existingEntity); } String pacType = pac.getBasepac().getName(); - if (pacType.equals(Pac.PAC_WEB) || pacType.equals(Pac.PAC_DW) || pacType.equals(Pac.PAC_SW)) { + if (pacType.equals(BasePacType.PAC_WEB) || pacType.equals(BasePacType.PAC_DW) || pacType.equals(BasePacType.PAC_SW)) { GenericModuleImpl helperModule = new GenericModuleImpl(getTransaction()); String[] dependQueries = new String[] { diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java index 236bbb6..9839a30 100644 --- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java @@ -15,6 +15,7 @@ import de.hsadmin.core.qserv.ShellProcessor; import de.hsadmin.core.qserv.VelocityProcessor; import de.hsadmin.core.qserv.WaitingTasksProcessor; import de.hsadmin.core.util.PasswordTool; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.mods.user.UnixUser; @@ -25,7 +26,7 @@ public class PacProcessorFactory implements EntityProcessorFactory { EntityManager em, T entity) throws ProcessorException { Pac pac = (Pac) entity; String basepacName = pac.getBasepac().getName(); - if (basepacName.equals(Pac.PAC_WEB) || basepacName.equals(Pac.PAC_DW) || basepacName.equals(Pac.PAC_SW)) { + if (basepacName.equals(BasePacType.PAC_WEB) || basepacName.equals(BasePacType.PAC_DW) || basepacName.equals(BasePacType.PAC_SW)) { String pacName = pac.getName(); Hive hive = pac.getHive(); UnixUser unixUser = getPacAdminUser(pac); @@ -79,7 +80,7 @@ public class PacProcessorFactory implements EntityProcessorFactory { throws ProcessorException { Pac pac = (Pac) entity; String basepacName = pac.getBasepac().getName(); - if (basepacName.equals(Pac.PAC_WEB) || basepacName.equals(Pac.PAC_DW) || basepacName.equals(Pac.PAC_SW)) { + if (basepacName.equals(BasePacType.PAC_WEB) || basepacName.equals(BasePacType.PAC_DW) || basepacName.equals(BasePacType.PAC_SW)) { return createSetQuotaProc(pac); } else { return new NullProcessor(); @@ -90,7 +91,7 @@ public class PacProcessorFactory implements EntityProcessorFactory { public Processor createDeleteProcessor(EntityManager em, T entity) throws ProcessorException { Pac pac = (Pac) entity; String basepacName = pac.getBasepac().getName(); - if (basepacName.equals(Pac.PAC_WEB) || basepacName.equals(Pac.PAC_DW) || basepacName.equals(Pac.PAC_SW)) { + if (basepacName.equals(BasePacType.PAC_WEB) || basepacName.equals(BasePacType.PAC_DW) || basepacName.equals(BasePacType.PAC_SW)) { Hive hive = pac.getHive(); WaitingTasksProcessor waiting = new WaitingTasksProcessor(createDelUserProc(pac.getName())); waiting.appendProcessor(pac.getHiveName(), new CompoundProcessor( diff --git a/hsarback/src/de/hsadmin/mods/user/UnixUserModuleImpl.java b/hsarback/src/de/hsadmin/mods/user/UnixUserModuleImpl.java index a8c2c20..b6dc605 100644 --- a/hsarback/src/de/hsadmin/mods/user/UnixUserModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/user/UnixUserModuleImpl.java @@ -11,6 +11,7 @@ import de.hsadmin.core.model.AbstractEntity; import de.hsadmin.core.model.AbstractModuleImpl; import de.hsadmin.core.model.HSAdminException; import de.hsadmin.core.model.Transaction; +import de.hsadmin.hostsharing.BasePacType; import de.hsadmin.hostsharing.MultiOption; import de.hsadmin.mods.pac.Pac; @@ -128,7 +129,7 @@ public class UnixUserModuleImpl extends AbstractModuleImpl { } //TODO: Needs better implementation String pacType = pac.getBasepac().getName(); - if (!pacType.equals(Pac.PAC_WEB) && !pacType.equals(Pac.PAC_DW) && !pacType.equals(Pac.PAC_SW)) { + if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW) && !pacType.equals(BasePacType.PAC_SW)) { throw new HSAdminException("not allowed for this packet type"); } //TODO: Needs better implementation diff --git a/hsarback/test/de/hsadmin/remote/InitDataTest.java b/hsarback/test/de/hsadmin/remote/InitDataTest.java index 392cb6e..392053b 100644 --- a/hsarback/test/de/hsadmin/remote/InitDataTest.java +++ b/hsarback/test/de/hsadmin/remote/InitDataTest.java @@ -13,7 +13,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import de.hsadmin.mods.pac.Pac; +import de.hsadmin.hostsharing.BasePacType; public class InitDataTest { @@ -79,7 +79,7 @@ public class InitDataTest { setParams.put("name", "aaa00"); setParams.put("hive", "h99"); setParams.put("customer", "hsh00-aaa"); - setParams.put("basepac", Pac.PAC_WEB); + setParams.put("basepac", BasePacType.PAC_WEB); setParams.put("curinetaddr", "176.9.242.74"); Object[] params = new Object[] { user, cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), diff --git a/hsarback/test/de/hsadmin/remote/PacMigrationTest.java b/hsarback/test/de/hsadmin/remote/PacMigrationTest.java index 2c14a1f..55de485 100644 --- a/hsarback/test/de/hsadmin/remote/PacMigrationTest.java +++ b/hsarback/test/de/hsadmin/remote/PacMigrationTest.java @@ -15,7 +15,7 @@ import org.junit.Before; import org.junit.Test; import de.hsadmin.core.util.Config; -import de.hsadmin.mods.pac.Pac; +import de.hsadmin.hostsharing.BasePacType; public class PacMigrationTest { @@ -47,7 +47,7 @@ public class PacMigrationTest { setParams.put("name", "aaa04"); setParams.put("hive", "h99"); setParams.put("customer", config.getProperty("accountprefix.customer") + "-aaa"); - setParams.put("basepac", Pac.PAC_DW); + setParams.put("basepac", BasePacType.PAC_DW); setParams.put("curinetaddr", "176.9.242.77"); HashMap components = new HashMap(); components.put("QUOTA", "640"); @@ -73,7 +73,7 @@ public class PacMigrationTest { assertTrue(untypedResultArray[0] instanceof Map); @SuppressWarnings("unchecked") Map pacResultMap = (Map) untypedResultArray[0]; - assertEquals(Pac.PAC_DW, pacResultMap.get("basepac")); + assertEquals(BasePacType.PAC_DW, pacResultMap.get("basepac")); Object compMapObj = pacResultMap.get("components"); assertTrue(compMapObj instanceof Map); @SuppressWarnings("unchecked") @@ -104,7 +104,7 @@ public class PacMigrationTest { String grantingTicketURL = cas.getGrantingTicketURL(user); Map setParams = new HashMap(); Map components = new HashMap(); - setParams.put("basepac", Pac.PAC_WEB); + setParams.put("basepac", BasePacType.PAC_WEB); setParams.put("components", components); // components.put("QUOTA", "2048"); // does not work till now Map whereParams = new HashMap(); @@ -126,7 +126,7 @@ public class PacMigrationTest { assertTrue(untypedResultArray[0] instanceof Map); @SuppressWarnings("unchecked") Map pacResultMap = (Map) untypedResultArray[0]; - assertEquals(Pac.PAC_WEB, pacResultMap.get("basepac")); + assertEquals(BasePacType.PAC_WEB, pacResultMap.get("basepac")); Object compMapObj = pacResultMap.get("components"); assertTrue(compMapObj instanceof Map); @SuppressWarnings("unchecked") diff --git a/hsarback/test/de/hsadmin/remote/PacTest.java b/hsarback/test/de/hsadmin/remote/PacTest.java index a92742c..70b0765 100644 --- a/hsarback/test/de/hsadmin/remote/PacTest.java +++ b/hsarback/test/de/hsadmin/remote/PacTest.java @@ -15,7 +15,7 @@ import org.junit.Before; import org.junit.Test; import de.hsadmin.core.util.Config; -import de.hsadmin.mods.pac.Pac; +import de.hsadmin.hostsharing.BasePacType; public class PacTest { @@ -131,7 +131,7 @@ public class PacTest { assertTrue(untypedResultArray[0] instanceof Map); @SuppressWarnings("unchecked") Map pacResultMap = (Map) untypedResultArray[0]; - assertEquals(Pac.PAC_WEB, pacResultMap.get("basepac")); + assertEquals(BasePacType.PAC_WEB, pacResultMap.get("basepac")); Object compMapObj = pacResultMap.get("components"); assertTrue(compMapObj instanceof Map); @SuppressWarnings("unchecked") @@ -153,7 +153,7 @@ public class PacTest { setParams.put("name", "aaa01"); setParams.put("hive", "h99"); setParams.put("customer", config.getProperty("accountprefix.customer") + "-aaa"); - setParams.put("basepac", Pac.PAC_WEB); + setParams.put("basepac", BasePacType.PAC_WEB); setParams.put("curinetaddr", "176.9.242.76"); HashMap components = new HashMap(); components.put("QUOTA", "512"); @@ -193,7 +193,7 @@ public class PacTest { setParams.put("name", "aaa90"); setParams.put("hive", "h99"); setParams.put("customer", config.getProperty("accountprefix.customer") + "-aaa"); - setParams.put("basepac", Pac.PAC_SRV); + setParams.put("basepac", BasePacType.PAC_SRV); setParams.put("curinetaddr", "176.9.242.76"); setParams.put("free", "true"); Object[] params = new Object[] { user, diff --git a/hsarback/test/de/hsadmin/remote/SSLCertDomainTest.java b/hsarback/test/de/hsadmin/remote/SSLCertDomainTest.java index 065fa1e..c6e10bf 100644 --- a/hsarback/test/de/hsadmin/remote/SSLCertDomainTest.java +++ b/hsarback/test/de/hsadmin/remote/SSLCertDomainTest.java @@ -15,7 +15,7 @@ import org.junit.Test; import de.hsadmin.core.qserv.CommandShell; import de.hsadmin.core.qserv.ShellException; import de.hsadmin.core.util.Config; -import de.hsadmin.mods.pac.Pac; +import de.hsadmin.hostsharing.BasePacType; public class SSLCertDomainTest { @@ -47,7 +47,7 @@ public class SSLCertDomainTest { setParams.put("name", "aaa02"); setParams.put("hive", "h99"); setParams.put("customer", config.getProperty("accountprefix.customer") + "-aaa"); - setParams.put("basepac", Pac.PAC_WEB); + setParams.put("basepac", BasePacType.PAC_WEB); setParams.put("curinetaddr", "176.9.242.77"); Object[] params = new Object[] { user, cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()), @@ -78,7 +78,7 @@ public class SSLCertDomainTest { setParams.put("name", "aaa03"); setParams.put("hive", "h99"); setParams.put("customer", config.getProperty("accountprefix.customer") + "-aaa"); - setParams.put("basepac", Pac.PAC_DW); + setParams.put("basepac", BasePacType.PAC_DW); setParams.put("curinetaddr", "176.9.242.78"); Object[] params = new Object[] { user, cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),