Hi all
Attached are the JUNIT tests for the get/setCustomOptions API calls. This is a
correction of the patch sent Oct 5.
Apologies for the delay.
CC
NOTICE: This email and any attachments are confidential.
They may contain legally privileged information or
copyright material. You must not read, copy, use or
disclose them without authorisation. If you are not an
intended recipient, please contact us at once by return
email and then delete both messages and all attachments.
From f12c10df1846738a784731d29fc2b2de6641a269 Mon Sep 17 00:00:00 2001
From: Colin Coe <[EMAIL PROTECTED]>
Date: Tue, 18 Nov 2008 19:33:36 +0900
Subject: [PATCH] Correct get/setCustomOptions JUNIT tests
---
.../kickstart/profile/test/ProfileHandlerTest.java | 35 ++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/test/ProfileHandlerTest.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/test/ProfileHandlerTest.java
index 2a9cb87..d7b76f8 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/test/ProfileHandlerTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/test/ProfileHandlerTest.java
@@ -581,4 +581,39 @@ public class ProfileHandlerTest extends BaseHandlerTestCase {
KickstartFactory.saveKickstartData(ks1);
return ks1;
}
+
+ public void testCustomOptions() throws Exception {
+
+ KickstartData newProfile = createProfile();
+ List<String> options = new ArrayList<String>();
+
+ options.add("Java");
+ options.add("is");
+ options.add("the");
+ options.add("new");
+ options.add("COBOL");
+
+ assertEquals(handler.setCustomOptions(adminKey, newProfile.getLabel(),
+ options), 1);
+
+ Object[] results = handler.getCustomOptions(adminKey, newProfile.getLabel());
+ assertEquals(5, results.length);
+ }
+
+ private KickstartData createProfile() throws Exception {
+ KickstartHandler kh = new KickstartHandler();
+ Channel baseChan = ChannelFactoryTest.createTestChannel(admin);
+ KickstartableTree testTree = KickstartableTreeTest.
+ createTestKickstartableTree(baseChan);
+
+ String profileLabel = "new-ks-profile" + TestUtils.randomString();
+ kh.createProfile(adminKey, profileLabel, "none",
+ testTree.getLabel(), "localhost", "rootpw");
+
+ KickstartData newKsProfile = KickstartFactory.lookupKickstartDataByLabelAndOrgId(
+ profileLabel, admin.getOrg().getId());
+ assertNotNull(newKsProfile);
+ assertTrue(newKsProfile.getCommand("url").getArguments().contains("http"));
+ return newKsProfile;
+ }
}
--
1.5.5.1
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel