*not part of the buils*
update for URP connect a=lsv@sparc.spb.su sep@sparc.spb.su git-svn-id: svn://10.0.0.236/trunk@93614 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -53,8 +53,7 @@ LIBS = -L./ -L$(DIST)/bin/components/ $(XPCOM_LIBS) $(NSPR_LIBS) $(EX
|
||||
../urpManager.o \
|
||||
../transport/llTransport.o ../transport/urpPacket.o \
|
||||
../transport/urpTransport.o \
|
||||
-L../../java/src -lbcjavastubs \
|
||||
-L$(DIST)/lib/components/ \
|
||||
-L../../java/src \
|
||||
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
../transport/llTransport.o ../transport/urpPacket.o \
|
||||
|
||||
55
mozilla/java/xpcom/urp/src/test/client/Makefile.in
Normal file
55
mozilla/java/xpcom/urp/src/test/client/Makefile.in
Normal file
@@ -0,0 +1,55 @@
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Sergey Lunegov <lsv@sparc.spb.su>
|
||||
|
||||
DEPTH = ../../../../../../
|
||||
topsrcdir = ../../../../../../
|
||||
srcdir = .
|
||||
VPATH = .
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
|
||||
#XPIDLSRCS = urpITest.idl
|
||||
|
||||
PROGRAM = client
|
||||
|
||||
CXXFLAGS += -I$(topsrcdir)/java/xpcom/xpcom -I$(JDKHOME)/include -I$(topsrcdir)/java/xpcom/java/src -I$(topsrcdir)/java/xpcom/connect/xpcom -I../../transport -I../
|
||||
|
||||
CPPSRCS = \
|
||||
client.cpp \
|
||||
$(NULL)
|
||||
|
||||
LIBS = -L./ -L$(DIST)/bin/components/ $(XPCOM_LIBS) $(NSPR_LIBS) $(EXTRA_DSO_LIBS) \
|
||||
../../urpStub.o \
|
||||
../../urpManager.o \
|
||||
../urpTestImpl.o \
|
||||
../../transport/llTransport.o ../../transport/urpPacket.o \
|
||||
../../transport/urpTransport.o
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
||||
|
||||
|
||||
160
mozilla/java/xpcom/urp/src/test/client/client.cpp
Normal file
160
mozilla/java/xpcom/urp/src/test/client/client.cpp
Normal file
@@ -0,0 +1,160 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Sun Microsystems,
|
||||
* Inc. Portions created by Sun are
|
||||
* Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sergey Lunegov <lsv@sparc.spb.su>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "urpTestImpl.h"
|
||||
#include "nsIInterfaceInfo.h"
|
||||
#include "nsIInterfaceInfoManager.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************/
|
||||
|
||||
#include "nsIModule.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "bcIXPCOMStubsAndProxies.h"
|
||||
#include "bcXPCOMStubsAndProxiesCID.h"
|
||||
#include "bcIORBComponent.h"
|
||||
#include "bcORBComponentCID.h"
|
||||
#include "bcIStub.h"
|
||||
#include "urpStub.h"
|
||||
|
||||
static NS_DEFINE_CID(kORBCIID,BC_ORBCOMPONENT_CID);
|
||||
static NS_DEFINE_CID(kXPCOMStubsAndProxies,BC_XPCOMSTUBSANDPROXIES_CID);
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
nsIInterfaceInfo *interfaceInfo;
|
||||
nsIInterfaceInfoManager* iimgr;
|
||||
char *connectString = argv[1];
|
||||
nsresult rv = NS_InitXPCOM(NULL, NULL);
|
||||
bcIID iid = NS_GET_IID(urpITest);
|
||||
if( (iimgr = XPTI_GetInterfaceInfoManager()) ) {
|
||||
if (NS_FAILED(iimgr->GetInfoForIID(&iid, &interfaceInfo))) {
|
||||
return NS_ERROR_FAILURE; //nb exception handling
|
||||
}
|
||||
NS_RELEASE(iimgr);
|
||||
} else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult r;
|
||||
NS_WITH_SERVICE(bcIORBComponent, _orb, kORBCIID, &r);
|
||||
if (NS_FAILED(r)) {
|
||||
printf("--urpTestImpl test failed\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_WITH_SERVICE(bcIXPCOMStubsAndProxies, xpcomStubsAndProxies, kXPCOMStubsAndProxies, &r);
|
||||
if (NS_FAILED(r)) {
|
||||
printf("--urpTestImpl test failed\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
bcIORB *orb;
|
||||
_orb->GetORB(&orb);
|
||||
bcIStub *stub = NULL;
|
||||
urpITest *object = new urpTestImpl();
|
||||
object->AddRef();
|
||||
urpITest *proxy = NULL;
|
||||
stub = new urpStub(connectString);
|
||||
bcOID oid = orb->RegisterStub(stub);
|
||||
printf("---urpTestImpl iid=%s\n",NS_GET_IID(urpITest).ToString());
|
||||
r = xpcomStubsAndProxies->GetProxy(oid,NS_GET_IID(urpITest),orb,(nsISupports**)&proxy);
|
||||
if (NS_FAILED(r)) {
|
||||
printf("--urpTestImpl test failed\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/*******************************************/
|
||||
char ** valueArray = (char **)malloc(sizeof(char*)*4);
|
||||
valueArray[0] = "hi";
|
||||
valueArray[1] = "there";
|
||||
valueArray[2] = "a";
|
||||
valueArray[3] = "b";
|
||||
|
||||
PRInt32 l1 = 1999;
|
||||
PRInt32 ret;
|
||||
PRInt32 rt;
|
||||
object->Test1(&l1);
|
||||
l1 = 1999;
|
||||
proxy->Test1(&l1);
|
||||
printf("--urpTestImpl after Test1 l=%d %d\n",l1,ret);
|
||||
/*******************************************/
|
||||
PRInt32 l2 = 2000;
|
||||
l1 = 1999;
|
||||
proxy->Test2(l1,&l2);
|
||||
printf("--urpTestImpl after Test2 l2=%d\n",l2);
|
||||
|
||||
/*******************************************/
|
||||
const char * s1 = "s1";
|
||||
char * s2 = "s2";
|
||||
proxy->Test3(s1,&s2);
|
||||
printf("--urpTestImpl after Test3 s2=%s\n",s2);
|
||||
/*******************************************/
|
||||
|
||||
|
||||
proxy->Test4(4,(const char **)valueArray);
|
||||
/*******************************************/
|
||||
|
||||
char ***valueArray2 = &valueArray;
|
||||
|
||||
printf("call object\n");
|
||||
for (unsigned int i = 0; i < 4; i++) {
|
||||
printf("valueArray[%d]=%s\n",i,(*valueArray2)[i]);
|
||||
}
|
||||
object->Test5(4,valueArray2);
|
||||
printf("after calling object\n");
|
||||
for (unsigned int i = 0; i < 4; i++) {
|
||||
printf("valueArray[%d]=%s\n",i,(*valueArray2)[i]);
|
||||
}
|
||||
|
||||
|
||||
valueArray2 = (char ***)&valueArray;
|
||||
proxy->Test5(4,valueArray2);
|
||||
for (unsigned int i = 0; i < 4; i++) {
|
||||
printf("valueArray[%d]=%s\n",i,(*valueArray2)[i]);
|
||||
}
|
||||
|
||||
/*********************************************/
|
||||
proxy->Test6(object);
|
||||
/*********************************************/
|
||||
{
|
||||
urpITest *p1;
|
||||
proxy->Test7(&p1);
|
||||
printf("p1=%p",p1);
|
||||
PRInt32 l = 1234;
|
||||
PRInt32 r;
|
||||
p1->Test1(&l);
|
||||
urpITest *p3;
|
||||
printf("--before QueryInterface calling \n");
|
||||
if (NS_SUCCEEDED(p1->QueryInterface(NS_GET_IID(urpITest),(void**)&p3))) {
|
||||
l=2000;
|
||||
p3->Test1(&l);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ printf("ne tak zdes\n");
|
||||
object->AddRef();
|
||||
urpITest *proxy = NULL;
|
||||
// xpcomStubsAndProxies->GetStub((nsISupports*)object, &stub);
|
||||
stub = new urpStub();
|
||||
stub = new urpStub("socket,host=shiva,port=2009");
|
||||
printf("yatatatata\n");
|
||||
bcOID oid = orb->RegisterStub(stub);
|
||||
printf("---urpTestImpl iid=%s\n",NS_GET_IID(urpITest).ToString());
|
||||
|
||||
Reference in New Issue
Block a user