![]() ![]() |
![]() |
File: [Pegasus] / pegasus-JavaCIMClient / cimclient / tests / ClientUnitTests / TestMultiConnections.java
(download)
Revision: 1.1, Thu Jul 17 17:32:55 2003 UTC (20 years, 11 months ago) by kumpf Branch: MAIN CVS Tags: test, pegasus25BeforeLicenseUpdate, local, TEST, SLPPERFINST-root, SLPPERFINST-branch, RELEASE_2_4_FC_CANDIDATE_1, RELEASE_2_4_1-BETA3, RELEASE_2_4_1-BETA2, RELEASE_2_4_1-BETA1, RELEASE_2_4_1, RELEASE_2_4_0-RC3, RELEASE_2_4_0-RC2, RELEASE_2_4_0, RELEASE_2_4-root, RELEASE_2_4-branch, RELEASE_2_3_2-testfreeze, RELEASE_2_3_2-root, RELEASE_2_3_2-releasesnapshot, RELEASE_2_3_2-branch-freeze, RELEASE_2_3_2-branch, RELEASE_2_3_1-root, RELEASE_2_3_1-branch, RELEASE_2_3_0-root, RELEASE_2_3_0-msg-freeze, RELEASE_2_3_0-branch, PRE_LICENSE_UPDATE_2003, POST_LICENSE_UPDATE_2003, PEP217_PRE_BRANCH, PEP217_POST_BRANCH, PEP217_BRANCH, PEP214ROOT, PEP214BRANCH, PEP214-root, PEP214-branch, PEP213_SIZE_OPTIMIZATIONS, PEP-214B-root, PEG25_IBM_5_16_05, MONITOR_CONSOLIDATION_2_5_BRANCH, IBM_241_April1405, HPUX_TEST, HEAD, CQL_2_5_BRANCH, CHUNKTESTDONE_PEP140, BUG2493_BINREP-root, BUG2493_BINREP-branch Branch point for: pep_88 HP-BAPU: PEP-64 CIM Client and CIM Listener Java Interface |
package tests.ClientUnitTests; import org.snia.wbem.cim.*; import org.snia.wbem.client.*; import java.net.*; import java.util.*; public class TestMultiConnections { private final static int m_portNum = 5989; private final static String m_namespace = "root/cimv2"; public static void main(String[] args) { try { String m_serverPath = "http://sequoia.cup.hp.com:" + m_portNum; CIMNameSpace cnamespace = new CIMNameSpace( m_serverPath, m_namespace ); CIMClient m_clientObj=null; //good user/password m_clientObj = new CIMClient( cnamespace,"guest","guest", CIMClient.XML); CIMObjectPath cimPath = new CIMObjectPath("PG_OperatingSystem",m_namespace); CIMClass cc=null; try { cc = m_clientObj.getClass(cimPath,false); System.out.println("CIMOM login success"); } catch(CIMException cxe) { System.out.println("CIMOM login failed"); } m_clientObj.close(); } catch(CIMException ce) { //String msg = ce.getMessage(); //System.out.println("CIMEXception msg " + msg); System.out.println("here is the excep"); ce.printStackTrace(); } catch(Exception ue) { System.out.println(ue.getMessage()); } //second time with a different password try { String m_serverPath = "http://sequoia.cup.hp.com:" + m_portNum; CIMNameSpace cnamespace = new CIMNameSpace( m_serverPath, m_namespace ); CIMClient m_clientObj=null; // bad username/password m_clientObj = new CIMClient( cnamespace,"abc","abc", CIMClient.XML); CIMObjectPath cimPath = new CIMObjectPath("PG_OperatingSystem",m_namespace); CIMClass cc=null; try { cc = m_clientObj.getClass(cimPath,false); System.out.println("CIMOM login success"); } catch(CIMException cxe) { System.out.println("CIMOM login failed"); } m_clientObj.close(); } catch(CIMException ce) { //String msg = ce.getMessage(); //System.out.println("CIMEXception msg " + msg); System.out.println("here is the excep"); ce.printStackTrace(); } catch(Exception ue) { System.out.println(ue.getMessage()); } } }
No CVS admin address has been configured |
Powered by ViewCVS 0.9.2 |