HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2013-05-24 9b8db6acd73ef3b53a855410e054cc4a7a0bac7d
could reproduce Problem with sw packages
4 files modified
18 ■■■■ changed files
hsarback/database/data.sql 2 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java 6 ●●●● patch | view | raw | blame | history
hsarback/test/de/hsadmin/remote/InitDataTest.java 4 ●●●● patch | view | raw | blame | history
hsarback/test/de/hsadmin/remote/PacMigrationTest.java 6 ●●●●● patch | view | raw | blame | history
hsarback/database/data.sql
@@ -54,8 +54,6 @@
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
    SELECT basepacket_id, basecomponent_id, 0, 4, 0, 1, 0, false, 103 FROM basepacket, basecomponent WHERE basepacket_code='PAC/DW' AND  basecomponent_code='DAEMON';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
    SELECT basepacket_id, basecomponent_id, 0, 0, 0, 1, 0, false, 203 FROM basepacket, basecomponent WHERE basepacket_code='PAC/SW' AND  basecomponent_code='DAEMON';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
    SELECT basepacket_id, basecomponent_id, 0, 4, 0, 1, 0, false, 303 FROM basepacket, basecomponent WHERE basepacket_code='PAC/WEB' AND  basecomponent_code='DAEMON';
INSERT INTO component (basepacket_id, basecomponent_id, min_quantity, max_quantity, default_quantity, increment_quantity, include_quantity, admin_only, article_number)
    SELECT basepacket_id, basecomponent_id, 0, 1, 1, 1, 1, false, 104 FROM basepacket, basecomponent WHERE basepacket_code='PAC/DW' AND  basecomponent_code='MIRROR';
hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
@@ -173,7 +173,11 @@
            for (PacComponent pc : newPacComponents) {
                BaseComponent bc = pc.getBaseComponent();
                String feature = bc.getFeature();
                int quantity = oldQuantities.get(feature).intValue();
                Integer oldQuantity = oldQuantities.get(feature);
                int quantity = 0;
                if (oldQuantity != null) {
                    quantity = oldQuantity.intValue();
                }
                int increment = newBasepac.getComponent(feature).getIncrementQuantity();
                if (quantity % increment != 0) {
                    int numOfIncrements = quantity / increment;
hsarback/test/de/hsadmin/remote/InitDataTest.java
@@ -87,6 +87,10 @@
        try {
            Object execute = client.execute(PAC_MODULE + ".add", params);
            assertTrue(execute instanceof Map<?, ?>);
            try { // wait for pac creation
                Thread.sleep(10000L);
            } catch (InterruptedException e) {
            }
            cas.setPassword(client, "aaa00");
        } catch (XmlRpcException e) {
            fail(e.getMessage());
hsarback/test/de/hsadmin/remote/PacMigrationTest.java
@@ -63,7 +63,7 @@
            String grantingTicketURL = cas.getGrantingTicketURL(user);
            Object execute = addPac(user, grantingTicketURL, 
                    "aaa05", BasePacType.PAC_SW, "176.9.242.77",
                    1024, 8, 0);
                    1024, 8, -1);
            assertEquals(count + 1, getPacsCount());
            validateAddedPac(execute, BasePacType.PAC_SW, 1024, 8, -1);
            setPacAdminPassword(user, grantingTicketURL, "aaa05", "test123");
@@ -186,7 +186,9 @@
        HashMap<String, String> components = new HashMap<String, String>();
        components.put("QUOTA", Integer.toString(quota));
        components.put("TRAFFIC", Integer.toString(traffic));
        components.put("DAEMON", Integer.toString(daemons));
        if (daemons >= 0) {
            components.put("DAEMON", Integer.toString(daemons));
        }
        setParams.put("components", components);
        Object[] params = new Object[] { user, 
                cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),