1 martin 1.4 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.5 //
|
3 martin 1.4 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.5 //
|
10 martin 1.4 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.5 //
|
17 martin 1.4 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.5 //
|
20 martin 1.4 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.5 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.4 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.5 //
|
28 martin 1.4 //////////////////////////////////////////////////////////////////////////
|
29 vageesh.umesh 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 /**
33 This file has testcases that are added to cover the functions in
34 Pegasus/ProviderManager2/ProviderName.cpp.
35 */
36
37 #include <Pegasus/ProviderManager2/ProviderName.h>
38 #include <Pegasus/Common/PegasusAssert.h>
39
40 PEGASUS_USING_PEGASUS;
41 PEGASUS_USING_STD;
42
43 static char * verbose;
44
45 void test01()
46 {
47 /**
48 Added to cover the Function
49 ProviderName::ProviderName(
|
50 dmitry.mikulin 1.3 const String& moduleName,
51 const String & logicalName,
52 const String & physicalName)
|
53 vageesh.umesh 1.1 */
|
54 dmitry.mikulin 1.3 ProviderName pnobj(
55 "dummymodulename",
56 "dummylogicalname",
57 "dummyphysicalname");
|
58 vageesh.umesh 1.1
59 /**
60 Added to cover the Function
|
61 dmitry.mikulin 1.3 String ProviderName::getModuleName(void) const
|
62 vageesh.umesh 1.1 */
|
63 dmitry.mikulin 1.3 String get_module_name = pnobj.getModuleName();
64 PEGASUS_TEST_ASSERT(get_module_name == "dummymodulename");
|
65 vageesh.umesh 1.1
66 /**
67 Added to cover the Function
68 String ProviderName::getLogicalName(void) const
69 */
70 String get_logical_name = pnobj.getLogicalName();
71 PEGASUS_TEST_ASSERT(get_logical_name == "dummylogicalname");
72
73 /**
74 Added to cover the Functions
75 void ProviderName::setLocation(const String &location)
76 AND
77 String ProviderName::getLocation(void) const
78 */
|
79 dmitry.mikulin 1.3 pnobj.setLocation("//localhost/root/dummy");
80 String get_loc = pnobj.getLocation();
|
81 vageesh.umesh 1.1 PEGASUS_TEST_ASSERT(get_loc == "//localhost/root/dummy");
82 }
83
84 int main(int argc, char** argv)
85 {
86 try
87 {
88 test01();
89 }
|
90 kumpf 1.2 catch (Exception& e)
|
91 vageesh.umesh 1.1 {
|
92 kumpf 1.2 PEGASUS_STD(cout) << "Exception: " << e.getMessage() <<
93 PEGASUS_STD(endl);
|
94 vageesh.umesh 1.1 exit(1);
95 }
96
|
97 kumpf 1.2 PEGASUS_STD(cout) << argv[0] << " +++++ passed all tests" <<
98 PEGASUS_STD(endl);
|
99 vageesh.umesh 1.1 return 0;
100 }
|