irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

testMS.cpp
Go to the documentation of this file.
1 
3 //#include "reGlobalsExtern.hpp"
4 //#include "reFuncDefs.hpp"
6 
7 int
9 
13  RE_TEST_MACRO( "Test for print_hello\n" );
14  fprintf( stdout, "Hello\n" );
15  _writeString( "stdout", "Hello\n", rei );
16  return 0;
17 }
18 int
20  RE_TEST_MACRO( "\b\b\b\b\b \b\b\b\b\b" );
21  fprintf( stdout, "\b\b\b\b\b \b\b\b\b\b" );
22  return 0;
23 }
24 
25 int
27  rodsLog( LOG_NOTICE, " objPath = %s\n", doi->objPath );
28  rodsLog( LOG_NOTICE, " rescName= %s\n", doi->rescName );
29  rodsLog( LOG_NOTICE, " dataType= %s\n", doi->dataType );
30  rodsLog( LOG_NOTICE, " dataSize= %lld\n", doi->dataSize );
31  return 0;
32 }
33 
34 
35 int
37  rodsLog( LOG_NOTICE, " userName= %s\n", uoi->userName );
38  rodsLog( LOG_NOTICE, " rodsZone= %s\n", uoi->rodsZone );
39  rodsLog( LOG_NOTICE, " userType= %s\n", uoi->userType );
40 
41  return 0;
42 }
43 
44 int msiAW1( msParam_t* mPIn, msParam_t* mPOut2, ruleExecInfo_t* ) {
45  char *In;
46 
47  In = ( char * ) mPIn->inOutStruct;
48 
49  rodsLog( LOG_NOTICE, "ALPHA: ------> In:%s\n", In );
50  mPOut2->type = strdup( STR_MS_T );
51  mPOut2->inOutStruct = strdup( "Microservice_1" );
52  return 0;
53 
54 }
55 
56 
58 
59  RE_TEST_MACRO( "Test for msiCutBufferInHalf\n" );
60 
61  if ( mPIn == NULL || mPIn->inpOutBuf == NULL ) {
62  rodsLog( LOG_ERROR, "msiCutBufferInHalf: input is NULL." );
63  return USER__NULL_INPUT_ERR;
64  }
65  mPIn->inpOutBuf->len = ( mPIn->inpOutBuf->len ) / 2;
66  return 0;
67 
68 }
69 
70 
115 int
117  keyValPair_t *myKeyVal; /* will contain results */
118 
119  /* For testing mode when used with irule --test */
120  RE_TEST_MACRO( " Calling msiDoSomething" )
121 
122  /* Sanity checks */
123  if ( rei == NULL || rei->rsComm == NULL ) {
124  rodsLog( LOG_ERROR, "msiDoSomething: input rei or rsComm is NULL." );
126  }
127 
128  /* myKeyVal init */
129  myKeyVal = ( keyValPair_t* ) malloc( sizeof( keyValPair_t ) );
130  memset( myKeyVal, 0, sizeof( keyValPair_t ) );
131 
132 
133 
134 
135 
137  /* Return myKeyVal through outParam */
138  outParam->type = strdup( KeyValPair_MS_T );
139  outParam->inOutStruct = ( void* ) myKeyVal;
140 
141  return 0;
142 }
143 
144 int
146  msParam_t* arg1,
147  msParam_t* arg2,
148  msParam_t* arg3,
149  ruleExecInfo_t* rei) {
150 
151  return 0;
152 }
153 
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
SYS_INTERNAL_NULL_INPUT_ERR
@ SYS_INTERNAL_NULL_INPUT_ERR
Definition: rodsErrorTable.h:92
recover_print_hello
int recover_print_hello(ruleExecInfo_t *rei)
Definition: testMS.cpp:19
userInfo_t
Definition: rodsUser.h:65
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
_writeString
int _writeString(char *writeId, char *writeStr, ruleExecInfo_t *rei)
Definition: irods_re_structs.cpp:278
DataObjInfo::dataType
char dataType[64]
Definition: objInfo.h:133
print_doi
int print_doi(dataObjInfo_t *doi)
Definition: testMS.cpp:26
msiAW1
int msiAW1(msParam_t *mPIn, msParam_t *mPOut2, ruleExecInfo_t *)
Definition: testMS.cpp:44
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
print_uoi
int print_uoi(userInfo_t *uoi)
Definition: testMS.cpp:36
MsParam::type
char * type
Definition: msParam.h:78
STR_MS_T
#define STR_MS_T
Definition: msParam.h:21
RuleExecInfo::rsComm
rsComm_t * rsComm
Definition: irods_re_structs.hpp:22
BytesBuf::len
int len
Definition: rodsDef.h:198
print_hello
int print_hello(ruleExecInfo_t *rei)
Definition: testMS.cpp:8
msiDoSomething
int msiDoSomething(msParam_t *, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: testMS.cpp:116
userInfo_t::rodsZone
char rodsZone[64]
Definition: rodsUser.h:67
MsParam
Definition: msParam.h:76
msiCutBufferInHalf
int msiCutBufferInHalf(msParam_t *mPIn, ruleExecInfo_t *rei)
Definition: testMS.cpp:57
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
MsParam::inpOutBuf
bytesBuf_t * inpOutBuf
Definition: msParam.h:81
userInfo_t::userType
char userType[64]
Definition: rodsUser.h:68
msiTakeThreeArgumentsAndDoNothing
int msiTakeThreeArgumentsAndDoNothing(msParam_t *arg1, msParam_t *arg2, msParam_t *arg3, ruleExecInfo_t *rei)
Definition: testMS.cpp:145
DataObjInfo::rescName
char rescName[64]
Definition: objInfo.h:131
KeyValPair_MS_T
#define KeyValPair_MS_T
Definition: msParam.h:37
RuleExecInfo
Definition: irods_re_structs.hpp:18
RE_TEST_MACRO
#define RE_TEST_MACRO(msg)
Definition: reDefines.h:58
icatHighLevelRoutines.hpp
DataObjInfo::objPath
char objPath[(1024+64)]
Definition: objInfo.h:130
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
KeyValPair
Definition: objInfo.h:120
DataObjInfo
Definition: objInfo.h:129
DataObjInfo::dataSize
rodsLong_t dataSize
Definition: objInfo.h:134
USER__NULL_INPUT_ERR
@ USER__NULL_INPUT_ERR
Definition: rodsErrorTable.h:247