*not part of the build*

fix for 80938
a = avm@sparc.spb.su
    ovk@sparc.spb.su
    sva@sparc.spb.su

Tests for blackConnect


git-svn-id: svn://10.0.0.236/trunk@95860 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
idk%eng.sun.com
2001-05-24 05:22:13 +00:00
parent d74ff774aa
commit 6e4a0fdecc
214 changed files with 17250 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS= \
params \
mthreads \
stress \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,33 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH = ..\..\..\..
DIRS= \
params \
mthreads\
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,2 @@
a3532005-66d4-4988-8067-dd1928c60138
component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent1

View File

@@ -0,0 +1,114 @@
/* -*- Mode: Java; 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):
Client QA Team, St. Petersburg, Russia
*/
import org.mozilla.xpcom.*;
import java.lang.reflect.*;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
public class MThreadComponent1 implements iMThreadComponent1, iMThreadComponent {
private iMThreadContext context = null;
public MThreadComponent1() {
System.out.println("DEbug:avm:MThreadComponent1 constructor");
}
public void initialize(iMThreadContext context) {
System.out.println("DEbug:avm:MThreadComponent1:initialize Thread is " + Thread.currentThread().getName());
this.context = context;
}
public iMThreadComponent loadComponent(CID classID) {
System.out.println("DEbug:avm:MThreadComponent1:loadComponent");
nsIComponentManager cm = context.getComponentManager();
nsIFactory factory = cm.findFactory(classID);
if(factory == null) {
System.out.println("DEbug:avm:Factory is NULL!!!!!");
return null;
}
iMThreadComponent component = (iMThreadComponent)factory.createInstance(null, iMThreadComponent.IID);
return component;
}
/* void Execute (); */
public void execute(String tName) {
System.out.println("DEbug:avm:MThreadComponent1:execute.");
String cThreadName = Thread.currentThread().getName();
if(tName.equals(cThreadName)) {
System.out.println("PASSED: original and expected names equals to " + tName);
} else {
System.out.println("FAILED: Current thread name is " + cThreadName + " instead of " + tName );
}
CID classID = new CID(context.getNext());
iMThreadComponent component = loadComponent(classID);
if(component == null) {
System.out.println("Can't load component");
return;
}
System.out.println("Initialize of " + component + " called in thread " + cThreadName);
component.initialize(context);
(new ExecutionThread(component)).run();
//component.execute();
}
public Object queryInterface(IID iid) {
System.out.println("DEbug:avm:MThreadComponent1::queryInterface iid="+iid);
if ( iid.equals(nsISupports.IID)
|| iid.equals(iMThreadComponent1.IID)||iid.equals(iMThreadComponent.IID)) {
return this;
} else {
return null;
}
}
static CID J2XINServerCID = new CID("1ddc5b10-9852-11d4-aa22-00a024a8bbac");
static {
try {
Class nsIComponentManagerClass =
Class.forName("org.mozilla.xpcom.nsIComponentManager");
InterfaceRegistry.register(nsIComponentManagerClass);
Class iMThreadComponentClass =
Class.forName("org.mozilla.xpcom.iMThreadComponent");
InterfaceRegistry.register(iMThreadComponentClass);
Class iMThreadContextClass =
Class.forName("org.mozilla.xpcom.iMThreadContext");
InterfaceRegistry.register(iMThreadContextClass);
Class nsIFactoryClass =
Class.forName("org.mozilla.xpcom.nsIFactory");
InterfaceRegistry.register(nsIFactoryClass);
} catch (Exception e) {
e.printStackTrace();
} catch (Error e) {
e.printStackTrace();
}
}
}

View 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):
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
JAVA_OR_NSJVM=1
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
JAVA_SRC = \
MThreadComponent1.java
JAVAI_SRC = \
iMThreadComponent1.java
MThreadComponent1.jar.comp: manifest MThreadComponent1.class
$(JDKHOME)/bin/jar cvfm MThreadComponent1.jar.comp manifest *.class
MThreadComponent1.class:
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes $(JAVA_SRC)
export::
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes -d $(DEPTH)/dist/classes $(JAVAI_SRC)
install-component: MThreadComponent1.jar.comp MThreadComponent1.jar.info
cp -f MThreadComponent1.jar* $(DIST)/bin/components
clobber::
rm -f *.class *.jar.comp
rm -f $(DIST)/bin/components/MThreadComponent1.jar.*
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1,47 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
[scriptable, uuid(542a9e2e-b5f0-4381-8643-b758571f2b58)]
interface iMThreadComponent1 : nsISupports
{
};
%{ C++
#define MTHREADCOMPONENT1_CID \
{ /* a3532005-66d4-4988-8067-dd1928c60138 */ \
0xa3532005, \
0x66d4, \
0x4988, \
{0x80, 0x67, 0xdd, 0x19, 0x28, 0xc6, 0x01, 0x38} \
}
#define MTHREADCOMPONENT1_PROGID "component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent1"
%}

View File

@@ -0,0 +1,27 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iMThreadComponent1.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iMThreadComponent1
*
* IID: 0x542a9e2e-b5f0-4381-8643-b758571f2b58
*/
public interface iMThreadComponent1 extends nsISupports
{
public static final IID IID =
new IID("542a9e2e-b5f0-4381-8643-b758571f2b58");
}
/*
* end
*/

View File

@@ -0,0 +1,53 @@
#!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):
DEPTH=..\..\..\..\..\..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
JAVA_OR_NSJVM=1
include <$(topsrcdir)\config\rules.mak>
JAVA_SRC = \
MThreadComponent1.java
JAVAI_SRC = \
iMThreadComponent1.java
MThreadComponent1.jar.comp: manifest MThreadComponent1.class
$(JDKHOME)\bin\jar cvfm MThreadComponent1.jar.comp manifest *.class
MThreadComponent1.class:
$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes $(JAVA_SRC)
export::
$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes -d $(DEPTH)\dist\classes $(JAVAI_SRC)
install-component: MThreadComponent1.jar.comp MThreadComponent1.jar.info
copy MThreadComponent1.jar* $(DIST)\bin\components
clobber::
del /f *.class *.jar.comp
del /f $(DIST)\bin\components\MThreadComponent1.jar.*
del /f $(DIST)\..\classes\org\mozilla\xpcom\iMThreadComponent1.class
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1 @@
Component-Class: MThreadComponent1

View File

@@ -0,0 +1,330 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from /export2/avm/PR3/mozilla/dist/bin/../idl/nsIComponentManager.idl.
*/
package org.mozilla.xpcom;
/**
* Interface nsIComponentManager
*
* IID: 0x8458a740-d5dc-11d2-92fb-00e09805570f
*/
public interface nsIComponentManager extends nsISupports
{
public static final String IID =
"8458a740-d5dc-11d2-92fb-00e09805570f";
/**
* findFactory
*
* Returns the factory object that can be used to create instances of
* CID aClass
*
* @param aClass The classid of the factory that is being requested
*/
/* nsIFactory findFactory (in nsCIDRef aClass); */
public nsIFactory findFactory(IID aClass);
/**
* getClassObject
*
* @param aClass : CID of the class whose class object is requested
* @param aIID : IID of an interface that the class object is known to
* to implement. nsISupports and nsIFactory are known to
* be implemented by the class object.
*/
/**
* contractIDToClassID
*
* Get the ClassID for a given ContractID. Many ClassIDs may implement a
* ContractID. In such a situation, this returns the preferred ClassID, which
* happens to be the last registered ClassID.
*
* @param aContractID : Contractid for which ClassID is requested
* @return aClass : ClassID return
*/
/**
* classIDToContractid
*
* Get the ContractID for a given ClassID. A ClassIDs may implement multiple
* ContractIDs. This function return the last registered ContractID.
*
* @param aClass : ClassID for which ContractID is requested.
* @return aClassName : returns class name asssociated with aClass
* @return : ContractID last registered for aClass
*/
/* string CLSIDToContractID (in nsCIDRef aClass, out string aClassName); */
public String cLSIDToContractID(IID aClass, String[] aClassName);
/**
* createInstance
*
* Create an instance of the CID aClass and return the interface aIID.
*
* @param aClass : ClassID of object instance requested
* @param aDelegate : Used for aggregation
* @param aIID : IID of interface requested
*/
/**
* createInstanceByContractID
*
* Create an instance of the CID that implements aContractID and return the
* interface aIID. This is a convenience function that effectively does
* ContractIDToClassID() followed by CreateInstance().
*
* @param aContractID : aContractID of object instance requested
* @param aDelegate : Used for aggregation
* @param aIID : IID of interface requested
*/
/**
* registryLocationForSpec
*
* Given a file specification, return the registry representation of
* the filename. Files that are found relative to the components
* directory will have a registry representation
* "rel:<relative-native-path>" while filenames that are not, will have
* "abs:<full-native-path>".
*/
/* string registryLocationForSpec (in nsIFile aSpec); */
public String registryLocationForSpec(nsIFile aSpec);
/**
* specForRegistyLocation
*
* Create a file specification for the registry representation (rel:/abs:)
* got via registryLocationForSpec.
*/
/* nsIFile specForRegistryLocation (in string aLocation); */
public nsIFile specForRegistryLocation(String aLocation);
/**
* registerFactory
*
* Register a factory and ContractID associated with CID aClass
*
* @param aClass : CID of object
* @param aClassName : Class Name of CID
* @param aContractID : ContractID associated with CID aClass
* @param aFactory : Factory that will be registered for CID aClass
* @param aReplace : Boolean that indicates whether to replace a previous
* registration for the CID aClass.
*/
/* void registerFactory (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFactory aFactory, in boolean aReplace); */
public void registerFactory(IID aClass, String aClassName, String aContractID, nsIFactory aFactory, boolean aReplace);
/**
* registerComponent
*
* Register a native dll module via its registry representation as returned
* by registryLocationForSpec() as the container of CID implemenation
* aClass and associate aContractID and aClassName to the CID aClass. Native
* dll component type is assumed.
*
* @param aClass : CID implemenation contained in module
* @param aClassName : Class name associated with CID aClass
* @param aContractID : ContractID associated with CID aClass
* @param aLocation : Location of module (dll). Format of this is the
* registry representation as returned by
* registryLocationForSpec()
* @param aReplace : Boolean that indicates whether to replace a previous
* module registration for aClass.
* @param aPersist : Remember this registration across sessions.
*/
/* void registerComponent (in nsCIDRef aClass, in string aClassName, in string aContractID, in string aLocation, in boolean aReplace, in boolean aPersist); */
public void registerComponent(IID aClass, String aClassName, String aContractID, String aLocation, boolean aReplace, boolean aPersist);
/**
* registerComponentWithType
*
* Register a module's location via its registry representation
* as returned by registryLocationForSpec() as the container of CID implemenation
* aClass of type aType and associate aContractID and aClassName to the CID aClass.
*
* @param aClass : CID implemenation contained in module
* @param aClassName : Class name associated with CID aClass
* @param aContractID : ContractID associated with CID aClass
* @param aSpec : Filename spec for module's location.
* @param aLocation : Location of module of type aType. Format of this string
* is the registry representation as returned by
* registryLocationForSpec()
* @param aReplace : Boolean that indicates whether to replace a previous
* loader registration for aClass.
* @param aPersist : Remember this registration across sessions.
* @param aType : Component Type of CID aClass.
*/
/* void registerComponentWithType (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aSpec, in string aLocation, in boolean aReplace, in boolean aPersist, in string aType); */
public void registerComponentWithType(IID aClass, String aClassName, String aContractID, nsIFile aSpec, String aLocation, boolean aReplace, boolean aPersist, String aType);
/**
* registerComponentSpec
*
* Register a native dll module via its file specification as the container
* of CID implemenation aClass and associate aContractID and aClassName to the
* CID aClass. Native dll component type is assumed.
*
* @param aClass : CID implemenation contained in module
* @param aClassName : Class name associated with CID aClass
* @param aContractID : ContractID associated with CID aClass
* @param aLibrary : File specification Location of module (dll).
* @param aReplace : Boolean that indicates whether to replace a previous
* module registration for aClass.
* @param aPersist : Remember this registration across sessions.
*/
/* void registerComponentSpec (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aLibrary, in boolean aReplace, in boolean aPersist); */
public void registerComponentSpec(IID aClass, String aClassName, String aContractID, nsIFile aLibrary, boolean aReplace, boolean aPersist);
/**
* registerComponentLib
*
* Register a native dll module via its dll name (not full path) as the
* container of CID implemenation aClass and associate aContractID and aClassName
* to the CID aClass. Native dll component type is assumed and the system
* services will be used to load this dll.
*
* @param aClass : CID implemenation contained in module
* @param aClassName : Class name associated with CID aClass
* @param aContractID : ContractID associated with CID aClass
* @param aDllNameLocation : Dll name of module.
* @param aReplace : Boolean that indicates whether to replace a previous
* module registration for aClass.
* @param aPersist : Remember this registration across sessions.
*/
/* void registerComponentLib (in nsCIDRef aClass, in string aClassName, in string aContractID, in string aDllName, in boolean aReplace, in boolean aPersist); */
public void registerComponentLib(IID aClass, String aClassName, String aContractID, String aDllName, boolean aReplace, boolean aPersist);
/**
* unregisterFactory
*
* Unregister a factory associated with CID aClass.
*
* @param aClass : ClassID being unregistered
* @param aFactory : Factory previously registered to create instances of
* ClassID aClass.
*/
/* void unregisterFactory (in nsCIDRef aClass, in nsIFactory aFactory); */
public void unregisterFactory(IID aClass, nsIFactory aFactory);
/**
* unregisterComponent
*
* Disassociate module aLocation represented as registry location as returned
* by registryLocationForSpec() as containing ClassID aClass.
*
* @param aClass : ClassID being unregistered
* @param aLocation : Location of module. Format of this is the registry
* representation as returned by registryLocationForSpec().
* Components of any type will be unregistered.
*/
/* void unregisterComponent (in nsCIDRef aClass, in string aLocation); */
public void unregisterComponent(IID aClass, String aLocation);
/**
* unregisterComponentSpec
*
* Disassociate module references by file specification aLibrarySpec as
* containing ClassID aClass.
*/
/* void unregisterComponentSpec (in nsCIDRef aClass, in nsIFile aLibrarySpec); */
public void unregisterComponentSpec(IID aClass, nsIFile aLibrarySpec);
/**
* freeLibraries
*
* Enumerates all loaded modules and unloads unused modules.
*/
/* void freeLibraries (); */
public void freeLibraries();
/**
* ID values for 'when'
*/
/* const long NS_Startup = 0; */
public static final int NS_Startup = 0;
/* const long NS_Script = 1; */
public static final int NS_Script = 1;
/* const long NS_Timer = 2; */
public static final int NS_Timer = 2;
/* const long NS_Shutdown = 3; */
public static final int NS_Shutdown = 3;
/**
* autoRegister
*
* Enumerates directory looking for modules of all types and registers
* modules who have changed (modtime or size) since the last time
* autoRegister() was invoked.
*
* @param when : ID values of when the call is being made.
* @param directory : Directory the will be enumerated.
*/
/* void autoRegister (in long when, in nsIFile directory); */
public void autoRegister(int when, nsIFile directory);
/**
* autoRegisterComponent
*
* Loads module using appropriate loader and gives it an opportunity to
* register its CIDs if module's modtime or size changed since the last
* time this was called.
*
* @param when : ID values of when the call is being made.
* @param aFileLocation : File specification of module.
*/
/* void autoRegisterComponent (in long when, in nsIFile aFileLocation); */
public void autoRegisterComponent(int when, nsIFile aFileLocation);
/**
* autoUnregisterComponent
*
* Loads module using approriate loader and gives it an opportunity to
* unregister its CIDs
*/
/* void autoUnregisterComponent (in long when, in nsIFile aFileLocation); */
public void autoUnregisterComponent(int when, nsIFile aFileLocation);
/**
* isRegistered
*
* Returns true if a factory or module is registered for CID aClass.
*
* @param aClass : ClassID queried for registeration
* @return : true if a factory or module is registered for CID aClass.
* false otherwise.
*/
/* boolean isRegistered (in nsCIDRef aClass); */
public boolean isRegistered(IID aClass);
/**
* enumerateCLSIDs
*
* Enumerate the list of all registered ClassIDs.
*
* @return : enumerator for ClassIDs.
*/
/* nsIEnumerator enumerateCLSIDs (); */
public nsIEnumerator enumerateCLSIDs();
/**
* enumerateContractIDs
*
* Enumerate the list of all registered ContractIDs.
*
* @return : enumerator for ContractIDs.
*/
/* nsIEnumerator enumerateContractIDs (); */
public nsIEnumerator enumerateContractIDs();
}
/*
* end
*/

View File

@@ -0,0 +1,90 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "plstr.h"
#include "stdio.h"
#include "nsIComponentManager.h"
#include "MThreadComponent2.h"
#include "nsMemory.h"
#include "prthread.h"
#include <sys/stat.h>
#include <stdlib.h>
#include "nsID.h"
iMThreadContext* context;
void* iThread;
void* eThread;
MThreadComponent2Impl::MThreadComponent2Impl()
{
NS_INIT_REFCNT();
printf("MThreadComponent2Impl::MThreadComponent2Imp\n");
}
MThreadComponent2Impl::~MThreadComponent2Impl()
{
}
NS_IMPL_ISUPPORTS2(MThreadComponent2Impl, iMThreadComponent2, iMThreadComponent);
NS_IMETHODIMP MThreadComponent2Impl::Initialize(iMThreadContext* c){
context = c;
printf("MThreadComponent2Impl::Initialize\n");
iThread =(void*) PR_GetCurrentThread();
return NS_OK;
}
NS_IMETHODIMP MThreadComponent2Impl::Execute(const char* tName){
printf("MThreadComponent2Impl::Execute. Thread is %s\n", tName);
eThread = PR_GetCurrentThread();
if(eThread == iThread) {
printf("###Execute and initialize were executed in one thread\n");
}else {
printf("###Execute and initialize were executed in DIFFERENT threads\n");
}
char* progID;
context->GetNext(&progID);
nsCID classID;
classID.Parse(progID);
printf("MThreadComponent2Impl::Execute. progID is %s\n",progID);
iMThreadComponent* tComponent;
nsresult rv = nsComponentManager::CreateInstance(classID,
nsnull,
NS_GET_IID(iMThreadComponent),
(void**)&tComponent);
if(NS_FAILED(rv)) {
printf("MThreadComponent2Impl:Create instance failed from %s!!!",classID.ToString());
return rv;
}
tComponent->Initialize(context);
tComponent->Execute(tName);
}

View File

@@ -0,0 +1,39 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iMThreadComponent2.h"
#include "iMThreadComponent.h"
class MThreadComponent2Impl : public iMThreadComponent2, public iMThreadComponent
{
public:
MThreadComponent2Impl();
virtual ~MThreadComponent2Impl();
NS_DECL_ISUPPORTS
NS_DECL_IMTHREADCOMPONENT2
NS_DECL_IMTHREADCOMPONENT
};

View File

@@ -0,0 +1,46 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsIGenericFactory.h"
#include "MThreadComponent2.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(MThreadComponent2Impl)
static nsModuleComponentInfo components[] =
{
{ "X2JIN Client Test Component", MTHREADCOMPONENT2_CID, MTHREADCOMPONENT2_PROGID, MThreadComponent2ImplConstructor,
NULL /* NULL if you dont need one */,
NULL /* NULL if you dont need one */
}
};
NS_IMPL_NSGETMODULE("MThreadComponent2Factory", components)

View File

@@ -0,0 +1,49 @@
#!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):
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
MODULE = MThreadComponent2
LIBRARY_NAME = $(MODULE)
XPIDL_MODULE = $(MODULE)
IS_COMPONENT = 1
CPPSRCS = \
MThreadComponent2.cpp \
MThreadComponent2Factory.cpp \
$(NULL)
XPIDLSRCS = iMThreadComponent2.idl
DSO_LDOPTS += \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
JAVAI_SRC = iMThreadComponent2.java
include $(topsrcdir)/config/rules.mk
export::
$(JDKHOME)/bin/javac -classpath .:$(DIST)/classes -d $(DIST)/classes $(JAVAI_SRC)

View File

@@ -0,0 +1,47 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
[scriptable, uuid(c69e0aac-b0dc-40c9-a0b6-226a842dfa1b)]
interface iMThreadComponent2 : nsISupports
{
};
%{ C++
#define MTHREADCOMPONENT2_CID \
{ /* 2e4ca352-3a8a-412b-b8df-4c28c0686863 */ \
0x2e4ca352, \
0x3a8a, \
0x412b, \
{0xb8, 0xdf, 0x4c, 0x28, 0xc0, 0x68, 0x68, 0x63} \
}
#define MTHREADCOMPONENT2_PROGID "component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent2"
%}

View File

@@ -0,0 +1,27 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iMThreadComponent2.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iMThreadComponent2
*
* IID: 0xc69e0aac-b0dc-40c9-a0b6-226a842dfa1b
*/
public interface iMThreadComponent2 extends nsISupports
{
public static final IID IID =
new IID("c69e0aac-b0dc-40c9-a0b6-226a842dfa1b");
}
/*
* end
*/

View File

@@ -0,0 +1,58 @@
#!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):
DEPTH=..\..\..\..\..\..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
MODULE = MThreadComponent2
MAKE_OBJ_TYPE = DLL
DLLNAME = $(MODULE)
DLL =.\$(OBJDIR)\$(DLLNAME).dll
COMPONENT = 1
CPP_OBJS = \
.\$(OBJDIR)\MThreadComponent2.obj \
.\$(OBJDIR)\MThreadComponent2Factory.obj \
$(NULL)
XPIDLSRCS = \
.\iMThreadComponent2.idl \
$(NULL)
JAVAI = iMThreadComponent2.java
LLIBS =$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(topsrcdir)\config\rules.mak>
javai:
echo $(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes:$(CLASSPATH) -d $(DEPTH)\dist\classes $(JAVAI)
$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes:$(CLASSPATH) -d $(DEPTH)\dist\classes $(JAVAI)
install:: $(DLL) javai
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
clobber::
del /f $(DIST)\bin\components\$(DLLNAME).dll
del /f $(DIST)\bin\components\$(DLLNAME).xpt
del /f $(DIST)\..\classes\org\mozilla\xpcom\iMThreadComponent2.class

View File

@@ -0,0 +1,2 @@
14aac93e-d49c-4b03-a384-12e8ca9c310a
component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent3

View File

@@ -0,0 +1,136 @@
/* -*- Mode: Java; 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):
Client QA Team, St. Petersburg, Russia
*/
import org.mozilla.xpcom.*;
import java.lang.reflect.*;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
public class MThreadComponent3 implements iMThreadComponent3, iMThreadComponent {
private iMThreadContext context = null;
public MThreadComponent3() {
System.out.println("DEbug:avm:MThreadComponent3 constructor");
}
public void initialize(iMThreadContext context) {
System.out.println("DEbug:avm:MThreadComponent3:initialize Thread is " + Thread.currentThread().getName());
this.context = context;
}
/*
public void tHack(nsIComponentManager cm, String serverProgID) {
System.out.println("DEbug:avm:MThreadComponent3:tHack");
nsIFactory factory = null;
if(cm == null) {
System.out.println("DEbug:avm:ComponentManager is NULL!!!!!");
return;
}
factory = cm.findFactory(J2XINServerCID);
if(factory == null) {
System.out.println("DEbug:avm:Factory is NULL!!!!!");
return;
}
Object res = factory.createInstance(null, iJ2XINServerIID);
if(res == null) {
System.out.println("DEbug:avm:Instance is NULL!!!!!");
return;
}
server = (iJ2XINServerTestComponent)res;
if(server == null) {
System.err.println("Create instance failed!! Server is NULLLLLLLLLLLLLLLLLLL");
return;
}
String[] s = new String[1];
String[] s1 = new String[1];
server.getTestLocation(s,s1);
testLocation = s[0];
logLocation = s1[0];
}
*/
/* void Execute (); */
public void execute(String tName) {
System.out.println("DEbug:avm:MThreadComponent3:execute");
String cThreadName = Thread.currentThread().getName();
if(tName.equals(cThreadName)) {
System.out.println("PASSED: original and expected names equals to " + tName);
} else {
System.out.println("FAILED: Current thread name is " + cThreadName + " instead of " + tName );
}
CID classID = new CID(context.getNext());
iMThreadComponent component = loadComponent(classID);
if(component == null) {
System.out.println("Can't load component");
return;
}
component.initialize(context);
(new ExecutionThread(component)).run();
}
public iMThreadComponent loadComponent(CID classID) {
System.out.println("DEbug:avm:MThreadComponent1:loadComponent");
nsIComponentManager cm = context.getComponentManager();
nsIFactory factory = cm.findFactory(classID);
if(factory == null) {
System.out.println("DEbug:avm:Factory is NULL!!!!!");
return null;
}
iMThreadComponent component = (iMThreadComponent)factory.createInstance(null, iMThreadComponent.IID);
return component;
}
public Object queryInterface(IID iid) {
System.out.println("DEbug:avm:MThreadComponent3::queryInterface iid="+iid);
if ( iid.equals(nsISupports.IID)
|| iid.equals(iMThreadComponent3.IID)||iid.equals(iMThreadComponent.IID)) {
return this;
} else {
return null;
}
}
static CID J2XINServerCID = new CID("1ddc5b10-9852-11d4-aa22-00a024a8bbac");
static {
try {
Class nsIComponentManagerClass =
Class.forName("org.mozilla.xpcom.nsIComponentManager");
InterfaceRegistry.register(nsIComponentManagerClass);
} catch (Exception e) {
e.printStackTrace();
} catch (Error e) {
e.printStackTrace();
}
}
}

View 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):
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
JAVA_OR_NSJVM=1
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
JAVA_SRC = \
MThreadComponent3.java
JAVAI_SRC = \
iMThreadComponent3.java
MThreadComponent3.jar.comp: manifest MThreadComponent3.class
$(JDKHOME)/bin/jar cvfm MThreadComponent3.jar.comp manifest *.class
MThreadComponent3.class:
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes $(JAVA_SRC)
export::
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes -d $(DEPTH)/dist/classes $(JAVAI_SRC)
install-component: MThreadComponent3.jar.comp MThreadComponent3.jar.info
cp -f MThreadComponent3.jar* $(DIST)/bin/components
clobber::
rm -f *.class *.jar.comp
rm -f $(DIST)/bin/components/MThreadComponent3.jar.*
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1,48 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
[scriptable, uuid(e9a4aa5a-5a7b-4671-b7df-d5cadc54d485)]
interface iMThreadComponent3 : nsISupports
{
};
%{ C++
#define MTHREADCOMPONENT1_CID \
{ /* 14aac93e-d49c-4b03-a384-12e8ca9c310a */ \
0x14aac93e, \
0xd49c, \
0x4b03, \
{0xa3, 0x84, 0x12, 0xe8, 0xca, 0x9c, 0x31, 0x0a} \
}
#define MTHREADCOMPONENT3_PROGID "component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent3"
%}

View File

@@ -0,0 +1,27 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iMThreadComponent3.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iMThreadComponent3
*
* IID: 0xe9a4aa5a-5a7b-4671-b7df-d5cadc54d485
*/
public interface iMThreadComponent3 extends nsISupports
{
public static final IID IID =
new IID("e9a4aa5a-5a7b-4671-b7df-d5cadc54d485");
}
/*
* end
*/

View File

@@ -0,0 +1,53 @@
#!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):
DEPTH=..\..\..\..\..\..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
JAVA_OR_NSJVM=1
include <$(topsrcdir)\config\rules.mak>
JAVA_SRC = \
MThreadComponent3.java
JAVAI_SRC = \
iMThreadComponent3.java
MThreadComponent3.jar.comp: manifest MThreadComponent3.class
$(JDKHOME)\bin\jar cvfm MThreadComponent3.jar.comp manifest *.class
MThreadComponent3.class:
$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes $(JAVA_SRC)
export::
$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes -d $(DEPTH)\dist\classes $(JAVAI_SRC)
install-component: MThreadComponent3.jar.comp MThreadComponent3.jar.info
copy MThreadComponent3.jar* $(DIST)\bin\components
clobber::
del /f *.class *.jar.comp
del /f $(DIST)\bin\components\MThreadComponent3.jar.*
del /f $(DIST)\..\classes\org\mozilla\xpcom\iMThreadComponent3.class
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1 @@
Component-Class: MThreadComponent3

View File

@@ -0,0 +1,4 @@
component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent1
component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent2
component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent3

View File

@@ -0,0 +1,37 @@
#!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):
DEPTH=../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
DIRS= \
mtstart \
context \
1 \
2 \
3 \
$(NULL)
include $(DEPTH)/config/rules.mk

View File

@@ -0,0 +1,50 @@
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
*/
/*
* ExecutionThread.java
*/
import org.mozilla.xpcom.*;
import java.util.Date;
public class ExecutionThread extends Thread {
public static int MAX_TIMEOUT = 20000;
int timeout = Integer.MAX_VALUE;
public static long ID = 0;
iMThreadComponent component;
public ExecutionThread(iMThreadComponent component){
this.ID = new Date().getTime();
this.setName(Long.toHexString(ID));
this.component = component;
}
public ExecutionThread(iMThreadComponent component, int timeout){
this.ID = new Date().getTime();
this.setName(Long.toHexString(ID));
this.component = component;
if(timeout < MAX_TIMEOUT) {
this.timeout = timeout;
}else {
this.timeout = MAX_TIMEOUT;
}
}
public int timeoutGen() {
return (int)Math.round(Math.random()*MAX_TIMEOUT);
}
public void run(){
try {
if(timeout == Integer.MAX_VALUE) {
timeout = timeoutGen();
}
System.out.println("ExecutionThread(" + getName() + ") sleep to " + timeout);
sleep(timeout);
component.execute(getName());
} catch (Exception e) {
System.out.println("Execution thread had been interrupted");
}
}
}

View File

@@ -0,0 +1,181 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "plstr.h"
#include "prenv.h"
#include "stdio.h"
#include "nsMemory.h"
#include "BCTest.h"
#include <sys/stat.h>
#include <stdlib.h>
#include "MThreadContext.h"
#include "prmem.h"
#include "nsString.h"
#include "nsStringUtil.h"
#include "nsID.h"
nsIComponentManager* cm;
char **componentList;
int currentPosition = 0;
#define MT_COMPONENT_LIST_VAR_NAME "MT_COMPONENT_LIST"
MThreadContextImpl::MThreadContextImpl()
{
NS_INIT_REFCNT();
printf("DEbug:avm:MThreadContextImpl::MThreadContextImp\n");
nsresult rv = NS_GetGlobalComponentManager(&cm);
if(NS_FAILED(rv)) {
fprintf(stderr, "ERROR: Can't get GlobalComponentManager!!\n");
}
componentList = LoadComponentList();
}
MThreadContextImpl::~MThreadContextImpl()
{
//nb
}
NS_IMPL_ISUPPORTS1(MThreadContextImpl, iMThreadContext);
NS_IMETHODIMP MThreadContextImpl::GetNext(char **_retstr) {
nsCID aClass;
if(componentList == NULL) {
*_retstr = NULL;
return NS_OK; //nb
}
if(componentList[currentPosition]) {
*_retstr = componentList[currentPosition];
printf("MThreadContextImpl::GetNext. ContractID = %s\n",*_retstr);
nsresult rv = cm->ContractIDToClassID(*_retstr, &aClass);
if(NS_FAILED(rv)) {
printf("MThreadContextImpl::GetNext. Can't convert ContractID to ClassID\n");
*_retstr = NULL;
return NS_OK;
}else {
printf("MThreadContextImpl::GetNext. SUCCESS convert ContractID to ClassID\n");
}
*_retstr = aClass.ToString();
printf("MThreadContextImpl::GetNext. ClassID = %s\n",*_retstr);
currentPosition++;
} else {
*_retstr = NULL;
}
return NS_OK;
}
/*
NS_IMETHODIMP MThreadContextImpl::Initialize(const char* serverProgID)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP MThreadContextImpl::Execute(){
return NS_ERROR_NOT_IMPLEMENTED;
}
*/
NS_IMETHODIMP MThreadContextImpl::GetComponentManager(nsIComponentManager **_retval) {
*_retval = cm;
return NS_OK;
}
char** MThreadContextImpl::LoadComponentList() {
struct stat st;
FILE *file = NULL;
char *content;
int nRead, nTests, count = 0;
char *pos, *pos1;
char **testList;
char *lstFile = PR_GetEnv(MT_COMPONENT_LIST_VAR_NAME);
if(lstFile == NULL) {
fprintf(stderr, "ERROR: %s value is'n set\n",MT_COMPONENT_LIST_VAR_NAME);
return NULL;
}
if (stat(lstFile, &st) < 0) {
fprintf(stderr, "ERROR: can't get stat from file %s\n",lstFile);
return NULL;
}
content = (char*)calloc(1, st.st_size+1);
if ((file = fopen(lstFile, "r")) == NULL) {
fprintf(stderr, "ERROR: can't open file %s\n",lstFile);
return NULL;
}
if ((nRead = fread(content, 1, st.st_size, file)) < st.st_size) {
fprintf(stderr, "WARNING: can't read entire file in text mode (%d of %d) !\n", nRead, st.st_size);
//return;
}
content[nRead] = 0;
printf("File content: %s\n", content);
fclose(file);
//allocate maximal possible size
nTests = countChars(content, '\n') + 2;
printf("nTests = %d\n", nTests);
testList = (char**)calloc(sizeof(char*), nTests);
testList[0] = 0;
pos = content;
while((pos1 = PL_strchr(pos, '\n'))) {
*pos1 = 0;
if(PL_strlen(pos) > 0 && *pos != '#') {
//printf("First char: %c\n", *pos);
testList[count++] = PL_strdup(pos);
}
pos = pos1+1;
if (!(*pos)) {
printf("Parser done: %d .. ", count);
testList[count] = 0;
printf("ok\n");
break;
}
}
//If there is no \n after last line
if (PL_strlen(pos) > 0 && *pos != '#') {
testList[count++] = PL_strdup(pos);
testList[count] = 0;
}
//free(content);
return testList;
}
int MThreadContextImpl::countChars(char* buf, char ch) {
char *pos = buf;
int count = 0;
while((pos = PL_strchr(pos, ch))) {
pos++;
count++;
}
return count;
}

View File

@@ -0,0 +1,58 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iMThreadContext.h"
class MThreadContextImpl : public iMThreadContext
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IMTHREADCONTEXT
char** LoadComponentList();
int countChars(char* buf, char ch);
MThreadContextImpl();
virtual ~MThreadContextImpl();
};
class _MYCLASS_ : public iMThreadContext
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IMTHREADCONTEXT
_MYCLASS_();
virtual ~_MYCLASS_();
/* additional members */
};

View File

@@ -0,0 +1,39 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsIGenericFactory.h"
#include "MThreadContext.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(MThreadContextImpl)
static nsModuleComponentInfo components[] =
{
{ "J2XIN Server Test Component", MTHREADCONTEXT_CID, MTHREADCONTEXT_PROGID, MThreadContextImplConstructor,
NULL /* NULL if you dont need one */,
NULL /* NULL if you dont need one */
}
};
NS_IMPL_NSGETMODULE("MThreadContextFactory", components)

View File

@@ -0,0 +1,60 @@
#!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):
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
MODULE = MThreadContext
LIBRARY_NAME = $(MODULE)
XPIDL_MODULE = $(MODULE)
IS_COMPONENT = 1
CPPSRCS = \
MThreadContext.cpp \
MThreadContextFactory.cpp \
$(NULL)
DSO_LDOPTS += \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
XPIDLSRCS = iMThreadContext.idl \
iMThreadComponent.idl
JAVAI_SRC = iMThreadContext.java \
iMThreadComponent.java
JAVA_SRC = ExecutionThread.java
include $(topsrcdir)/config/rules.mk
export::
$(JDKHOME)/bin/javac -classpath $(DIST)/classes -d $(DIST)/classes $(JAVAI_SRC)
$(JDKHOME)/bin/javac -classpath $(DIST)/classes -d $(DIST)/classes $(JAVA_SRC)

View File

@@ -0,0 +1,32 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
#include "iMThreadContext.idl"
[scriptable, uuid(b4d98604-3226-4077-abf0-b3aa2a4eff26)]
interface iMThreadComponent : nsISupports
{
void Initialize(in iMThreadContext c);
void Execute(in string tName);
};

View File

@@ -0,0 +1,33 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iMThreadComponent.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iMThreadComponent
*
* IID: 0xb4d98604-3226-4077-abf0-b3aa2a4eff26
*/
public interface iMThreadComponent extends nsISupports
{
public static final IID IID =
new IID("b4d98604-3226-4077-abf0-b3aa2a4eff26");
/* void Initialize (in iMThreadContext c); */
public void initialize(iMThreadContext c);
/* void Execute (in string tName); */
public void execute(String tName);
}
/*
* end
*/

View File

@@ -0,0 +1,95 @@
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM iMThreadContext.idl
*/
#ifndef __gen_iMThreadContext_h__
#define __gen_iMThreadContext_h__
#include "nsISupports.h"
#include "nsIComponentManager.h"
/* starting interface: iMThreadContext */
#define IMTHREADCONTEXT_IID_STR "a7b26685-9816-4eb6-a075-36f539a7a823"
#define IMTHREADCONTEXT_IID \
{0xa7b26685, 0x9816, 0x4eb6, \
{ 0xa0, 0x75, 0x36, 0xf5, 0x39, 0xa7, 0xa8, 0x23 }}
class NS_NO_VTABLE iMThreadContext : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(IMTHREADCONTEXT_IID)
/* string GetNext (); */
NS_IMETHOD GetNext(char **_retval) = 0;
/* nsIComponentManager GetComponentManager (); */
NS_IMETHOD GetComponentManager(nsIComponentManager **_retval) = 0;
};
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_IMTHREADCONTEXT \
NS_IMETHOD GetNext(char **_retval); \
NS_IMETHOD GetComponentManager(nsIComponentManager **_retval);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_IMTHREADCONTEXT(_to) \
NS_IMETHOD GetNext(char **_retval) { return _to ## GetNext(_retval); } \
NS_IMETHOD GetComponentManager(nsIComponentManager **_retval) { return _to ## GetComponentManager(_retval); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class _MYCLASS_ : public iMThreadContext
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IMTHREADCONTEXT
_MYCLASS_();
virtual ~_MYCLASS_();
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(_MYCLASS_, iMThreadContext)
_MYCLASS_::_MYCLASS_()
{
NS_INIT_ISUPPORTS();
/* member initializers and constructor code */
}
_MYCLASS_::~_MYCLASS_()
{
/* destructor code */
}
/* string GetNext (); */
NS_IMETHODIMP _MYCLASS_::GetNext(char **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIComponentManager GetComponentManager (); */
NS_IMETHODIMP _MYCLASS_::GetComponentManager(nsIComponentManager **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#define MTHREADCONTEXT_CID \
{ /* 139b8350-280a-46d0-8afc-f1939173c2ea */ \
0x139b8350, \
0x280a, \
0x46d0, \
{0x8a, 0xfc, 0xf1, 0x93, 0x91, 0x73, 0xc2, 0xea} \
}
#define MTHREADCONTEXT_PROGID "component://netscape/blackwood/blackconnect/test/mthreads/MThreadContext"
#endif /* __gen_iMThreadContext_h__ */

View File

@@ -0,0 +1,45 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
#include "nsIComponentManager.idl"
[scriptable, uuid(a7b26685-9816-4eb6-a075-36f539a7a823)]
interface iMThreadContext : nsISupports
{
string GetNext();
nsIComponentManager GetComponentManager();
};
%{ C++
#define MTHREADCONTEXT_CID \
{ /* 139b8350-280a-46d0-8afc-f1939173c2ea */ \
0x139b8350, \
0x280a, \
0x46d0, \
{0x8a, 0xfc, 0xf1, 0x93, 0x91, 0x73, 0xc2, 0xea} \
}
#define MTHREADCONTEXT_PROGID "component://netscape/blackwood/blackconnect/test/mthreads/MThreadContext"
%}

View File

@@ -0,0 +1,33 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iMThreadContext.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iMThreadContext
*
* IID: 0xa7b26685-9816-4eb6-a075-36f539a7a823
*/
public interface iMThreadContext extends nsISupports
{
public static final IID IID =
new IID("a7b26685-9816-4eb6-a075-36f539a7a823");
/* string GetNext (); */
public String getNext();
/* nsIComponentManager GetComponentManager (); */
public nsIComponentManager getComponentManager();
}
/*
* end
*/

View File

@@ -0,0 +1,63 @@
#!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):
DEPTH=..\..\..\..\..\..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
MODULE = MThreadContext
MAKE_OBJ_TYPE =DLL
DLLNAME =$(MODULE)
DLL =.\$(OBJDIR)\$(DLLNAME).dll
COMPONENT = 1
JAVAI = iMThreadContext.java \
iMThreadComponent.java
JAVA_SRC = ExecutionThread.java
XPIDLSRCS = \
.\iMThreadContext.idl \
.\iMThreadComponent.idl\
$(NULL)
CPP_OBJS = \
.\$(OBJDIR)\MThreadContext.obj \
.\$(OBJDIR)\MThreadContextFactory.obj \
$(NULL)
LLIBS =$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(topsrcdir)\config\rules.mak>
javai:
echo $(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes:$(CLASSPATH) -d $(DEPTH)\dist\classes $(JAVAI) $(JAVA_SRC)
$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes:$(CLASSPATH) -d $(DEPTH)\dist\classes $(JAVAI) $(JAVA_SRC)
install:: $(DLL) javai
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
clobber::
del /f $(DIST)\bin\components\$(DLLNAME).dll
del /f $(DIST)\bin\components\$(DLLNAME).xpt
del /f $(DIST)\..\classes\org\mozilla\xpcom\iMThreadComponent.class
del /f $(DIST)\..\classes\org\mozilla\xpcom\iMThreadContext.class

View File

@@ -0,0 +1,37 @@
#!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):
DEPTH=..\..\..\..\..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
DIRS= \
mtstart \
context \
1 \
2 \
3 \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,79 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "plstr.h"
#include "stdio.h"
#include "nsIComponentManager.h"
#include "iMThreadContext.h"
#include "iMThreadComponent.h"
#include "MTStart.h"
#include "nsMemory.h"
#include <sys/stat.h>
#include <stdlib.h>
#include "nsID.h"
iMThreadContext* context;
MTStartImpl::MTStartImpl()
{
NS_INIT_REFCNT();
printf("MTStartImpl::MTStartImp\n");
nsresult rv = nsComponentManager::CreateInstance(MTHREADCONTEXT_PROGID,
nsnull,
NS_GET_IID(iMThreadContext),
(void**)&context);
if(NS_FAILED(rv)) {
printf("Create instance of context failed!!!");
return;
}
char* first;
context->GetNext(&first);
nsCID firstCID;
firstCID.Parse(first);
printf("ClassID is %s\n", firstCID.ToString());
iMThreadComponent* tComponent;
rv = nsComponentManager::CreateInstance(firstCID,
nsnull,
NS_GET_IID(iMThreadComponent),
(void**)&tComponent);
if(NS_FAILED(rv)) {
printf("Create instance failed from %s!!!",first);
return;
}
tComponent->Initialize(context);
tComponent->Execute("First from MTStart");
}
MTStartImpl::~MTStartImpl()
{
}
NS_IMPL_ISUPPORTS1(MTStartImpl, iMTStart);

View File

@@ -0,0 +1,36 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iMTStart.h"
class MTStartImpl : public iMTStart
{
public:
MTStartImpl();
virtual ~MTStartImpl();
NS_DECL_ISUPPORTS
NS_DECL_IMTSTART
};

View File

@@ -0,0 +1,46 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsIGenericFactory.h"
#include "MTStart.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(MTStartImpl)
static nsModuleComponentInfo components[] =
{
{ "Multi thread tests start component", MTSTART_CID, MTSTART_PROGID, MTStartImplConstructor,
NULL /* NULL if you dont need one */,
NULL /* NULL if you dont need one */
}
};
NS_IMPL_NSGETMODULE("MTStartFactory", components)

View File

@@ -0,0 +1,49 @@
#!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):
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
MODULE = MTStart
LIBRARY_NAME = $(MODULE)
XPIDL_MODULE = $(MODULE)
IS_COMPONENT = 1
CPPSRCS = \
MTStart.cpp \
MTStartFactory.cpp \
$(NULL)
XPIDLSRCS = iMTStart.idl
JAVAI_SRC = iMTStart.java
DSO_LDOPTS += \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk
export::
$(JDKHOME)/bin/javac -classpath .:$(DIST)/classes -d $(DIST)/classes $(JAVAI_SRC)

View File

@@ -0,0 +1,47 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
[scriptable, uuid(e4254a67-4f09-43e6-8e83-7c1ae8541385)]
interface iMTStart : nsISupports
{
};
%{ C++
#define MTSTART_CID \
{ /* 13c62416-3378-4ecb-8ab2-9783f8980655 */ \
0x13c62416, \
0x3378, \
0x4ecb, \
{0x8a, 0xb2, 0x97, 0x83, 0xf8, 0x98, 0x06, 0x55} \
}
#define MTSTART_PROGID "component://netscape/blackwood/blackconnect/test/mthreads/MTStart"
%}

View File

@@ -0,0 +1,27 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iMTStart.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iMTStart
*
* IID: 0xe4254a67-4f09-43e6-8e83-7c1ae8541385
*/
public interface iMTStart extends nsISupports
{
public static final IID IID =
new IID("e4254a67-4f09-43e6-8e83-7c1ae8541385");
}
/*
* end
*/

View File

@@ -0,0 +1,60 @@
#!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):
DEPTH=..\..\..\..\..\..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
MODULE = MTStart
MAKE_OBJ_TYPE = DLL
DLLNAME = MTStart
DLL =.\$(OBJDIR)\$(DLLNAME).dll
COMPONENT = 1
JAVAI = \
.\iMTStart.java \
$(NULL)
XPIDLSRCS = \
.\iMTStart.idl \
$(NULL)
CPP_OBJS = \
.\$(OBJDIR)\MTStart.obj \
.\$(OBJDIR)\MTStartFactory.obj \
$(NULL)
LLIBS =$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(DEPTH)\config\rules.mak>
javai:
echo $(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes:$(CLASSPATH) -d $(DEPTH)\dist\classes $(JAVAI)
$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes:$(CLASSPATH) -d $(DEPTH)\dist\classes $(JAVAI)
install:: $(DLL) javai
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
clobber::
del /f $(DIST)\bin\components\$(DLLNAME).dll
del /f $(DIST)\bin\components\$(DLLNAME).xpt
del /f $(DIST)\..\classes\org\mozilla\xpcom\iMTStart.class

View File

@@ -0,0 +1,11 @@
<html>
<head>
<script>
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var tl = Components.classes["component://netscape/blackwood/blackconnect/test/mthreads/MTStart"].createInstance();
</script>
</head>
<body>
This file can be used to start BlackConnect MULTI-thread tests.
</body>

View File

@@ -0,0 +1,8 @@
X2JIN
X2JOUT
X2JINOUT
X2JRET
J2XIN
J2XOUT
J2XINOUT
J2XRET

View File

@@ -0,0 +1,9 @@
X2JIN
X2JOUT
X2JINOUT
X2JRET
J2XIN
J2XOUT
J2XINOUT
J2XRET

View File

@@ -0,0 +1,35 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
DIRS= \
java \
cpp \
$(NULL)
include $(DEPTH)/config/rules.mk

View File

@@ -0,0 +1,241 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "plstr.h"
#include "prenv.h"
#include "stdio.h"
#include "nsMemory.h"
#include "BCTest.h"
#include <sys/stat.h>
#include <stdlib.h>
#include "J2XINServerTestComponent.h"
#include "prmem.h"
#include "nsString.h"
#include "nsStringUtil.h"
char* testLocation=NULL;
char* logLocation=NULL;
char* fBuffer=NULL;
J2XINServerTestComponentImpl::J2XINServerTestComponentImpl()
{
NS_INIT_REFCNT();
printf("DEbug:avm:J2XINServerTestComponentImpl::J2XINServerTestComponentImp\n");
testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME);
logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME);
if ((logLocation == NULL)||(testLocation == NULL)) {
fprintf(stderr,"ERROR: %s or %s isn't set !", BC_TEST_LOCATION_VAR_NAME, BC_LOG_LOCATION_VAR_NAME);
}
}
J2XINServerTestComponentImpl::~J2XINServerTestComponentImpl()
{
//nb
}
NS_IMPL_ISUPPORTS1(J2XINServerTestComponentImpl, iJ2XINServerTestComponent);
IMPL_PROCEED_RESULTS(J2XINServerTestComponentImpl)
NS_IMETHODIMP J2XINServerTestComponentImpl::GetTestLocation(char **tLocation,char **lLocation) {
*tLocation = testLocation;
*lLocation = logLocation;
return NS_OK;
}
NS_IMETHODIMP J2XINServerTestComponentImpl::Flush(const char *type) {
char* fileName = NULL;
fileName = PR_sprintf_append(fileName,"j2x.in.server.%s",type);
fprintf(stderr,"Flushing to %s\n", fileName);
if(fBuffer) {
PrintResult(fileName,fBuffer);
PR_smprintf_free(fBuffer);
fBuffer = NULL;
} else {
fprintf(stderr,"ERROR!!fBuffer is null at flush stage\n");
}
PR_smprintf_free(fileName);
if(fBuffer != NULL ) {
fprintf(stderr,"fBuffer not NULL after free\n");
}else {
fprintf(stderr,"fBuffer IS NULL after free\n");
}
return NS_OK;
}
//Test methods
/* void TestShort (in short i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestShort(PRInt16 i) {
fprintf(stderr,"Inside TestShort method\n");
fBuffer = PR_sprintf_append(fBuffer,"%d\n",i);
return NS_OK;
}
/* void TestLong (in long i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestLong(PRInt32 i) {
fprintf(stderr,"Inside TestLong method \n");
if(fBuffer != NULL ) {
fprintf(stderr,"fBuffer not NULL in TestLong\n");
} else {
fprintf(stderr,"fBuffer IS NULL in TestLong\n");
}
fBuffer = PR_sprintf_append(fBuffer,"%ld\n",i);
return NS_OK;
}
/* void TestLonglong (in long long i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestLonglong(PRInt64 i) {
printf("Inside TestLonglong method\n");
fBuffer = PR_sprintf_append(fBuffer,"%lld\n",i);
return NS_OK;
}
/* void TestByte (in octet i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestByte(PRUint8 i) {
printf("TestByte\n");
fBuffer = PR_sprintf_append(fBuffer,"%d\n",i);
return NS_OK;
}
/* void TestUShort (in unsigned short i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestUShort(PRUint16 i) {
printf("TestUShort\n");
fBuffer = PR_sprintf_append(fBuffer,"%u\n",i);
return NS_OK;
}
/* void TestULong (in unsigned long i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestULong(PRUint32 i) {
printf("TestULong\n");
fBuffer = PR_sprintf_append(fBuffer,"%lu\n",i);
return NS_OK;
}
/* void TestULonglong (in unsigned long long i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestULonglong(PRUint64 i) {
printf("TestULonglong\n");
fBuffer = PR_sprintf_append(fBuffer,"%llu\n",i);
return NS_OK;
}
/* void TestFloat (in float i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestFloat(float i) {
fprintf(stderr,"TestFloat: append %.3e\n",i);
fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",i);
return NS_OK;
}
/* void TestDouble (in double i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestDouble(double i) {
fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",i);
return NS_OK;
}
/* void TestBoolean (in boolean i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestBoolean(PRBool i) {
if(i == PR_TRUE) {
fBuffer = PR_sprintf_append(fBuffer,"%s\n","true");
} else {
fBuffer = PR_sprintf_append(fBuffer,"%s\n","false");
}
return NS_OK;
}
/*
NS_IMETHODIMP J2XINServerTestComponentImpl::TestChar(char i) {
fBuffer = PR_sprintf_append(fBuffer,"%c\n",i);
return NS_OK;
}
NS_IMETHODIMP J2XINServerTestComponentImpl::TestWChar(PRUnichar i) {
fBuffer = PR_sprintf_append(fBuffer,"%d\n",i);
return NS_OK;
}
*/
/* void TestString (in string i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestString(const char *i) {
fBuffer = PR_sprintf_append(fBuffer,"%s\n",i);
return NS_OK;
}
/* void TestWString (in wstring i); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestWString(const PRUnichar *i) {
nsString str = *(new nsString(i));
NS_ALLOC_STR_BUF(aBuf,str,100)
printf("aBuf is %s",aBuf);
fBuffer = PR_sprintf_append(fBuffer,"%s\n",aBuf);
NS_FREE_STR_BUF(aBuf)
return NS_OK;
}
/* void TestStringArray (in unsigned long count, [array, size_is (count)] in string valueArray); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestStringArray(PRUint32 count, const char **valueArray) {
return PrintResultArray("j2x.in.server.stringArray",count,valueArray);
}
/* void TestLongArray (in unsigned long count, [array, size_is (count)] in long longArray); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestLongArray(PRUint32 count, PRInt32 *longArray) {
return PrintResultArray("j2x.in.server.longArray",count,longArray);
}
/* void TestCharArray (in unsigned long count, [array, size_is (count)] in char valueArray); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestCharArray(PRUint32 count, char *valueArray) {
return PrintResultArray("j2x.in.server.charArray",count,valueArray);;
}
/* void TestMixed (in boolean bBool, in char cChar, in octet nByte, in short nShort, in unsigned short nUShort, in long nLong, in unsigned long nULong, in long long nHyper, in unsigned long long nUHyper, in float fFloat, in double fDouble, in string aString, in unsigned long count, [array, size_is (count)] in long longArray); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestMixed(PRBool bBool,/* char cChar,*/ PRUint8 nByte, PRInt16 nShort, PRUint16 nUShort, PRInt32 nLong, PRUint32 nULong, PRInt64 nHyper, PRUint64 nUHyper, float fFloat, double fDouble, const char *aString, PRUint32 count, PRInt32 *longArray) {
char cChar = '0';
return PrintResultMixed("j2x.in.server.mixed",(PRBool)bBool,(char)cChar,(PRUint8)nByte,(PRInt16)nShort, (PRUint16)nUShort, (PRInt32)nLong, (PRUint32)nULong, (PRInt64)nHyper, (PRUint64)nUHyper, (float)fFloat, (double)fDouble, (char*)aString, (PRUint32)count, (PRInt32*)longArray);
}
/* void TestObject (in iJ2XINServerTestComponent obj); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestObject(iJ2XINServerTestComponent *obj) {
char *str;
obj->GetTestObjectString(&str);
PrintResult("j2x.in.server.object",str);
return NS_OK;
}
NS_IMETHODIMP J2XINServerTestComponentImpl::GetTestObjectString(char **str) {
*str = "String Ident";
return NS_OK;
}
/* void TestIID (in nsIIDRef iid); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestIID(const nsIID& iid) {
fprintf(stderr,"TestIID: append %s\n",iid.ToString());
fBuffer = PR_sprintf_append(fBuffer,"%s\n",iid.ToString());
return NS_OK;
}
/* void TestCID (in nsCIDRef cid); */
NS_IMETHODIMP J2XINServerTestComponentImpl::TestCID(const nsCID& cid) {
fprintf(stderr,"TestCID: append %s\n",cid.ToString());
fBuffer = PR_sprintf_append(fBuffer,"%s\n",cid.ToString());
return NS_OK;
}

View File

@@ -0,0 +1,60 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iJ2XINServerTestComponent.h"
#include "ProceedResults.h"
class J2XINServerTestComponentImpl : public iJ2XINServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XINSERVERTESTCOMPONENT
DECL_PROCEED_RESULTS
J2XINServerTestComponentImpl();
virtual ~J2XINServerTestComponentImpl();
};
class _MYCLASS_ : public iJ2XINServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XINSERVERTESTCOMPONENT
_MYCLASS_();
virtual ~_MYCLASS_();
/* additional members */
};

View File

@@ -0,0 +1,39 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsIGenericFactory.h"
#include "J2XINServerTestComponent.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(J2XINServerTestComponentImpl)
static nsModuleComponentInfo components[] =
{
{ "J2XIN Server Test Component", J2XINSERVERTESTCOMPONENT_CID, J2XINSERVERTESTCOMPONENT_PROGID, J2XINServerTestComponentImplConstructor,
NULL /* NULL if you dont need one */,
NULL /* NULL if you dont need one */
}
};
NS_IMPL_NSGETMODULE("J2XINServerTestComponentFactory", components)

View File

@@ -0,0 +1,60 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
include $(DEPTH)/config/config.mk
MODULE = J2XINServerTestComponent
LIBRARY_NAME = $(MODULE)
XPIDL_MODULE = $(MODULE)
IS_COMPONENT = 1
#It is not right !
#DSO_LDOPTS += -L$(DIST)/lib \
# -lnspr4 \
# $(NULL)
DSO_LDOPTS += \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
CPPSRCS = \
J2XINServerTestComponent.cpp \
J2XINServerTestComponentFactory.cpp \
$(NULL)
XPIDLSRCS = iJ2XINServerTestComponent.idl
JAVAI = iJ2XINServerTestComponent.java
include $(topsrcdir)/config/rules.mk
JAVAC=$(JDKHOME)/bin/javac -classpath $(DIST)/classes -d $(DIST)/classes
export::
$(JAVAC) $(JAVAI)

View File

@@ -0,0 +1,72 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
[scriptable, uuid(3b0e2d20-9852-11d4-aa22-00a024a8bbac)]
interface iJ2XINServerTestComponent : nsISupports
{
void GetTestLocation(out string tLocation, out string lLocation);
void flush(in string s);
void TestShort(in short i);
void TestLong(in long i);
void TestLonglong(in long long i);
void TestByte(in octet i);
void TestUShort(in unsigned short i);
void TestULong(in unsigned long i);
void TestULonglong(in unsigned long long i);
void TestFloat(in float i);
void TestDouble(in double i);
void TestBoolean(in boolean i);
// void TestChar(in char i);
//void TestWChar(in wchar i);
void TestString(in string i);
void TestWString(in wstring i);
void TestStringArray(in unsigned long count,[array, size_is(count)] in string valueArray);
void TestLongArray(in unsigned long count, [array, size_is(count)] in long longArray);
void TestCharArray(in unsigned long count,[array, size_is(count)] in char valueArray);
void TestMixed(in boolean bBool,/*in char cChar*,*/ in octet nByte,
in short nShort, in unsigned short nUShort,
in long nLong, in unsigned long nULong,
in long long nHyper, in unsigned long long nUHyper,
in float fFloat, in double fDouble,
in string aString,
in unsigned long count, [array, size_is(count)] in long longArray);
void TestObject(in iJ2XINServerTestComponent obj);
string GetTestObjectString();
void TestIID(in nsIIDRef iid);
void TestCID(in nsCIDRef cid);
};
%{ C++
#define J2XINSERVERTESTCOMPONENT_CID \
{ /*1ddc5b10-9852-11d4-aa22-00a024a8bbac*/ \
0x1ddc5b10, \
0x9852, \
0x11d4, \
{0xaa, 0x22, 0x00, 0xa0, 0x24, 0xa8, 0xbb, 0xac} \
}
#define J2XINSERVERTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/J2XINServer;1"
%}

View File

@@ -0,0 +1,93 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iJ2XINServerTestComponent.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iJ2XINServerTestComponent
*
* IID: 0x3b0e2d20-9852-11d4-aa22-00a024a8bbac
*/
public interface iJ2XINServerTestComponent extends nsISupports
{
public static final IID IID =
new IID("3b0e2d20-9852-11d4-aa22-00a024a8bbac");
/* void GetTestLocation (out string tLocation, out string lLocation); */
public void getTestLocation(String[] tLocation, String[] lLocation);
/* void flush (in string s); */
public void flush(String s);
/* void TestShort (in short i); */
public void testShort(short i);
/* void TestLong (in long i); */
public void testLong(int i);
/* void TestLonglong (in long long i); */
public void testLonglong(long i);
/* void TestByte (in octet i); */
public void testByte(byte i);
/* void TestUShort (in unsigned short i); */
public void testUShort(short i);
/* void TestULong (in unsigned long i); */
public void testULong(int i);
/* void TestULonglong (in unsigned long long i); */
public void testULonglong(long i);
/* void TestFloat (in float i); */
public void testFloat(float i);
/* void TestDouble (in double i); */
public void testDouble(double i);
/* void TestBoolean (in boolean i); */
public void testBoolean(boolean i);
/* void TestString (in string i); */
public void testString(String i);
/* void TestWString (in wstring i); */
public void testWString(String i);
/* void TestStringArray (in unsigned long count, [array, size_is (count)] in string valueArray); */
public void testStringArray(int count, String[] valueArray);
/* void TestLongArray (in unsigned long count, [array, size_is (count)] in long longArray); */
public void testLongArray(int count, int[] longArray);
/* void TestCharArray (in unsigned long count, [array, size_is (count)] in char valueArray); */
public void testCharArray(int count, char[] valueArray);
/* void TestMixed (in boolean bBool, in octet nByte, in short nShort, in unsigned short nUShort, in long nLong, in unsigned long nULong, in long long nHyper, in unsigned long long nUHyper, in float fFloat, in double fDouble, in string aString, in unsigned long count, [array, size_is (count)] in long longArray); */
public void testMixed(boolean bBool, byte nByte, short nShort, short nUShort, int nLong, int nULong, long nHyper, long nUHyper, float fFloat, double fDouble, String aString, int count, int[] longArray);
/* void TestObject (in iJ2XINServerTestComponent obj); */
public void testObject(iJ2XINServerTestComponent obj);
/* string GetTestObjectString (); */
public String getTestObjectString();
/* void TestIID (in nsIIDRef iid); */
public void testIID(IID iid);
/* void TestCID (in nsCIDRef cid); */
public void testCID(CID cid);
}
/*
* end
*/

View File

@@ -0,0 +1,60 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=..\..\..\..\..\..\..
MAKE_OBJ_TYPE = DLL
DLLNAME = J2XINServerTestComponent
DLL=.\$(OBJDIR)\$(DLLNAME).dll
MODULE = J2XINServerTestComponent
COMPONENT = 1
JAVA_OR_NSJVM=1
NO_CAFE=1
include <$(DEPTH)\config\config.mak>
XPIDLSRCS = \
.\iJ2XINServerTestComponent.idl \
$(NULL)
CPP_OBJS= \
.\$(OBJDIR)\J2XINServerTestComponent.obj \
.\$(OBJDIR)\J2XINServerTestComponentFactory.obj \
$(NULL)
LLIBS= $(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
JDIRS = .
JAVAC_PROG=$(JDKHOME)\bin\javac
JAVAC_FLAGS=-classpath $(CLASSPATH);$(JAVA_DESTPATH) -d $(JAVA_DESTPATH)
include <$(DEPTH)\config\rules.mak>
include <$(DEPTH)\config\javarules.mak>
install:: $(DLL)
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
clobber::
del /f $(DIST)\bin\components\$(DLLNAME).dll
del /f $(DIST)\bin\components\J2XIN*.xpt

View File

@@ -0,0 +1,2 @@
f10e3970-9778-11d4-aa21-00a024a8bbac
@mozilla/blackwood/blackconnect/test/params/J2XINClient;1

View File

@@ -0,0 +1,432 @@
/* -*- Mode: Java; 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):
Client QA Team, St. Petersburg, Russia
*/
import org.mozilla.xpcom.*;
import java.lang.reflect.*;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.util.Hashtable;
public class J2XINClientTestComponent implements iJ2XINClientTestComponent, iClientTestComponent, iJClientTestComponent, iExclusionSupport {
private iJ2XINServerTestComponent server = null;
private VarContainer varContainer = null;
private String testLocation = null;
private String logLocation = null;
private Hashtable exclusionHash = new Hashtable();
private StringBuffer buf, s;
public J2XINClientTestComponent() {
System.out.println("DEbug:avm:J2XINClientTestComponent constructor");
varContainer = new VarContainer();
}
private void printResult(String res,String fileName) {
try{
DataOutputStream f=new DataOutputStream(new FileOutputStream(logLocation+"/" + fileName));
f.writeBytes(res);
f.close();
} catch(Exception e) {
System.err.println("Exception during writing the file: " +e);
e.printStackTrace();
}
}
public void exclude(int count, String[] exclusionList) {
System.out.println("DEbug:avm:J2XINClientTestComponent:exclude");
for(int i=0;i<count;i++) {
exclusionHash.put((Object)exclusionList[i],new Object());
}
}
/* void Initialize (in string serverProgID); */
public void initialize(String serverProgID) {
System.out.println("DEbug:avm:J2XINClientTestComponent:initialize");
//Really code from tHack should be here!!
}
public void tHack(nsIComponentManager cm, String serverProgID) {
System.out.println("DEbug:avm:J2XINClientTestComponent:tHack");
nsIFactory factory = null;
if(cm == null) {
System.out.println("DEbug:avm:ComponentManager is NULL!!!!!");
return;
}
factory = cm.findFactory(J2XINServerCID);
if(factory == null) {
System.out.println("DEbug:avm:Factory is NULL!!!!!");
return;
}
//System.err.println("IID="+iJ2XINServerTestComponent.IID);
Object res = factory.createInstance(null, iJ2XINServerTestComponent.IID);
// Object res = factory.createInstance(null, new IID("3b0e2d20-9852-11d4-aa22-00a024a8bbac"));
if(res == null) {
System.out.println("DEbug:avm:Instance is NULL!!!!!");
return;
}
server = (iJ2XINServerTestComponent)res;
if(server == null) {
System.err.println("Create instance failed!! Server is NULLLLLLLLLLLLLLLLLLL");
return;
}
String[] s2 = new String[1];
String[] s1 = new String[1];
server.getTestLocation(s2,s1);
testLocation = s2[0];
logLocation = s1[0];
}
/* void Execute (); */
public void execute() {
System.out.println("DEbug:avm:J2XINClientTestComponent:execute");
if(server == null) {
System.err.println("Server is not initialized!!!");
return;
}
if(!exclusionHash.containsKey("short"))
testShort();
if(!exclusionHash.containsKey("long"))
testLong();
if(!exclusionHash.containsKey("longlong"))
testLonglong();
if(!exclusionHash.containsKey("octet"))
testByte();
if(!exclusionHash.containsKey("ushort"))
testUShort();
if(!exclusionHash.containsKey("ulong"))
testULong();
if(!exclusionHash.containsKey("ulonglong"))
testULonglong();
if(!exclusionHash.containsKey("float"))
testFloat();
if(!exclusionHash.containsKey("double"))
testDouble();
if(!exclusionHash.containsKey("boolean"))
testBoolean();
if(!exclusionHash.containsKey("string"))
testString();
if(!exclusionHash.containsKey("wstring"))
testWString();
if(!exclusionHash.containsKey("stringArray"))
testStringArray();
if(!exclusionHash.containsKey("longArray"))
testLongArray();
if(!exclusionHash.containsKey("charArray"))
testCharArray();
if(!exclusionHash.containsKey("object"))
testObject();
if(!exclusionHash.containsKey("mixed"))
testMixed();
if(!exclusionHash.containsKey("iid"))
testIID();
if(!exclusionHash.containsKey("cid"))
testCID();
}
private void testShort() {
StringBuffer buf = new StringBuffer();
System.err.println("server.testShort");
short shortVal = varContainer.getNextShort();
while(shortVal != VarContainer.endOfData) {
buf.append(shortVal + "\n");
server.testShort(shortVal);
shortVal = varContainer.getNextShort();
}
printResult(buf.toString(),"j2x.in.client.short");
server.flush("short");
}
private void testLong() {
System.err.println("server.testLong");
buf = new StringBuffer("");
int intVal = varContainer.getNextInt();
while(intVal != VarContainer.endOfData) {
buf.append(intVal + "\n");
server.testLong(intVal);
intVal = varContainer.getNextInt();
}
printResult(buf.toString(),"j2x.in.client.long");
server.flush("long");
}
private void testLonglong() {
System.err.println("server.testLonglong");
buf = new StringBuffer("");
long longVal = varContainer.getNextLong();
while(longVal != VarContainer.endOfData) {
buf.append(longVal + "\n");
server.testLonglong(longVal);
longVal = varContainer.getNextLong();
}
printResult(buf.toString(),"j2x.in.client.longlong");
server.flush("longlong");
}
private void testByte() {
buf = new StringBuffer("");
byte byteVal = varContainer.getNextByte();
while(byteVal != VarContainer.endOfData) {
buf.append(byteVal + "\n");
server.testByte(byteVal);
byteVal = varContainer.getNextByte();
}
printResult(buf.toString(),"j2x.in.client.octet");
server.flush("octet");
}
private void testUShort() {
buf = new StringBuffer("");
short ushortVal = varContainer.getNextUshort();
while(ushortVal != VarContainer.endOfData) {
buf.append(ushortVal + "\n");
server.testUShort(ushortVal);
ushortVal = varContainer.getNextUshort();
}
printResult(buf.toString(),"j2x.in.client.ushort");
server.flush("ushort");
}
private void testULong() {
buf = new StringBuffer("");
int uintVal = varContainer.getNextUint();
while(uintVal != VarContainer.endOfData) {
buf.append(uintVal + "\n");
server.testULong(uintVal);
uintVal = varContainer.getNextUint();
}
printResult(buf.toString(),"j2x.in.client.ulong");
server.flush("ulong");
}
private void testULonglong() {
buf = new StringBuffer("");
long ulongVal = varContainer.getNextUlong();
while(ulongVal != VarContainer.endOfData) {
buf.append(ulongVal + "\n");
server.testULonglong(ulongVal);
ulongVal = varContainer.getNextUlong();
}
printResult(buf.toString(),"j2x.in.client.ulonglong");
server.flush("ulonglong");
}
private void testFloat() {
buf = new StringBuffer("");
float floatVal = varContainer.getNextFloat();
while(floatVal != VarContainer.endOfData) {
buf.append(floatVal + "\n");
server.testFloat(floatVal);
floatVal = varContainer.getNextFloat();
}
printResult(buf.toString(),"j2x.in.client.float");
server.flush("float");
}
private void testDouble() {
buf = new StringBuffer("");
double doubleVal = varContainer.getNextDouble();
while(doubleVal != VarContainer.endOfData) {
buf.append(doubleVal + "\n");
server.testDouble(doubleVal);
doubleVal = varContainer.getNextDouble();
}
printResult(buf.toString(),"j2x.in.client.double");
server.flush("double");
}
private void testBoolean() {
server.testBoolean(true);
server.testBoolean(false);
printResult("true\nfalse","j2x.in.client.boolean");
server.flush("boolean");
}
// private void testChar() {
// server.testChar('S');
// server.testWChar(VarContainer.charVar);
// printResult("S","j2x.in.client.char");
// server.flush("char");
// }
private void testString() {
printResult(VarContainer.charPVar,"j2x.in.client.string");
server.testString(VarContainer.charPVar);
server.flush("string");
}
private void testWString() {
printResult(VarContainer.unicharPVar,"j2x.in.client.wstring");
server.testWString(VarContainer.unicharPVar);
server.flush("wstring");
}
private void testStringArray() {
String[] valueArray = {"fist string", "second string", "some string","Sample string 1","S","String SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"};
int count = valueArray.length;
s = new StringBuffer();
for(int i=0;i<count;i++) {
s.append(valueArray[i]+"\n");
}
printResult(s.toString(),"j2x.in.client.stringArray");
server.testStringArray(count, valueArray);
}
private void testLongArray() {
int[] intArray = {1,2,201,-6,86,-10000};
s = new StringBuffer();
for(int i=0;i<intArray.length;i++) {
s.append(intArray[i]+"\n");
}
printResult(s.toString(),"j2x.in.client.longArray");
server.testLongArray(intArray.length, intArray);
}
private void testCharArray() {
char[] charArray = {'A','B','c','L','ï','u','Ô','p'};
s = new StringBuffer();
for(int i=0;i<charArray.length;i++) {
s.append(charArray[i]+"\n");
}
printResult(s.toString(),"j2x.in.client.charArray");
server.testCharArray(charArray.length, charArray);
}
private void testMixed() {
boolean bBool = true;
char cChar = '0';
byte nByte = VarContainer.byteMid;
short nShort = VarContainer.shortMid;
short nUShort = VarContainer.ushortMid;
int nLong = VarContainer.intMid;
int nULong = VarContainer.uintMid;
long nHyper = VarContainer.longMid;
long nUHyper = VarContainer.ulongMid;
float fFloat = VarContainer.floatMid;
double fDouble = VarContainer.doubleMid;
String aString = "Mixed string";
int[] intArray = {1,2,201,-6,86,-10000};
s = new StringBuffer();
s.append(bBool + "\n");
s.append(cChar + "\n");
s.append(nByte + "\n");
s.append(nShort + "\n");
s.append(nUShort + "\n");
s.append(nLong + "\n");
s.append(nULong + "\n");
s.append(nHyper + "\n");
s.append(nUHyper + "\n");
s.append(fFloat + "\n");
s.append(fDouble + "\n");
s.append(aString + "\n");
for(int j=0;j<intArray.length;j++)
s.append(intArray[j] + "\n");
printResult(s.toString(),"j2x.in.client.mixed");
server.testMixed(bBool, nByte, nShort, nUShort,nLong,nULong, nHyper, nUHyper, fFloat,fDouble, aString, intArray.length, intArray);
}
private void testObject() {
printResult(server.getTestObjectString(),"j2x.in.client.object");
server.testObject(server);
}
private void testIID() {
buf = new StringBuffer("");
IID iid=new IID("cc7480e0-3a37-11d5-b653-005004552ed1");
buf.append(iid + "\n");
server.testIID(iid);
printResult(buf.toString(),"j2x.in.client.iid");
server.flush("iid");
}
private void testCID() {
buf = new StringBuffer("");
CID cid=new CID("cc7480e0-3a37-11d5-b653-005004552ed1");
buf.append(cid + "\n");
server.testCID(cid);
printResult(buf.toString(),"j2x.in.client.cid");
server.flush("cid");
}
public Object queryInterface(IID iid) {
System.out.println("DEbug:avm:J2XINClientTestComponent::queryInterface iid="+iid);
if ( iid.equals(nsISupports.IID)
|| iid.equals(iJ2XINClientTestComponent.IID)||iid.equals(iClientTestComponent.IID)
||iid.equals(iExclusionSupport.IID)) {
return this;
} else {
return null;
}
}
static CID J2XINServerCID = new CID("1ddc5b10-9852-11d4-aa22-00a024a8bbac");
// static IID iJ2XINClientTestComponentIID = new IID(iJ2XINClientTestComponent.IID);
// static IID iClientTestComponentIID = new IID(iClientTestComponent.IID);
// static IID iJ2XINServerIID = new IID(iJ2XINServerTestComponent.IID);
// static IID nsISupportsIID = new IID(nsISupports.IID);
// static IID nsIComponentManagerIID = new IID(nsIComponentManager.IID);
// static IID iExclusionSupportIID = new IID(iExclusionSupport.IID);
// */
static {
try {
System.out.println("J2XINClientTestComponent - static block ");
Class nsIComponentManagerClass =
Class.forName("org.mozilla.xpcom.nsIComponentManager");
InterfaceRegistry.register(nsIComponentManagerClass);
Class proxyHandlerClass =
Class.forName("org.mozilla.xpcom.ProxyHandler");
InterfaceRegistry.register(proxyHandlerClass);
Class nsIFileClass =
Class.forName("org.mozilla.xpcom.nsIFile");
InterfaceRegistry.register(nsIFileClass);
Class nsIFactoryClass =
Class.forName("org.mozilla.xpcom.nsIFactory");
InterfaceRegistry.register(nsIFactoryClass);
Class nsIEnumeratorClass =
Class.forName("org.mozilla.xpcom.nsIEnumerator");
InterfaceRegistry.register(nsIEnumeratorClass);
System.out.println("DE bug:avm:before registeringiJ2XINServerTestComponent ");
Class iJ2XINServerTestComponentClass =
Class.forName("org.mozilla.xpcom.iJ2XINServerTestComponent");
InterfaceRegistry.register(iJ2XINServerTestComponentClass);
} catch (Exception e) {
System.err.println("#####################################################################");
System.err.println("####################EXCEPTION during interface initialization############");
System.err.println(e);
} catch (Error e) {
System.err.println("#####################################################################");
System.err.println("####################Error during interface initialization############");
System.err.println(e);
}
}
}

View File

@@ -0,0 +1,57 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
JAVA_OR_NSJVM=1
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
JAVA_SRC = \
J2XINClientTestComponent.java
JAVAI_SRC = \
iJ2XINClientTestComponent.java
J2XINClientTestComponent.jar.comp: manifest javai J2XINClientTestComponent.class
$(JDKHOME)/bin/jar cvfm J2XINClientTestComponent.jar.comp manifest *.class
J2XINClientTestComponent.class:
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes $(JAVA_SRC)
javai::
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes -d $(DEPTH)/dist/classes $(JAVAI_SRC)
install-component: J2XINClientTestComponent.jar.comp J2XINClientTestComponent.jar.info
cp -f J2XINClientTestComponent.jar* $(DIST)/bin/components
clobber::
rm -f *.class *.jar.comp
rm -f $(DIST)/bin/components/J2XINClientTestComponent.jar.*
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1,47 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iClientTestComponent.idl"
[scriptable, uuid(3d293210-9779-11d4-aa21-00a024a8bbac)]
interface iJ2XINClientTestComponent : nsISupports
{
};
%{ C++
#define J2XINCLIENTTESTCOMPONENT_CID \
{ /*f10e3970-9778-11d4-aa21-00a024a8bbac*/ \
0xf10e3970, \
0x9778, \
0x11d4, \
{0xaa, 0x21, 0x00, 0xa0, 0x24, 0xa8, 0xbb, 0xac} \
}
#define J2XINCLIENTTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/J2XINClient;1"
%}

View File

@@ -0,0 +1,27 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iJ2XINClientTestComponent.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iJ2XINClientTestComponent
*
* IID: 0x3d293210-9779-11d4-aa21-00a024a8bbac
*/
public interface iJ2XINClientTestComponent extends nsISupports
{
public static final IID IID =
new IID("3d293210-9779-11d4-aa21-00a024a8bbac");
}
/*
* end
*/

View File

@@ -0,0 +1,68 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH = ..\..\..\..\..\..\..
topsrcdir = ..\..\..\..\..\..\..
srcdir = .
VPATH = .
MAKE_OBJ_TYPE=DLL
MODULE=J2XINClientTestComponent
COMPONENT=1
JAVA_OR_NSJVM=1
NO_CAFE=1
include <$(DEPTH)\config\config.mak>
XPIDLSRCS = \
.\iJ2XINClientTestComponent.idl \
$(NULL)
JAVA_SRC = \
J2XINClientTestComponent.java\
$(NULL)
JDIRS = .
JAVAC_PROG=$(JDKHOME)\bin\javac
JAVAC_FLAGS=-classpath $(CLASSPATH);$(JAVA_DESTPATH) -d $(JAVA_DESTPATH)
include <$(DEPTH)\config\rules.mak>
include <$(DEPTH)\config\javarules.mak>
J2XINClientTestComponent.class:
$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes $(JAVA_SRC)
J2XINClientTestComponent.jar.comp: manifest J2XINClientTestComponent.class
$(JDKHOME)\bin\jar cvfm J2XINClientTestComponent.jar.comp manifest *.class
install-component: J2XINClientTestComponent.jar.comp J2XINClientTestComponent.jar.info $(DLL)
copy J2XINClientTestComponent.jar* $(DIST)\bin\components
clobber::
-del /f *.class *.jar.comp
-del /f $(DIST)\bin\components\J2XINClientTestComponent.jar.*
-del /f $(DIST)\..\classes\org\mozilla\xpcom\iJ2XINServerTestComponent.*
-del /f $(DIST)\..\classes\org\mozilla\xpcom\iJ2XINClientTestComponent.*
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1 @@
Component-Class: J2XINClientTestComponent

View File

@@ -0,0 +1,31 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH = ..\..\..\..\..\..
DIRS= \
cpp \
java \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,35 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
DIRS= \
java \
cpp \
$(NULL)
include $(DEPTH)/config/rules.mk

View File

@@ -0,0 +1,270 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "plstr.h"
#include "stdio.h"
#include "nsMemory.h"
#include "BCTest.h"
#include <sys/stat.h>
#include <stdlib.h>
#include "J2XINOUTServerTestComponent.h"
#include "prmem.h"
#include "prenv.h"
#include "nsString.h"
#include "nsStringUtil.h"
char* testLocation=NULL;
char* logLocation=NULL;
char* fBuffer=NULL;
PRUint8 end_of_data = 112;
int all=0;
J2XINOUTServerTestComponentImpl::J2XINOUTServerTestComponentImpl()
{
NS_INIT_REFCNT();
testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME);
logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME);
if((testLocation == NULL)||(logLocation == NULL)) {
fprintf(stderr,"ERROR: %s or %s isn't set !", BC_TEST_LOCATION_VAR_NAME, BC_LOG_LOCATION_VAR_NAME);
}
InitStackVars();
printf("DEbug:avm:J2XINOUTServerTestComponentImpl::J2XINOUTServerTestComponentImp\n");
}
J2XINOUTServerTestComponentImpl::~J2XINOUTServerTestComponentImpl()
{
}
NS_IMPL_ISUPPORTS1(J2XINOUTServerTestComponentImpl, iJ2XINOUTServerTestComponent);
IMPL_PROCEED_RESULTS(J2XINOUTServerTestComponentImpl)
IMPL_VAR_STACKS(J2XINOUTServerTestComponentImpl)
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::GetTestLocation(char **tLocation, char **lLocation) {
*tLocation = testLocation;
*lLocation = logLocation;
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::Flush(const char *type) {
char* fileName = NULL;
fileName = PR_sprintf_append(fileName,"j2x.inout.server.%s",type);
if(fBuffer) {
PrintResult(fileName,fBuffer);
PR_smprintf_free(fBuffer);
fBuffer = NULL;
} else {
}
PR_smprintf_free(fileName);
if(fBuffer != NULL ) {
}else {
}
all=0;
return NS_OK;
}
//Test methods
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestShort(PRInt16 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
else Flush("short");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestLong(PRInt32 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
else Flush("long");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestLonglong(PRInt64 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%lld\n",*i);
else Flush("longlong");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestByte(PRUint8 *i) {
// Strange bug here
/* if (*i!=112)*/ fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
all++;
if (all==4) Flush("octet");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestUShort(PRUint16 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
else Flush("ushort");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestULong(PRUint32 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
else Flush("ulong");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestULonglong(PRUint64 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%lld\n",*i);
else Flush("ulonglong");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestFloat(float *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",*i);
else Flush("float");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestDouble(double *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",*i);
else Flush("double");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestBoolean(PRBool *i) {
if (*i==PR_TRUE) fBuffer = PR_sprintf_append(fBuffer,"%s\n","true");
else if (*i==PR_FALSE) fBuffer = PR_sprintf_append(fBuffer,"%s\n","false");
else fBuffer = PR_sprintf_append(fBuffer,"%s\n","strange value");
all++;
if (all==2) Flush("boolean");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestChar(char *i) {
// Strange bug here
/* if (*i!='x')*/ fBuffer = PR_sprintf_append(fBuffer,"%c\n",i);
all++;
if (all==2) Flush("char");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestWChar(PRUnichar *i) {
// Strange bug here
/* if (*i!='x')*/ fBuffer = PR_sprintf_append(fBuffer,"%c\n",i);
all++;
if (all==2) Flush("wchar");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestString(char **i) {
fBuffer = PR_sprintf_append(fBuffer,"%s\n",*i);
all++;
if (all==3) Flush("string");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestWString(PRUnichar **i) {
nsString str = *(new nsString(*i));
{
NS_ALLOC_STR_BUF(aBuf,str,100)
fBuffer = PR_sprintf_append(fBuffer,"%s\n",aBuf);
NS_FREE_STR_BUF(aBuf)
}
all++;
if (all==3) Flush("wstring");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestStringArray(PRUint32 count, char ***valueArray) {
for(int i=0;i<count;i++)
fBuffer = PR_sprintf_append(fBuffer,"%s\n",valueArray[0][i]);
Flush("stringArray");
return NS_OK;//PrintResultArray("j2x.in.server.stringArray",count,valueArray);
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestLongArray(PRUint32 count, PRInt32 **longArray) {
for(int i=0;i<count;i++)
fBuffer = PR_sprintf_append(fBuffer,"%d\n",longArray[i]);
Flush("longArray");
return NS_OK;//PrintResultArray("j2x.in.server.longArray",count,longArray);
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestCharArray(PRUint32 count, char **valueArray) {
for(int i=0;i<count;i++)
fBuffer = PR_sprintf_append(fBuffer,"%c\n",valueArray[i]);
Flush("charArray");
return NS_OK;//PrintResultArray("j2x.in.server.charArray",count,valueArray);;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestMixed(PRBool *bBool, char *cChar, PRUint8 *nByte, PRInt16 *nShort, PRUint16 *nUShort, PRInt32 *nLong, PRUint32 *nULong, PRInt64 *nHyper, PRUint64 *nUHyper, float *fFloat, double *fDouble, char **aString, PRUint32 count, PRInt32 **longArray) {
fBuffer = PR_sprintf_append(fBuffer,"%d\n%d\n%d",nByte, nShort, nUShort);
Flush("mixed");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestObject(iJ2XINOUTServerTestComponent **obj) {
obj[0]->TestObj();
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestObj() {
fBuffer = PR_sprintf_append(fBuffer,"!!!Right string!!!");
Flush("object");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestObj2() {
fBuffer = PR_sprintf_append(fBuffer,"!!!Right string!!!");
char* fileName = NULL;
fileName = PR_sprintf_append(fileName,"j2x.inout.xclient.object");
if(fBuffer) {
PrintResult(fileName,fBuffer);
PR_smprintf_free(fBuffer);
fBuffer = NULL;
} else {
}
PR_smprintf_free(fileName);
return NS_OK;
}

View File

@@ -0,0 +1,61 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iJ2XINOUTServerTestComponent.h"
#include "ProceedResults.h"
#include "VarContainer.h"
class J2XINOUTServerTestComponentImpl : public iJ2XINOUTServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XINOUTSERVERTESTCOMPONENT
DECL_PROCEED_RESULTS
DECL_VAR_STACKS
J2XINOUTServerTestComponentImpl();
virtual ~J2XINOUTServerTestComponentImpl();
};
class _MYCLASS_ : public iJ2XINOUTServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XINOUTSERVERTESTCOMPONENT
_MYCLASS_();
virtual ~_MYCLASS_();
/* additional members */
};

View File

@@ -0,0 +1,40 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsIGenericFactory.h"
#include "J2XINOUTServerTestComponent.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(J2XINOUTServerTestComponentImpl)
static nsModuleComponentInfo components[] =
{
{ "J2XINOUT Server Test Component", J2XINOUTSERVERTESTCOMPONENT_CID, J2XINOUTSERVERTESTCOMPONENT_PROGID, J2XINOUTServerTestComponentImplConstructor,
NULL /* NULL if you dont need one */,
NULL /* NULL if you dont need one */
}
};
NS_IMPL_NSGETMODULE("J2XINOUTServerTestComponentFactory", components)

View File

@@ -0,0 +1,61 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
include $(DEPTH)/config/config.mk
MODULE = J2XINOUTServerTestComponent
LIBRARY_NAME = $(MODULE)
XPIDL_MODULE = $(MODULE)
IS_COMPONENT = 1
#It is not right !
#DSO_LDOPTS += -L$(DIST)/lib \
# -lnspr4 \
# $(NULL)
DSO_LDOPTS += \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
CPPSRCS = \
J2XINOUTServerTestComponent.cpp \
J2XINOUTServerTestComponentFactory.cpp \
$(NULL)
XPIDLSRCS = iJ2XINOUTServerTestComponent.idl
JAVAI = iJ2XINOUTServerTestComponent.java
include $(topsrcdir)/config/rules.mk
JAVAC=$(JDKHOME)/bin/javac -classpath $(DIST)/classes -d $(DIST)/classes
export::
$(JAVAC) $(JAVAI)

View File

@@ -0,0 +1,72 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
[scriptable, uuid(c534e01c-9567-44ac-aaa6-f908fabefc2b)]
interface iJ2XINOUTServerTestComponent : nsISupports
{
void GetTestLocation(out string tLocation, out string lLocation);
void Flush(in string s);
void TestShort(inout short i);
void TestLong(inout long i);
void TestLonglong(inout long long i);
void TestByte(inout octet i);
void TestUShort(inout unsigned short i);
void TestULong(inout unsigned long i);
void TestULonglong(inout unsigned long long i);
void TestFloat(inout float i);
void TestDouble(inout double i);
void TestBoolean(inout boolean i);
void TestChar(inout char i);
void TestWChar(inout wchar i);
void TestString(inout string i);
void TestWString(inout wstring i);
void TestStringArray(in unsigned long count,[array, size_is(count)] inout string valueArray);
void TestLongArray(in unsigned long count, [array, size_is(count)] inout long longArray);
void TestCharArray(in unsigned long count,[array, size_is(count)] inout char valueArray);
void TestMixed(inout boolean bBool, inout char cChar, inout octet nByte,
inout short nShort, inout unsigned short nUShort,
inout long nLong, inout unsigned long nULong,
inout long long nHyper, inout unsigned long long nUHyper,
inout float fFloat, inout double fDouble,
inout string aString,
in unsigned long count, [array, size_is(count)] inout long longArray);
void TestObject(inout iJ2XINOUTServerTestComponent obj);
void TestObj();
void TestObj2();
};
%{ C++
#define J2XINOUTSERVERTESTCOMPONENT_CID \
{ /*4aa238d4-d655-40b7-9743-62a5b2e21a5c*/ \
0x4aa238d4, \
0xd655, \
0x40b7, \
{0x97, 0x43, 0x62, 0xa5, 0xb2, 0xe2, 0x1a, 0x5c} \
}
#define J2XINOUTSERVERTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/J2XINOUTServer;1"
%}

View File

@@ -0,0 +1,96 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iJ2XINOUTServerTestComponent.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iJ2XINOUTServerTestComponent
*
* IID: 0xc534e01c-9567-44ac-aaa6-f908fabefc2b
*/
public interface iJ2XINOUTServerTestComponent extends nsISupports
{
public static final IID IID =
new IID("c534e01c-9567-44ac-aaa6-f908fabefc2b");
/* void GetTestLocation (out string tLocation, out string lLocation); */
public void getTestLocation(String[] tLocation, String[] lLocation);
/* void Flush (in string s); */
public void flush(String s);
/* void TestShort (inout short i); */
public void testShort(short[] i);
/* void TestLong (inout long i); */
public void testLong(int[] i);
/* void TestLonglong (inout long long i); */
public void testLonglong(long[] i);
/* void TestByte (inout octet i); */
public void testByte(byte[] i);
/* void TestUShort (inout unsigned short i); */
public void testUShort(short[] i);
/* void TestULong (inout unsigned long i); */
public void testULong(int[] i);
/* void TestULonglong (inout unsigned long long i); */
public void testULonglong(long[] i);
/* void TestFloat (inout float i); */
public void testFloat(float[] i);
/* void TestDouble (inout double i); */
public void testDouble(double[] i);
/* void TestBoolean (inout boolean i); */
public void testBoolean(boolean[] i);
/* void TestChar (inout char i); */
public void testChar(char[] i);
/* void TestWChar (inout wchar i); */
public void testWChar(char[] i);
/* void TestString (inout string i); */
public void testString(String[] i);
/* void TestWString (inout wstring i); */
public void testWString(String[] i);
/* void TestStringArray (in unsigned long count, [array, size_is (count)] inout string valueArray); */
public void testStringArray(int count, String[][] valueArray);
/* void TestLongArray (in unsigned long count, [array, size_is (count)] inout long longArray); */
public void testLongArray(int count, int[][] longArray);
/* void TestCharArray (in unsigned long count, [array, size_is (count)] inout char valueArray); */
public void testCharArray(int count, char[][] valueArray);
/* void TestMixed (inout boolean bBool, inout char cChar, inout octet nByte, inout short nShort, inout unsigned short nUShort, inout long nLong, inout unsigned long nULong, inout long long nHyper, inout unsigned long long nUHyper, inout float fFloat, inout double fDouble, inout string aString, in unsigned long count, [array, size_is (count)] inout long longArray); */
public void testMixed(boolean[] bBool, char[] cChar, byte[] nByte, short[] nShort, short[] nUShort, int[] nLong, int[] nULong, long[] nHyper, long[] nUHyper, float[] fFloat, double[] fDouble, String[] aString, int count, int[][] longArray);
/* void TestObject (inout iJ2XINOUTServerTestComponent obj); */
public void testObject(iJ2XINOUTServerTestComponent[] obj);
/* void TestObj (); */
public void testObj();
/* void TestObj2 (); */
public void testObj2();
}
/*
* end
*/

View File

@@ -0,0 +1,58 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=..\..\..\..\..\..\..
MAKE_OBJ_TYPE = DLL
DLLNAME = J2XINOUTServerTestComponent
DLL=.\$(OBJDIR)\$(DLLNAME).dll
MODULE = J2XINOUTServerTestComponent
COMPONENT = 1
CPP_OBJS= \
.\$(OBJDIR)\J2XINOUTServerTestComponent.obj \
.\$(OBJDIR)\J2XINOUTServerTestComponentFactory.obj \
$(NULL)
XPIDLSRCS = .\iJ2XINOUTServerTestComponent.idl
JAVAI= iJ2XINOUTServerTestComponent.java
LLIBS= $(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(DEPTH)\config\rules.mak>
JAVAC=$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes -d $(DEPTH)\dist\classes
install:: $(DLL)
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
clobber::
del /f $(DIST)\bin\components\$(DLLNAME).dll
del /f $(DIST)\bin\components\J2XINOUT*.xpt
export::
$(JAVAC) $(JAVAI)

View File

@@ -0,0 +1,2 @@
1a7ecb30-6a68-4894-943f-e227bebf3861
@mozilla/blackwood/blackconnect/test/params/J2XINOUTClient;1

View File

@@ -0,0 +1,678 @@
/* -*- Mode: Java; 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):
Client QA Team, St. Petersburg, Russia
*/
import org.mozilla.xpcom.*;
import java.lang.reflect.*;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.util.Hashtable;
public class J2XINOUTClientTestComponent implements iJ2XINOUTClientTestComponent, iClientTestComponent, iJClientTestComponent, iExclusionSupport {
private iJ2XINOUTServerTestComponent server = null;
private String testLocation = null;
private String logLocation = null;
private Hashtable exclusionHash = new Hashtable();
private byte endOfData = 112;
public J2XINOUTClientTestComponent() {
System.out.println("DEbug:avm:J2XINOUTClientTestComponent constructor");
}
private void printResult(String res,String fileName) {
try{
DataOutputStream f=new DataOutputStream(new FileOutputStream(logLocation+"/" + fileName));
f.writeBytes(res);
f.close();
} catch(Exception e) {
System.err.println("Exception during writing the file: " +e);
e.printStackTrace();
}
}
public void initialize(String serverProgID) {
System.out.println("DEbug:avm:J2XINOUTClientTestComponent:initialize");
//Really code from tHack should be here!!
}
public void exclude(int count, String[] exclusionList) {
System.out.println("DEbug:avm:J2XINOUTClientTestComponent:exclude");
for(int i=0;i<count;i++) {
exclusionHash.put((Object)exclusionList[i],new Object());
}
}
public void tHack(nsIComponentManager cm, String serverProgID) {
System.out.println("DEbug:avm:J2XINOUTClientTestComponent:tHack");
nsIFactory factory = null;
if(cm == null) {
System.out.println("DEbug:avm:ComponentManager is NULL!!!!!");
return;
}
factory = cm.findFactory(J2XINOUTServerCID);
if(factory == null) {
System.out.println("DEbug:avm:Factory is NULL!!!!!");
return;
}
Object res = factory.createInstance(null, iJ2XINOUTServerTestComponent.IID);
if(res == null) {
System.out.println("DEbug:avm:Instance is NULL!!!!!");
return;
}
server = (iJ2XINOUTServerTestComponent)res;
if(server == null) {
System.err.println("Create instance failed!! Server is NULLLLLLLLLLLLLLLLLLL");
return;
}
String[] ss = new String[1];
String[] sss = new String[1];
server.getTestLocation(ss,sss);
testLocation = ss[0];
logLocation = sss[0];
}
/* void Execute (); */
public void execute() {
System.out.println("DEbug:avm:J2XINOUTClientTestComponent:execute");
if(server == null) {
System.err.println("Server is not initialized!!!");
return;
}
if(!exclusionHash.containsKey("short"))
testShort();
if(!exclusionHash.containsKey("long"))
testLong();
if(!exclusionHash.containsKey("longlong"))
testLonglong();
if(!exclusionHash.containsKey("octet"))
testByte();
if(!exclusionHash.containsKey("ushort"))
testUShort();
if(!exclusionHash.containsKey("ulong"))
testULong();
if(!exclusionHash.containsKey("ulonglong"))
testULonglong();
if(!exclusionHash.containsKey("float"))
testFloat();
if(!exclusionHash.containsKey("double"))
testDouble();
if(!exclusionHash.containsKey("boolean"))
testBoolean();
if(!exclusionHash.containsKey("string"))
testString();
if(!exclusionHash.containsKey("wstring"))
testWString();
if(!exclusionHash.containsKey("stringArray"))
testStringArray();
if(!exclusionHash.containsKey("longArray"))
testLongArray();
if(!exclusionHash.containsKey("charArray"))
testCharArray();
if(!exclusionHash.containsKey("object"))
testObject();
if(!exclusionHash.containsKey("mixed"))
testMixed();
}
private void testShort() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testShort");
short[] shortVar = new short[1];
shortVar[0]=java.lang.Short.MIN_VALUE;
s.append(shortVar[0]+"\n");
server.testShort(shortVar);
s2.append(shortVar[0]+"\n");
shortVar[0]=0;
s.append(shortVar[0]+"\n");
server.testShort(shortVar);
s2.append(shortVar[0]+"\n");
shortVar[0]=VarContainer.shortVar;
s.append(shortVar[0]+"\n");
server.testShort(shortVar);
s2.append(shortVar[0]+"\n");
shortVar[0]=java.lang.Short.MAX_VALUE;
s.append(shortVar[0]+"\n");
server.testShort(shortVar);
s2.append(shortVar[0]+"\n");
shortVar[0]=112;
server.testShort(shortVar);
printResult(s.toString(),"j2x.inout.client.short");
printResult(s2.toString(),"j2x.inout.xclient.short");
}
private void testLong() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testLong");
int[] intVar = new int[1];
intVar[0]=java.lang.Integer.MIN_VALUE;
s.append(intVar[0]+"\n");
server.testLong(intVar);
s2.append(intVar[0]+"\n");
intVar[0]=0;
s.append(intVar[0]+"\n");
server.testLong(intVar);
s2.append(intVar[0]+"\n");
intVar[0]=1000;//VarContainer.intVar;
s.append(intVar[0]+"\n");
server.testLong(intVar);
s2.append(intVar[0]+"\n");
intVar[0]=java.lang.Integer.MAX_VALUE;
s.append(intVar[0]+"\n");
server.testLong(intVar);
s2.append(intVar[0]+"\n");
intVar[0]=112;
server.testLong(intVar);
printResult(s.toString(),"j2x.inout.client.long");
printResult(s2.toString(),"j2x.inout.xclient.long");
}
private void testLonglong() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testLonglong");
long[] longVar = new long[1];
longVar[0]=java.lang.Long.MIN_VALUE;
s.append(longVar[0]+"\n");
server.testLonglong(longVar);
s2.append(longVar[0]+"\n");
longVar[0]=0;
s.append(longVar[0]+"\n");
server.testLonglong(longVar);
s2.append(longVar[0]+"\n");
longVar[0]=VarContainer.longVar;
s.append(longVar[0]+"\n");
server.testLonglong(longVar);
s2.append(longVar[0]+"\n");
longVar[0]=java.lang.Long.MAX_VALUE;
s.append(longVar[0]+"\n");
server.testLonglong(longVar);
s2.append(longVar[0]+"\n");
longVar[0]=112;
server.testLonglong(longVar);
printResult(s.toString(),"j2x.inout.client.longlong");
printResult(s2.toString(),"j2x.inout.xclient.longlong");
}
private void testByte() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testByte");
byte[] byteVar = new byte[1];
byteVar[0]=java.lang.Byte.MIN_VALUE;
s.append(byteVar[0]+"\n");
server.testByte(byteVar);
s2.append(byteVar[0]+"\n");
byteVar[0]=0;
s.append(byteVar[0]+"\n");
server.testByte(byteVar);
s2.append(byteVar[0]+"\n");
byteVar[0]=VarContainer.unsignedByteVar;
s.append(byteVar[0]+"\n");
server.testByte(byteVar);
s2.append(byteVar[0]+"\n");
byteVar[0]=java.lang.Byte.MAX_VALUE;
s.append(byteVar[0]+"\n");
server.testByte(byteVar);
s2.append(byteVar[0]+"\n");
byteVar[0]=112;
server.testByte(byteVar);
printResult(s.toString(),"j2x.inout.client.octet");
printResult(s2.toString(),"j2x.inout.xclient.octet");
}
private void testUShort() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testUShort");
short[] ushortVar = new short[1];
ushortVar[0]=0;
s.append(ushortVar[0]+"\n");
server.testUShort(ushortVar);
s2.append(ushortVar[0]+"\n");
ushortVar[0]=1000;//VarContainer.unsignedShortVar;
s.append(ushortVar[0]+"\n");
server.testUShort(ushortVar);
s2.append(ushortVar[0]+"\n");
ushortVar[0]=java.lang.Short.MAX_VALUE;
s.append(ushortVar[0]+"\n");
server.testUShort(ushortVar);
s2.append(ushortVar[0]+"\n");
ushortVar[0]=112;
server.testUShort(ushortVar);
printResult(s.toString(),"j2x.inout.client.ushort");
printResult(s2.toString(),"j2x.inout.xclient.ushort");
}
private void testULong() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testUlong");
int[] uintVar = new int[1];
uintVar[0]=0;
s.append(uintVar[0]+"\n");
server.testULong(uintVar);
s2.append(uintVar[0]+"\n");
uintVar[0]=1000;//VarContainer.unsignedIntVar;
s.append(uintVar[0]+"\n");
server.testULong(uintVar);
s2.append(uintVar[0]+"\n");
uintVar[0]=java.lang.Integer.MAX_VALUE;
s.append(uintVar[0]+"\n");
server.testULong(uintVar);
s2.append(uintVar[0]+"\n");
uintVar[0]=112;
server.testULong(uintVar);
printResult(s.toString(),"j2x.inout.client.ulong");
printResult(s2.toString(),"j2x.inout.xclient.ulong");
}
private void testULonglong() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testULonglong");
long[] ulongVar = new long[1];
ulongVar[0]=0;
s.append(ulongVar[0]+"\n");
server.testULonglong(ulongVar);
s2.append(ulongVar[0]+"\n");
ulongVar[0]=VarContainer.unsignedLongVar;
s.append(ulongVar[0]+"\n");
server.testULonglong(ulongVar);
s2.append(ulongVar[0]+"\n");
ulongVar[0]=java.lang.Long.MAX_VALUE;
s.append(ulongVar[0]+"\n");
server.testULonglong(ulongVar);
s2.append(ulongVar[0]+"\n");
ulongVar[0]=112;
server.testULonglong(ulongVar);
printResult(s.toString(),"j2x.inout.client.ulonglong");
printResult(s2.toString(),"j2x.inout.xclient.ulonglong");
}
private void testFloat() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testFloat");
float[] floatVar = new float[1];
floatVar[0]=java.lang.Float.MIN_VALUE;
s.append(floatVar[0]+"\n");
server.testFloat(floatVar);
s2.append(floatVar[0]+"\n");
floatVar[0]=0;
s.append(floatVar[0]+"\n");
server.testFloat(floatVar);
s2.append(floatVar[0]+"\n");
floatVar[0]=1000;//VarContainer.floatVar;
s.append(floatVar[0]+"\n");
server.testFloat(floatVar);
s2.append(floatVar[0]+"\n");
floatVar[0]=java.lang.Float.MAX_VALUE;
s.append(floatVar[0]+"\n");
server.testFloat(floatVar);
s2.append(floatVar[0]+"\n");
floatVar[0]=112;
server.testFloat(floatVar);
printResult(s.toString(),"j2x.inout.client.float");
printResult(s2.toString(),"j2x.inout.xclient.float");
}
private void testDouble() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testDouble");
double[] doubleVar = new double[1];
doubleVar[0]=java.lang.Double.MIN_VALUE;
s.append(doubleVar[0]+"\n");
server.testDouble(doubleVar);
s2.append(doubleVar[0]+"\n");
doubleVar[0]=0;
s.append(doubleVar[0]+"\n");
server.testDouble(doubleVar);
s2.append(doubleVar[0]+"\n");
doubleVar[0]=VarContainer.doubleVar;
s.append(doubleVar[0]+"\n");
server.testDouble(doubleVar);
s2.append(doubleVar[0]+"\n");
doubleVar[0]=java.lang.Double.MAX_VALUE;
s.append(doubleVar[0]+"\n");
server.testDouble(doubleVar);
s2.append(doubleVar[0]+"\n");
doubleVar[0]=112;
server.testDouble(doubleVar);
printResult(s.toString(),"j2x.inout.client.double");
printResult(s2.toString(),"j2x.inout.xclient.double");
}
private void testBoolean() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testBoolean");
boolean[] boolVar = new boolean[1];
boolVar[0]=true;
s.append(boolVar[0]+"\n");
server.testBoolean(boolVar);
s2.append(boolVar[0]+"\n");
boolVar[0]=false;
s.append(boolVar[0]+"\n");
server.testBoolean(boolVar);
s2.append(boolVar[0]+"\n");
printResult(s.toString(),"j2x.inout.client.boolean");
printResult(s2.toString(),"j2x.inout.xclient.boolean");
}
private void testChar() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testChar");
char[] charVar = new char[1];
charVar[0]='0';
s.append(charVar[0]+"\n");
server.testChar(charVar);
s2.append(charVar[0]+"\n");
charVar[0]='Z';
s.append(charVar[0]+"\n");
server.testChar(charVar);
s2.append(charVar[0]+"\n");
charVar[0]='x';
server.testChar(charVar);
printResult(s.toString(),"j2x.inout.client.char");
printResult(s2.toString(),"j2x.inout.xclient.char");
}
private void testWChar() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testWChar");
char[] wcharVar = new char[1];
wcharVar[0]='0';
s.append(wcharVar[0]+"\n");
server.testWChar(wcharVar);
s2.append(wcharVar[0]+"\n");
wcharVar[0]='Z';
s.append(wcharVar[0]+"\n");
server.testWChar(wcharVar);
s2.append(wcharVar[0]+"\n");
// wcharVar[0]='x';
// server.testWChar(wcharVar);
printResult(s.toString(),"j2x.inout.client.wchar");
printResult(s2.toString(),"j2x.inout.xclient.wchar");
}
private void testString() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testString");
String[] stringVar = new String[1];
stringVar[0]="111";//VarContainer.charPVar;
s.append(stringVar[0]+"\n");
server.testString(stringVar);
s2.append(stringVar[0]+"\n");
stringVar[0]="";
s.append(stringVar[0]+"\n");
server.testString(stringVar);
s2.append(stringVar[0]+"\n");
stringVar[0]="NULL string";
s.append(stringVar[0]+"\n");
server.testString(stringVar);
s2.append(stringVar[0]+"\n");
// stringVar[0]="112";
// server.testString(stringVar);
printResult(s.toString(),"j2x.inout.client.string");
printResult(s2.toString(),"j2x.inout.xclient.string");
}
private void testWString() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testWString");
String[] wstringVar = new String[1];
wstringVar[0]="111";//VarContainer.unicharPVar;
s.append(wstringVar[0]+"\n");
server.testWString(wstringVar);
s2.append(wstringVar[0]+"\n");
wstringVar[0]="";
s.append(wstringVar[0]+"\n");
server.testWString(wstringVar);
s2.append(wstringVar[0]+"\n");
wstringVar[0]="NULL string";
s.append(wstringVar[0]+"\n");
server.testWString(wstringVar);
s2.append(wstringVar[0]+"\n");
// wstringVar[0]="112";
// server.testWString(wstringVar);
printResult(s.toString(),"j2x.inout.client.wstring");
printResult(s2.toString(),"j2x.inout.xclient.wstring");
}
private void testStringArray() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testStringArray");
String[][] stringAVar = new String[1][3];
stringAVar[0][0]="iddqd";
stringAVar[0][1]="idkfa";
stringAVar[0][2]="ctrl-q";
int count=3;
for(int i=0;i<count;i++)
s.append(stringAVar[0][i]+"\n");
server.testStringArray(count,stringAVar);
for(int i=0;i<count;i++)
s2.append(stringAVar[0][i]+"\n");
printResult(s.toString(),"j2x.inout.client.stringArray");
printResult(s2.toString(),"j2x.inout.xclient.stringArray");
}
private void testLongArray() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testLongArray");
int[][] intAVar = new int[1][3];
intAVar[0][0]=777;
intAVar[0][1]=888;
intAVar[0][2]=999;
int count=3;
for(int i=0;i<count;i++)
s.append(intAVar[0][i]+"\n");
server.testLongArray(count,intAVar);
for(int i=0;i<count;i++)
s2.append(intAVar[0][i]+"\n");
printResult(s.toString(),"j2x.inout.client.longArray");
printResult(s2.toString(),"j2x.inout.xclient.longArray");
}
private void testCharArray () {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testCharArray");
char[][] charAVar = new char[1][3];
charAVar[0][0]='k';
charAVar[0][1]='f';
charAVar[0][2]='a';
int count=3;
for(int i=0;i<count;i++)
s.append(charAVar[0][i]+"\n");
server.testCharArray(count,charAVar);
for(int i=0;i<count;i++)
s2.append(charAVar[0][i]+"\n");
printResult(s.toString(),"j2x.inout.client.charArray");
printResult(s2.toString(),"j2x.inout.xclient.charArray");
}
private void testMixed() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testMixed");
short[] shortVar=new short[1];
int[] intVar=new int[1];
long[] longVar=new long[1];
byte[] byteVar=new byte[1];
short[] ushortVar=new short[1];
int[] uintVar=new int[1];
char[] charVar=new char[1];
long[] ulongVar=new long[1];
float[] floatVar=new float[1];
double[] doubleVar=new double[1];
int count=3;
String[] stringVar=new String[1];
boolean[] boolVar=new boolean[1];
int[][] intAVar=new int[1][3];
shortVar[0]=VarContainer.shortVar;
intVar[0]=VarContainer.intVar;
longVar[0]=VarContainer.longVar;
byteVar[0]=VarContainer.unsignedByteVar;
ushortVar[0]=VarContainer.unsignedShortVar;
uintVar[0]=VarContainer.unsignedIntVar;
ulongVar[0]=VarContainer.unsignedLongVar;
floatVar[0]=VarContainer.floatVar;
doubleVar[0]=VarContainer.doubleVar;
boolVar[0]=VarContainer.booleanVar;
charVar[0]=VarContainer.charVar;
stringVar[0]=VarContainer.charPVar;
intAVar[0][0]=333;
intAVar[0][1]=444;
intAVar[0][2]=555;
s.append(boolVar[0]+"\n"+charVar[0]+"\n"+byteVar[0]+"\n"+
shortVar[0]+"\n"+ushortVar[0]+"\n"+intVar[0]+"\n"+
uintVar[0]+"\n"+longVar[0]+"\n"+ulongVar[0]+"\n"+
floatVar[0]+"\n"+doubleVar[0]+"\n"+stringVar[0]+"\n"+
intAVar[0][0]+"\n"+intAVar[0][1]+"\n"+intAVar[0][2]+"\n");
server.testMixed(boolVar, charVar, byteVar, shortVar, ushortVar,
intVar, uintVar, longVar, ulongVar, floatVar,
doubleVar, stringVar, count, intAVar);
s2.append(boolVar[0]+"\n"+charVar[0]+"\n"+byteVar[0]+"\n"+
shortVar[0]+"\n"+ushortVar[0]+"\n"+intVar[0]+"\n"+
uintVar[0]+"\n"+longVar[0]+"\n"+ulongVar[0]+"\n"+
floatVar[0]+"\n"+doubleVar[0]+"\n"+stringVar[0]+"\n"+
intAVar[0][0]+"\n"+intAVar[0][1]+"\n"+intAVar[0][2]+"\n");
printResult(s.toString(),"j2x.inout.client.mixed");
printResult(s2.toString(),"j2x.inout.xclient.mixed");
}
private void testObject() {
StringBuffer s = new StringBuffer();
StringBuffer s2 = new StringBuffer();
System.err.println("server.testObject");
iJ2XINOUTServerTestComponent[] objectVar= new iJ2XINOUTServerTestComponent[1];
objectVar[0] = server;
printResult("!!!Right string!!!","j2x.inout.client.object"); //!!!Mat' Mat'
server.testObject(objectVar);
objectVar[0].testObj2();
}
public Object queryInterface(IID iid) {
System.out.println("DEbug:avm:J2XINOUTClientTestComponent::queryInterface iid="+iid);
if ( iid.equals(nsISupports.IID)
|| iid.equals(iJ2XINOUTClientTestComponent.IID)||iid.equals(iClientTestComponent.IID)||iid.equals(iExclusionSupport.IID)) {
return this;
} else {
return null;
}
}
static CID J2XINOUTServerCID = new CID("4aa238d4-d655-40b7-9743-62a5b2e21a5c");
static {
try {
try {
System.err.println("J2XINOUTClientTestComponent Classloader is " + Class.forName("J2XINOUTClientTestComponent").getClassLoader());
Class c = Class.forName("S");
}catch(Exception e) {
System.err.println("J2XINOUTClientTestComponent Classloa BLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL");
}
System.out.println("J2XINOUTClientTestComponent - static block ");
Class nsIComponentManagerClass =
Class.forName("org.mozilla.xpcom.nsIComponentManager");
InterfaceRegistry.register(nsIComponentManagerClass);
Class proxyHandlerClass =
Class.forName("org.mozilla.xpcom.ProxyHandler");
InterfaceRegistry.register(proxyHandlerClass);
Class nsIFileClass =
Class.forName("org.mozilla.xpcom.nsIFile");
InterfaceRegistry.register(nsIFileClass);
Class nsIFactoryClass =
Class.forName("org.mozilla.xpcom.nsIFactory");
InterfaceRegistry.register(nsIFactoryClass);
Class nsIEnumeratorClass =
Class.forName("org.mozilla.xpcom.nsIEnumerator");
InterfaceRegistry.register(nsIEnumeratorClass);
System.out.println("DE bug:avm:before registeringiJ2XINOUTServerTestComponent ");
Class iJ2XINOUTServerTestComponentClass =
Class.forName("org.mozilla.xpcom.iJ2XINOUTServerTestComponent");
InterfaceRegistry.register(iJ2XINOUTServerTestComponentClass);
} catch (Exception e) {
System.err.println("#####################################################################");
System.err.println("####################EXCEPTION during interface initialization############");
System.err.println(e);
} catch (Error e) {
System.err.println("#####################################################################");
System.err.println("####################Error during interface initialization############");
System.err.println(e);
}
}
}

View File

@@ -0,0 +1,57 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
JAVA_OR_NSJVM=1
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
JAVA_SRC = \
J2XINOUTClientTestComponent.java
JAVAI_SRC = \
iJ2XINOUTClientTestComponent.java
J2XINOUTClientTestComponent.jar.comp: manifest javai J2XINOUTClientTestComponent.class
$(JDKHOME)/bin/jar cvfm J2XINOUTClientTestComponent.jar.comp manifest *.class
J2XINOUTClientTestComponent.class:
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes $(JAVA_SRC)
javai::
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes -d $(DEPTH)/dist/classes $(JAVAI_SRC)
install-component: J2XINOUTClientTestComponent.jar.comp J2XINOUTClientTestComponent.jar.info
cp -f J2XINOUTClientTestComponent.jar* $(DIST)/bin/components
clobber::
rm -f *.class *.jar.comp
rm -f $(DIST)/bin/components/J2XINOUTClientTestComponent.jar.*
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1,47 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iClientTestComponent.idl"
[scriptable, uuid(295caa2b-730e-45bd-9229-ad75b0cd3503)]
interface iJ2XINOUTClientTestComponent : nsISupports
{
};
%{ C++
#define J2XINOUTCLIENTTESTCOMPONENT_CID \
{ /*1a7ecb30-6a68-4894-943f-e227bebf3861*/ \
0x1a7ecb30, \
0x6a68, \
0x4894, \
{0x94, 0x3f, 0xe2, 0x27, 0xbe, 0xbf, 0x38, 0x61} \
}
#define J2XINOUTCLIENTTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/J2XINOUTClient;1"
%}

View File

@@ -0,0 +1,27 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iJ2XINOUTClientTestComponent.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iJ2XINOUTClientTestComponent
*
* IID: 0x295caa2b-730e-45bd-9229-ad75b0cd3503
*/
public interface iJ2XINOUTClientTestComponent extends nsISupports
{
public static final IID IID =
new IID("295caa2b-730e-45bd-9229-ad75b0cd3503");
}
/*
* end
*/

View File

@@ -0,0 +1,66 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH = ..\..\..\..\..\..\..
topsrcdir = ..\..\..\..\..\..\..
srcdir = .
VPATH = .
MAKE_OBJ_TYPE=DLL
MODULE=J2XINOUTClientTestComponent
COMPONENT=1
XPIDLSRCS = \
.\iJ2XINOUTClientTestComponent.idl \
$(NULL)
JAVA_SRC = \
J2XINOUTClientTestComponent.java
JAVAI_SRC = \
iJ2XINOUTClientTestComponent.java
include <$(DEPTH)\config\rules.mak>
J2XINOUTClientTestComponent.jar.comp: manifest J2XINOUTClientTestComponent.class
$(JDKHOME)\bin\jar cvfm J2XINOUTClientTestComponent.jar.comp manifest *.class
J2XINOUTClientTestComponent.class:
$(JDKHOME)\bin\javac -classpath $(DEPTH)/dist/classes $(JAVA_SRC)
javai:
echo $(JDKHOME)\bin\javac -classpath $(CLASSPATH);$(DEPTH)\dist\classes -d $(DEPTH)\dist\classes $(JAVAI_SRC)
$(JDKHOME)\bin\javac -classpath $(CLASSPATH);$(DEPTH)\dist\classes -d $(DEPTH)\dist\classes $(JAVAI_SRC)
install-component: javai J2XINOUTClientTestComponent.jar.comp J2XINOUTClientTestComponent.jar.info $(DLL)
copy J2XINOUTClientTestComponent.jar* $(DIST)\bin\components
clobber::
-del /f *.class *.jar.comp
-del /f $(DIST)\bin\components\J2XINOUTClientTestComponent.jar.*
-del /f $(DIST)\..\classes\org\mozilla\xpcom\iJ2XINOUTServerTestComponent.*
-del /f $(DIST)\..\classes\org\mozilla\xpcom\iJ2XINOUTClientTestComponent.*
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1 @@
Component-Class: J2XINOUTClientTestComponent

View File

@@ -0,0 +1,31 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH = ..\..\..\..\..\..
DIRS= \
java \
cpp \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,35 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
DIRS= \
java \
cpp \
$(NULL)
include $(DEPTH)/config/rules.mk

View File

@@ -0,0 +1,431 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "plstr.h"
#include "prenv.h"
#include "stdio.h"
#include "nsMemory.h"
#include "BCTest.h"
#include <sys/stat.h>
#include <stdlib.h>
#include "J2XOUTServerTestComponent.h"
#include "prmem.h"
#include "nsString.h"
#include "nsStringUtil.h"
char* testLocation=NULL;
char* logLocation=NULL;
char* fBuffer=NULL;
PRUint8 end_of_data = 112;
J2XOUTServerTestComponentImpl::J2XOUTServerTestComponentImpl()
{
NS_INIT_REFCNT();
printf("DEbug:avm:J2XOUTServerTestComponentImpl::J2XOUTServerTestComponentImp\n");
testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME);
logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME);
if((testLocation == NULL)||(logLocation == NULL)) {
fprintf(stderr,"ERROR: %s or %s isn't set !", BC_TEST_LOCATION_VAR_NAME, BC_LOG_LOCATION_VAR_NAME);
}
InitStackVars();
}
J2XOUTServerTestComponentImpl::~J2XOUTServerTestComponentImpl()
{
}
NS_IMPL_ISUPPORTS1(J2XOUTServerTestComponentImpl, iJ2XOUTServerTestComponent);
IMPL_PROCEED_RESULTS(J2XOUTServerTestComponentImpl)
IMPL_VAR_STACKS(J2XOUTServerTestComponentImpl)
NS_IMETHODIMP J2XOUTServerTestComponentImpl::GetTestLocation(char **tLocation, char **lLocation) {
*tLocation = testLocation;
*lLocation = logLocation;
return NS_OK;
}
/**
* Method Flush(const char *type) is used to flush content
* of fBuffer variable to file with result.
* Param: used to specify the type of tests. e.g short, string, ...
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::Flush(const char *type) {
char* fileName = NULL;
fileName = PR_sprintf_append(fileName,"j2x.out.server.%s",type);
if(fBuffer) {
PrintResult(fileName,fBuffer);
PR_smprintf_free(fBuffer);
fBuffer = NULL;
}
PR_smprintf_free(fileName);
return NS_OK;
}
/**
* Gets next value from internal stack of PRInt16 variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to PRInt16 variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestShort(PRInt16 *i) {
if(PRInt16Vars.size()) {
*i = PRInt16Vars.top();
PRInt16Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%hd\n",*i);
} else {
fprintf(stderr,"PRInt16Vars.size() is null\n");
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of PRInt32 variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to PRInt32 variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestLong(PRInt32 *i) {
if(PRInt32Vars.size()) {
*i = PRInt32Vars.top();
PRInt32Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%ld\n",*i);
} else {
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of PRInt64 variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to PRInt64 variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestLonglong(PRInt64 *i) {
if(PRInt64Vars.size()) {
*i = PRInt64Vars.top();
PRInt64Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%lld\n",*i);
} else {
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of PRUint8 variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to PRUint8 variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestByte(PRUint8 *i) {
if(PRUint8Vars.size()) {
*i = PRUint8Vars.top();
PRUint8Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
} else {
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of PRUint16 variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to PRUint16 variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestUShort(PRUint16 *i) {
if(PRUint16Vars.size()) {
*i = PRUint16Vars.top();
PRUint16Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%hu\n",*i);
} else {
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of PRUint32 variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to PRUint32 variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestULong(PRUint32 *i) {
if(PRUint32Vars.size()) {
*i = PRUint32Vars.top();
PRUint32Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%lu\n",*i);
} else {
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of PRUint64 variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to PRUint64 variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestULonglong(PRUint64 *i) {
if(PRUint64Vars.size()) {
*i = PRUint64Vars.top();
PRUint64Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%llu\n",*i);
} else {
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of float variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to float variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestFloat(float *i) {
if(floatVars.size()) {
*i = floatVars.top();
floatVars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",*i);
} else {
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of double variables,
* append it fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to double variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestDouble(double *i) {
if(doubleVars.size()) {
*i = doubleVars.top();
doubleVars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",*i);
} else {
*i = end_of_data;
}
return NS_OK;
}
/**
* Gets next value from internal stack of boolean variables,
* append it to fBuffer for future saving and return it via out parameter i
* Parameter i :This is pointer to boolean variable, that should be used to return value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestBoolean(PRBool *i) {
if(PRBoolVars.size()) {
*i = PRBoolVars.top();
PRBoolVars.pop();
if(*i == PR_TRUE) {
fBuffer = PR_sprintf_append(fBuffer,"%s\n","true");
}else {
fBuffer = PR_sprintf_append(fBuffer,"%s\n","false");
}
}
return NS_OK;
}
/*
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestChar(char *i) {
fBuffer = PR_sprintf_append(fBuffer,"%c\n",i);
return NS_OK;
}
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestWChar(PRUnichar *i) {
fBuffer = PR_sprintf_append(fBuffer,"%d\n",i);
return NS_OK;
}
*/
/**
* Returns some string value via out parameter i
* Parameter i :This is double pointer to char variable, that should be used to return string value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestString(char **i) {
char* str = "Some string";
PrintResult("j2x.out.server.string",str);
*i = PL_strdup(str);
return NS_OK;
}
/**
* Returns some unicode string value via out parameter i
* Parameter i :This is double pointer to PRUnichar variable, that should be used to return string value
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestWString(PRUnichar **i) {
char* str = "Some test string";
nsCString* cStr = new nsCString(str);
*i = cStr->ToNewUnicode();
//Verification code.
nsString nsStr = *(new nsString(*i));
NS_ALLOC_STR_BUF(aBuf,nsStr,100)
printf("aBuf is %s",aBuf);
PrintResult("j2x.out.server.wstring",aBuf);
NS_FREE_STR_BUF(aBuf)
return NS_OK;
//
PrintResult("j2x.out.server.wstring",str);
return NS_OK;
}
/**
* Fills array of strings and return it.
* Parameter count : PRUint32 value used to cpecify length of array
* Parameter valueArray: char*** variable. Used to return array of strings
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestStringArray(PRUint32 count, char ***valueArray) {
char* baseString = "This is base string N ";
*valueArray = (char**)PR_Calloc(sizeof(char*), count);
for(int i=0;i<count;i++) {
fprintf(stderr,"I is %d\n",i);
(*valueArray)[i] = PR_smprintf("%s %d",baseString,i);
}
for(int j=0;j<count;j++) {
fBuffer = PR_sprintf_append(fBuffer,"%s\n",(*valueArray)[j]);
}
Flush("stringArray");
return NS_OK;
}
/**
* Fills array of PRInt32 and return it.
* Parameter count : PRUint32 value used to cpecify length of array
* Parameter longArray: PRInt32** variable. Used to return array of PRInt32
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestLongArray(PRUint32 count, PRInt32 **longArray) {
*longArray = (PRInt32*)PR_Calloc(sizeof(PRInt32*),count);
for(int i=0;i<count;i++) {
(*longArray)[i] = 65600 + i; //Intend, that count is less than 2^16 :)
}
PrintResultArray("j2x.out.server.longArray",count,*longArray);
return NS_OK;
}
/**
* Fills array of PRInt32 and return it.
* Parameter count : PRUint32 value used to cpecify length of array
* Parameter valueArray: char** variable. Used to return array of chars
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestCharArray(PRUint32 count, char **valueArray) {
*valueArray = (char*)PR_Calloc(sizeof(char*), count);
for(int i=0;i<count;i++) {
(*valueArray)[i] = (65 + i)%96 + 32;
}
PrintResultArray("j2x.out.server.charArray",count,*valueArray);
return NS_OK;
}
/**
* Fills many variables of different types and return them.
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestMixed(PRBool *bBool,/* char cChar, */PRUint8 *nByte, PRInt16 *nShort, PRUint16 *nUShort, PRInt32 *nLong, PRUint32 *nULong, PRInt64 *nHyper, PRUint64 *nUHyper, float *fFloat, double *fDouble, char **aString, PRUint32 count, PRInt32 **longArray) {
*bBool=true;
*nByte=3;
*nShort=3; *nUShort=3;
*nLong=3; *nULong=3;
*nHyper=3; *nUHyper=3;
*fFloat=7;
*fDouble=7;
*aString=PL_strdup("abc");
*longArray = (PRInt32*)PR_Calloc(sizeof(PRInt32*),count);
for(int i=0;i<count;i++) {
(*longArray)[i] = 65600 + i; //Intend, that count is less than 2^16 :)
}
PrintResultMixed("j2x.out.server.mixed",*bBool, (char)'A',*nByte, *nShort,
*nUShort, *nLong, *nULong, *nHyper, *nUHyper, *fFloat,
*fDouble, *aString, count, *longArray);
return NS_OK;
}
/**
* Invoke method GetTestObjectString(char** str) and saves
* identification string, as result.Then return "this" as object
* Parameter obj: iJ2XOUTServerTestComponent ** variable. Used to return object
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::TestObject(iJ2XOUTServerTestComponent **obj) {
char * str;
GetTestObjectString(&str);
*obj = this;
PrintResult("j2x.out.server.object",str);
return NS_OK;
}
/**
* Auxiliary method, that used just for object indentification
* Invoked from client and from server, then identification strings compared.
*/
NS_IMETHODIMP J2XOUTServerTestComponentImpl::GetTestObjectString(char** str) {
*str = "String Ident";
return NS_OK;
}

View File

@@ -0,0 +1,61 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iJ2XOUTServerTestComponent.h"
#include "ProceedResults.h"
#include "VarContainer.h"
class J2XOUTServerTestComponentImpl : public iJ2XOUTServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XOUTSERVERTESTCOMPONENT
DECL_PROCEED_RESULTS
DECL_VAR_STACKS
J2XOUTServerTestComponentImpl();
virtual ~J2XOUTServerTestComponentImpl();
};
class _MYCLASS_ : public iJ2XOUTServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XOUTSERVERTESTCOMPONENT
_MYCLASS_();
virtual ~_MYCLASS_();
/* additional members */
};

View File

@@ -0,0 +1,39 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsIGenericFactory.h"
#include "J2XOUTServerTestComponent.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(J2XOUTServerTestComponentImpl)
static nsModuleComponentInfo components[] =
{
{ "J2XOUT Server Test Component", J2XOUTSERVERTESTCOMPONENT_CID, J2XOUTSERVERTESTCOMPONENT_PROGID, J2XOUTServerTestComponentImplConstructor,
NULL /* NULL if you dont need one */,
NULL /* NULL if you dont need one */
}
};
NS_IMPL_NSGETMODULE("J2XOUTServerTestComponentFactory", components)

View File

@@ -0,0 +1,60 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
include $(DEPTH)/config/config.mk
MODULE = J2XOUTServerTestComponent
LIBRARY_NAME = $(MODULE)
XPIDL_MODULE = $(MODULE)
IS_COMPONENT = 1
#It is not right !
#DSO_LDOPTS += -L$(DIST)/lib \
# -lnspr4 \
# $(NULL)
DSO_LDOPTS += \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
CPPSRCS = \
J2XOUTServerTestComponent.cpp \
J2XOUTServerTestComponentFactory.cpp \
$(NULL)
XPIDLSRCS = iJ2XOUTServerTestComponent.idl
JAVAI = iJ2XOUTServerTestComponent.java
include $(topsrcdir)/config/rules.mk
JAVAC=$(JDKHOME)/bin/javac -classpath $(DIST)/classes -d $(DIST)/classes
export::
$(JAVAC) $(JAVAI)

View File

@@ -0,0 +1,70 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
[scriptable, uuid(9c812168-7e00-4c15-a5dc-d5fd0846a554)]
interface iJ2XOUTServerTestComponent : nsISupports
{
void GetTestLocation(out string tLocation, out string lLocation);
void flush(in string s);
void TestShort(out short i);
void TestLong(out long i);
void TestLonglong(out long long i);
void TestByte(out octet i);
void TestUShort(out unsigned short i);
void TestULong(out unsigned long i);
void TestULonglong(out unsigned long long i);
void TestFloat(out float i);
void TestDouble(out double i);
void TestBoolean(out boolean i);
// void TestChar(out char i);
//void TestWChar(out wchar i);
void TestString(out string i);
void TestWString(out wstring i);
void TestStringArray(in unsigned long count,[array, size_is(count)] out string valueArray);
void TestLongArray(in unsigned long count, [array, size_is(count)] out long longArray);
void TestCharArray(in unsigned long count,[array, size_is(count)] out char valueArray);
void TestMixed(out boolean bBool,/* out char cChar,*/ out octet nByte,
out short nShort, out unsigned short nUShort,
out long nLong, out unsigned long nULong,
out long long nHyper, out unsigned long long nUHyper,
out float fFloat, out double fDouble,
out string aString,
in unsigned long count, [array, size_is(count)] out long longArray);
void TestObject(out iJ2XOUTServerTestComponent obj);
string GetTestObjectString();
};
%{ C++
#define J2XOUTSERVERTESTCOMPONENT_CID \
{ /*b1dcff02-0348-44ca-b662-29f5e375be27*/ \
0xb1dcff02, \
0x0348, \
0x44ca, \
{0xb6, 0x62, 0x29, 0xf5, 0xe3, 0x75, 0xbe, 0x27} \
}
#define J2XOUTSERVERTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/J2XOUTServer;1"
%}

View File

@@ -0,0 +1,87 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iJ2XOUTServerTestComponent.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iJ2XOUTServerTestComponent
*
* IID: 0x9c812168-7e00-4c15-a5dc-d5fd0846a554
*/
public interface iJ2XOUTServerTestComponent extends nsISupports
{
public static final IID IID =
new IID("9c812168-7e00-4c15-a5dc-d5fd0846a554");
/* void GetTestLocation (out string tLocation, out string lLocation); */
public void getTestLocation(String[] tLocation, String[] lLocation);
/* void flush (in string s); */
public void flush(String s);
/* void TestShort (out short i); */
public void testShort(short[] i);
/* void TestLong (out long i); */
public void testLong(int[] i);
/* void TestLonglong (out long long i); */
public void testLonglong(long[] i);
/* void TestByte (out octet i); */
public void testByte(byte[] i);
/* void TestUShort (out unsigned short i); */
public void testUShort(short[] i);
/* void TestULong (out unsigned long i); */
public void testULong(int[] i);
/* void TestULonglong (out unsigned long long i); */
public void testULonglong(long[] i);
/* void TestFloat (out float i); */
public void testFloat(float[] i);
/* void TestDouble (out double i); */
public void testDouble(double[] i);
/* void TestBoolean (out boolean i); */
public void testBoolean(boolean[] i);
/* void TestString (out string i); */
public void testString(String[] i);
/* void TestWString (out wstring i); */
public void testWString(String[] i);
/* void TestStringArray (in unsigned long count, [array, size_is (count)] out string valueArray); */
public void testStringArray(int count, String[][] valueArray);
/* void TestLongArray (in unsigned long count, [array, size_is (count)] out long longArray); */
public void testLongArray(int count, int[][] longArray);
/* void TestCharArray (in unsigned long count, [array, size_is (count)] out char valueArray); */
public void testCharArray(int count, char[][] valueArray);
/* void TestMixed (out boolean bBool, out octet nByte, out short nShort, out unsigned short nUShort, out long nLong, out unsigned long nULong, out long long nHyper, out unsigned long long nUHyper, out float fFloat, out double fDouble, out string aString, in unsigned long count, [array, size_is (count)] out long longArray); */
public void testMixed(boolean[] bBool, byte[] nByte, short[] nShort, short[] nUShort, int[] nLong, int[] nULong, long[] nHyper, long[] nUHyper, float[] fFloat, double[] fDouble, String[] aString, int count, int[][] longArray);
/* void TestObject (out iJ2XOUTServerTestComponent obj); */
public void testObject(iJ2XOUTServerTestComponent[] obj);
/* string GetTestObjectString (); */
public String getTestObjectString();
}
/*
* end
*/

View File

@@ -0,0 +1,60 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=..\..\..\..\..\..\..
MAKE_OBJ_TYPE = DLL
DLLNAME = J2XOUTServerTestComponent
DLL=.\$(OBJDIR)\$(DLLNAME).dll
MODULE = J2XOUTServerTestComponent
COMPONENT = 1
JAVAI= iJ2XOUTServerTestComponent.java
XPIDLSRCS = \
.\iJ2XOUTServerTestComponent.idl \
$(NULL)
CPP_OBJS= \
.\$(OBJDIR)\J2XOUTServerTestComponent.obj \
.\$(OBJDIR)\J2XOUTServerTestComponentFactory.obj \
$(NULL)
LLIBS= $(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(DEPTH)\config\rules.mak>
JAVAC=$(JDKHOME)\bin\javac -classpath $(CLASSPATH);$(DEPTH)\dist\classes -d $(DEPTH)\dist\classes
install:: $(DLL)
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
clobber::
del /f $(DIST)\bin\components\$(DLLNAME).dll
del /f $(DIST)\bin\components\J2XOUT*.xpt
export::
$(JAVAC) $(JAVAI)

View File

@@ -0,0 +1,2 @@
b73109a8-c552-497e-8f42-dc0b4a8fc422
@mozilla/blackwood/blackconnect/test/params/J2XOUTClient;1

View File

@@ -0,0 +1,422 @@
/* -*- Mode: Java; 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):
Client QA Team, St. Petersburg, Russia
*/
import org.mozilla.xpcom.*;
import java.lang.reflect.*;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.util.Hashtable;
public class J2XOUTClientTestComponent implements iJ2XOUTClientTestComponent, iClientTestComponent, iJClientTestComponent, iExclusionSupport {
private iJ2XOUTServerTestComponent server = null;
private String testLocation = null;
private String logLocation = null;
private byte endOfData = 112;
private Hashtable exclusionHash = new Hashtable();
public J2XOUTClientTestComponent() {
System.out.println("DEbug:avm:J2XOUTClientTestComponent constructor");
}
private void printResult(String res,String fileName) {
try{
DataOutputStream f=new DataOutputStream(new FileOutputStream(logLocation+"/" + fileName));
f.writeBytes(res);
f.close();
} catch(Exception e) {
System.err.println("Exception during writing the file: " +e);
e.printStackTrace();
}
}
public void exclude(int count, String[] exclusionList) {
System.out.println("DEbug:avm:J2XOUTClientTestComponent:exclude");
for(int i=0;i<count;i++) {
exclusionHash.put((Object)exclusionList[i],new Object());
}
}
public void initialize(String serverProgID) {
System.out.println("DEbug:avm:J2XOUTClientTestComponent:initialize");
//Really code from tHack should be here!!
}
public void tHack(nsIComponentManager cm, String serverProgID) {
System.out.println("DEbug:avm:J2XOUTClientTestComponent:tHack");
nsIFactory factory = null;
if(cm == null) {
System.out.println("DEbug:avm:ComponentManager is NULL!!!!!");
return;
}
factory = cm.findFactory(J2XOUTServerCID);
if(factory == null) {
System.out.println("DEbug:avm:Factory is NULL!!!!!");
return;
}
Object res = factory.createInstance(null, iJ2XOUTServerTestComponent.IID);
if(res == null) {
System.out.println("DEbug:avm:Instance is NULL!!!!!");
return;
}
server = (iJ2XOUTServerTestComponent)res;
if(server == null) {
System.err.println("Create instance failed!! Server is NULLLLLLLLLLLLLLLLLLL");
return;
}
String[] s = new String[1];
String[] s1 = new String[1];
server.getTestLocation(s,s1);
testLocation = s[0];
logLocation = s1[0];
}
/* void Execute (); */
public void execute() {
System.out.println("DEbug:avm:J2XOUTClientTestComponent:execute");
if(server == null) {
System.err.println("Server is not initialized!!!");
return;
}
if(!exclusionHash.containsKey("short"))
testShort();
if(!exclusionHash.containsKey("long"))
testLong();
if(!exclusionHash.containsKey("longlong"))
testLonglong();
if(!exclusionHash.containsKey("octet"))
testByte();
if(!exclusionHash.containsKey("ushort"))
testUshort();
if(!exclusionHash.containsKey("ulong"))
testsUlong();
if(!exclusionHash.containsKey("ulonglong"))
testsUlonglong();
if(!exclusionHash.containsKey("float"))
testsFloat();
if(!exclusionHash.containsKey("double"))
testDouble();
if(!exclusionHash.containsKey("boolean"))
testBoolean();
if(!exclusionHash.containsKey("string"))
testString();
if(!exclusionHash.containsKey("wstring"))
testsWstring();
if(!exclusionHash.containsKey("stringArray"))
testStringArray();
if(!exclusionHash.containsKey("longArray"))
testLongArray();
if(!exclusionHash.containsKey("charArray"))
testCharArray();
if(!exclusionHash.containsKey("object"))
testObject();
if(!exclusionHash.containsKey("mixed"))
testMixed();
}
/*
server.testMixed(boolean bBool, char cChar, byte nByte, short nShort, short nUShort, int nLong, int nULong, long nHyper, long nUHyper, float fFloat, double fDouble, String aString, int count, int longArray);
*/
private void testShort() {
StringBuffer s = new StringBuffer();
System.err.println("server.testShort");
short[] shortVar = new short[1];
server.testShort(shortVar);
while(shortVar[0] != endOfData) {
s.append(shortVar[0]+"\n");
server.testShort(shortVar);
}
printResult(s.toString(),"j2x.out.client.short");
server.flush("short");
}
private void testLong() {
StringBuffer s = new StringBuffer();
int[] intVar = new int[1];
System.err.println("server.testLong");
server.testLong(intVar);
while(intVar[0] != endOfData) {
s.append(intVar[0]+"\n");
server.testLong(intVar);
}
printResult(s.toString(),"j2x.out.client.long");
server.flush("long");
}
private void testLonglong() {
StringBuffer s = new StringBuffer();
long[] longVar = new long[1];
System.err.println("server.testLonglong");
server.testLonglong(longVar);
while(longVar[0] != endOfData) {
s.append(longVar[0]+"\n");
server.testLonglong(longVar);
}
printResult(s.toString(),"j2x.out.client.longlong");
server.flush("longlong");
}
private void testByte() {
StringBuffer s = new StringBuffer();
byte [] byteVar = new byte[1];
System.err.println("server.testByte");
server.testByte(byteVar);
while(byteVar[0] != endOfData) {
s.append(byteVar[0]+"\n");
server.testByte(byteVar);
}
printResult(s.toString(),"j2x.out.client.octet");
server.flush("octet");
}
private void testUshort() {
StringBuffer s = new StringBuffer();
short [] ushortVar = new short[1];
System.err.println("server.testUshort");
server.testUShort(ushortVar);
while(ushortVar[0] != endOfData) {
s.append(ushortVar[0]+"\n");
server.testUShort(ushortVar);
}
printResult(s.toString(),"j2x.out.client.ushort");
server.flush("ushort");
}
private void testsUlong() {
StringBuffer s = new StringBuffer();
int [] uintVar = new int[1];
System.err.println("server.testUlong");
server.testULong(uintVar);
while(uintVar[0] != endOfData) {
s.append(uintVar[0]+"\n");
server.testULong(uintVar);
}
printResult(s.toString(),"j2x.out.client.ulong");
server.flush("ulong");
}
private void testsUlonglong() {
StringBuffer s = new StringBuffer();
long [] ulongVar = new long[1];
System.err.println("server.testUlonglong");
server.testULonglong(ulongVar);
while(ulongVar[0] != endOfData) {
s.append(ulongVar[0]+"\n");
server.testULonglong(ulongVar);
}
printResult(s.toString(),"j2x.out.client.ulonglong");
server.flush("ulonglong");
}
private void testsFloat() {
StringBuffer s = new StringBuffer();
float [] floatVar = new float[1];
System.err.println("server.testFloat");
server.testFloat(floatVar);
while(floatVar[0] != endOfData) {
s.append(floatVar[0]+"\n");
server.testFloat(floatVar);
}
printResult(s.toString(),"j2x.out.client.float");
server.flush("float");
}
private void testDouble() {
StringBuffer s = new StringBuffer();
double [] doubleVar = new double[1];
System.err.println("server.testDouble");
server.testDouble(doubleVar);
while(doubleVar[0] != endOfData) {
s.append(doubleVar[0]+"\n");
server.testDouble(doubleVar);
}
printResult(s.toString(),"j2x.out.client.double");
server.flush("double");
}
private void testBoolean() {
StringBuffer s = new StringBuffer();
boolean [] booleanVar = new boolean[1];
System.err.println("server.testBoolean");
server.testBoolean(booleanVar);
s.append(booleanVar[0]+"\n");
server.testBoolean(booleanVar);
s.append(booleanVar[0]+"\n");
printResult(s.toString(),"j2x.out.client.boolean");
server.flush("boolean");
}
/*
//server.testChar(charVar);
//server.testWChar(charVar);
*/
private void testString() {
StringBuffer s = new StringBuffer();
String[] stringVar = new String[1];
server.testString(stringVar);
s.append(stringVar[0]+"\n");
printResult(s.toString(),"j2x.out.client.string");
server.flush("string");
}
private void testsWstring() {
StringBuffer s = new StringBuffer();
String[] stringVar = new String[1];
server.testWString(stringVar);
s.append(stringVar[0]+"\n");
printResult(s.toString(),"j2x.out.client.wstring");
server.flush("wstring");
}
private void testStringArray() {
String[][] stringArray = new String[1][4];
int count = 4;
StringBuffer s = new StringBuffer();
server.testStringArray(count, stringArray);
System.out.println("IIP");
for(int i=0;i<count;i++) {
s.append(stringArray[0][i]+"\n");
}
printResult(s.toString(),"j2x.out.client.stringArray");
}
private void testLongArray() {
StringBuffer s = new StringBuffer();
int[][] intArray = new int[1][100];
int count = 100;
server.testLongArray(count, intArray);
for(int i=0;i<count;i++) {
s.append(intArray[0][i]+"\n");
}
printResult(s.toString(),"j2x.out.client.longArray");
}
private void testCharArray() {
char[][] charArray = new char[1][100];
int count = 100;
StringBuffer s = new StringBuffer();
server.testCharArray(count, charArray);
for(int i=0;i<count;i++) {
s.append(charArray[0][i]+"\n");
}
printResult(s.toString(),"j2x.out.client.charArray");
}
private void testMixed() {
boolean[] bBool = new boolean[1];
char[] cChar = new char[1]; //Skip this value due to JDK1.3 bug
byte[] nByte = new byte[1];
short[] nShort = new short[1];
short[] nUShort = new short[1];
int[] nLong = new int[1];
int[] nULong = new int[1];
long[] nHyper = new long[1];
long[] nUHyper = new long[1];
float[] fFloat = new float[1];
double[] fDouble = new double[1];
String[] aString = new String[1];
int count = 5;
int[][] longArray = new int[1][count];
server.testMixed(bBool, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble, aString, count, longArray);
StringBuffer s = new StringBuffer();
s.append(bBool[0]+"\n");
s.append('A'+"\n");//Append zerro instead of skipped char
s.append(nByte[0]+"\n");
s.append(nShort[0]+"\n");
s.append(nUShort[0]+"\n");
s.append(nLong[0]+"\n");
s.append(nULong[0]+"\n");
s.append(nHyper[0]+"\n");
s.append(nUHyper[0]+"\n");
s.append(fFloat[0]+"\n");
s.append(fDouble[0]+"\n");
s.append(aString[0]+"\n");
//s.append(count+"\n");
for(int i=0;i<count;i++) {
s.append(longArray[0][i]+"\n");
}
printResult(s.toString(),"j2x.out.client.mixed");
//flush is'n required here !!!
}
private void testObject() {
iJ2XOUTServerTestComponent[] iServer = new iJ2XOUTServerTestComponent[1];
server.testObject(iServer);
printResult(iServer[0].getTestObjectString(),"j2x.out.client.object");
}
public Object queryInterface(IID iid) {
System.out.println("DEbug:avm:J2XOUTClientTestComponent::queryInterface iid="+iid);
if ( iid.equals(nsISupports.IID)
|| iid.equals(iJ2XOUTClientTestComponent.IID)||iid.equals(iClientTestComponent.IID)||iid.equals(iExclusionSupport.IID)) {
return this;
} else {
return null;
}
}
static CID J2XOUTServerCID = new CID("b1dcff02-0348-44ca-b662-29f5e375be27");
static {
try {
try {
System.err.println("2XINClientTestComponent Classloader is " + Class.forName("J2XOUTClientTestComponent").getClassLoader());
Class c = Class.forName("S");
}catch(Exception e) {
System.err.println("INClientTestComponent Classloa BLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL");
}
System.out.println("J2XOUTClientTestComponent - static block ");
Class nsIComponentManagerClass =
Class.forName("org.mozilla.xpcom.nsIComponentManager");
InterfaceRegistry.register(nsIComponentManagerClass);
Class proxyHandlerClass =
Class.forName("org.mozilla.xpcom.ProxyHandler");
InterfaceRegistry.register(proxyHandlerClass);
Class nsIFileClass =
Class.forName("org.mozilla.xpcom.nsIFile");
InterfaceRegistry.register(nsIFileClass);
Class nsIFactoryClass =
Class.forName("org.mozilla.xpcom.nsIFactory");
InterfaceRegistry.register(nsIFactoryClass);
Class nsIEnumeratorClass =
Class.forName("org.mozilla.xpcom.nsIEnumerator");
InterfaceRegistry.register(nsIEnumeratorClass);
System.out.println("DE bug:avm:before registeringiJ2XOUTServerTestComponent ");
Class iJ2XOUTServerTestComponentClass =
Class.forName("org.mozilla.xpcom.iJ2XOUTServerTestComponent");
InterfaceRegistry.register(iJ2XOUTServerTestComponentClass);
} catch (Exception e) {
System.err.println("#####################################################################");
System.err.println("####################EXCEPTION during interface initialization############");
System.err.println(e);
} catch (Error e) {
System.err.println("#####################################################################");
System.err.println("####################Error during interface initialization############");
System.err.println(e);
}
}
}

View File

@@ -0,0 +1,57 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
JAVA_OR_NSJVM=1
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
JAVA_SRC = \
J2XOUTClientTestComponent.java
JAVAI_SRC = \
iJ2XOUTClientTestComponent.java
J2XOUTClientTestComponent.jar.comp: manifest javai J2XOUTClientTestComponent.class
$(JDKHOME)/bin/jar cvfm J2XOUTClientTestComponent.jar.comp manifest *.class
J2XOUTClientTestComponent.class:
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes $(JAVA_SRC)
javai::
$(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes -d $(DEPTH)/dist/classes $(JAVAI_SRC)
install-component: J2XOUTClientTestComponent.jar.comp J2XOUTClientTestComponent.jar.info
cp -f J2XOUTClientTestComponent.jar* $(DIST)/bin/components
clobber::
rm -f *.class *.jar.comp
rm -f $(DIST)/bin/components/J2XOUTClientTestComponent.jar.*
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1,47 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iClientTestComponent.idl"
[scriptable, uuid(c258526f-2789-4476-9981-8eb5d95218f1)]
interface iJ2XOUTClientTestComponent : nsISupports
{
};
%{ C++
#define J2XOUTCLIENTTESTCOMPONENT_CID \
{ /*b73109a8-c552-497e-8f42-dc0b4a8fc422*/ \
0xb73109a8, \
0xc552, \
0x497e, \
{0x8f, 0x42, 0xdc, 0x0b, 0x4a, 0x8f, 0xc4, 0x22} \
}
#define J2XOUTCLIENTTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/J2XOUTClient;1"
%}

View File

@@ -0,0 +1,27 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iJ2XOUTClientTestComponent.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iJ2XOUTClientTestComponent
*
* IID: 0xc258526f-2789-4476-9981-8eb5d95218f1
*/
public interface iJ2XOUTClientTestComponent extends nsISupports
{
public static final IID IID =
new IID("c258526f-2789-4476-9981-8eb5d95218f1");
}
/*
* end
*/

View File

@@ -0,0 +1,65 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH = ..\..\..\..\..\..\..
topsrcdir = ..\..\..\..\..\..\..
srcdir = .
VPATH = .
MAKE_OBJ_TYPE=DLL
MODULE=J2XOUTClientTestComponent
COMPONENT=1
XPIDLSRCS = \
.\iJ2XOUTClientTestComponent.idl \
$(NULL)
JAVA_SRC = \
J2XOUTClientTestComponent.java
JAVAI_SRC = \
iJ2XOUTClientTestComponent.java
include <$(DEPTH)\config\rules.mak>
J2XOUTClientTestComponent.jar.comp: manifest J2XOUTClientTestComponent.class
$(JDKHOME)\bin\jar cvfm J2XOUTClientTestComponent.jar.comp manifest *.class
J2XOUTClientTestComponent.class:
$(JDKHOME)\bin\javac -classpath $(DEPTH)/dist/classes $(JAVA_SRC)
javai:
echo $(JDKHOME)\bin\javac -classpath $(CLASSPATH);$(DEPTH)\dist\classes -d $(DEPTH)\dist\classes $(JAVAI_SRC)
$(JDKHOME)\bin\javac -classpath $(CLASSPATH);$(DEPTH)\dist\classes -d $(DEPTH)\dist\classes $(JAVAI_SRC)
install-component: javai J2XOUTClientTestComponent.jar.comp J2XOUTClientTestComponent.jar.info $(DLL)
copy J2XOUTClientTestComponent.jar* $(DIST)\bin\components
clobber::
-del /f *.class *.jar.comp
-del /f $(DIST)\bin\components\J2XOUTClientTestComponent.jar.*
-del /f $(DIST)\..\classes\org\mozilla\xpcom\iJ2XOUTServerTestComponent.*
-del /f $(DIST)\..\classes\org\mozilla\xpcom\iJ2XOUTClientTestComponent.*
clobber_all:: clobber
install:: install-component

View File

@@ -0,0 +1 @@
Component-Class: J2XOUTClientTestComponent

View File

@@ -0,0 +1,31 @@
#!nmake
#
# 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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH = ..\..\..\..\..\..
DIRS= \
java \
cpp \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,35 @@
#!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):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
DIRS= \
java \
cpp \
$(NULL)
include $(DEPTH)/config/rules.mk

View File

@@ -0,0 +1,364 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "plstr.h"
#include "prenv.h"
#include "stdio.h"
#include "nsMemory.h"
#include "BCTest.h"
#include <sys/stat.h>
#include <stdlib.h>
#include "J2XRETServerTestComponent.h"
#include "prmem.h"
#include "nsString.h"
#include "nsStringUtil.h"
char* testLocation=NULL;
char* logLocation=NULL;
char* fBuffer=NULL;
PRUint8 end_of_data = 112;
int all=0;
J2XRETServerTestComponentImpl::J2XRETServerTestComponentImpl()
{
NS_INIT_REFCNT();
testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME);
logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME);
InitStackVars();
printf("DEbug:avm:J2XRETServerTestComponentImpl::J2XRETServerTestComponentImp\n");
}
J2XRETServerTestComponentImpl::~J2XRETServerTestComponentImpl()
{
}
NS_IMPL_ISUPPORTS1(J2XRETServerTestComponentImpl, iJ2XRETServerTestComponent);
IMPL_PROCEED_RESULTS(J2XRETServerTestComponentImpl)
IMPL_VAR_STACKS(J2XRETServerTestComponentImpl)
NS_IMETHODIMP J2XRETServerTestComponentImpl::GetTestLocation(char **tLocation, char **lLocation) {
*tLocation = testLocation;
*lLocation = logLocation;
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::Flush(const char *type) {
char* fileName = NULL;
fileName = PR_sprintf_append(fileName,"j2x.ret.server.%s",type);
if(fBuffer) {
PrintResult(fileName,fBuffer);
PR_smprintf_free(fileName);
PR_smprintf_free(fBuffer);
fBuffer = NULL;
} else {
}
if(fBuffer != NULL ) {
}else {
}
all=0;
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestShort(PRInt16 *i) {
if(PRInt16Vars.size()) {
*i = PRInt16Vars.top();
PRInt16Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%hd\n",*i);
} else {
*i = end_of_data;
Flush("short");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestLong(PRInt32 *i) {
if(PRInt32Vars.size()) {
*i = PRInt32Vars.top();
PRInt32Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%ld\n",*i);
} else {
*i = end_of_data;
Flush("long");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestLonglong(PRInt64 *i) {
if(PRInt64Vars.size()) {
*i = PRInt64Vars.top();
PRInt64Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%lld\n",*i);
} else {
*i = end_of_data;
Flush("longlong");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestByte(PRUint8 *i) {
if(PRUint8Vars.size()) {
*i = PRUint8Vars.top();
PRUint8Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
} else {
*i = end_of_data;
Flush("octet");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestUShort(PRUint16 *i) {
if(PRUint16Vars.size()) {
*i = PRUint16Vars.top();
PRUint16Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%hu\n",*i);
} else {
*i = end_of_data;
Flush("ushort");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestULong(PRUint32 *i) {
if(PRUint32Vars.size()) {
*i = PRUint32Vars.top();
PRUint32Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%lu\n",*i);
} else {
*i = end_of_data;
Flush("ulong");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestULonglong(PRUint64 *i) {
if(PRUint64Vars.size()) {
*i = PRUint64Vars.top();
PRUint64Vars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%llu\n",*i);
} else {
*i = end_of_data;
Flush("ulonglong");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestFloat(float *i) {
if(floatVars.size()) {
*i = floatVars.top();
floatVars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",*i);
} else {
*i = end_of_data;
Flush("float");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestDouble(double *i) {
if(doubleVars.size()) {
*i = doubleVars.top();
doubleVars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",*i);
} else {
*i = end_of_data;
Flush("double");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestBoolean(PRBool *i) {
if(PRBoolVars.size()) {
*i = PRBoolVars.top();
PRBoolVars.pop();
if(*i == PR_TRUE) {
fBuffer = PR_sprintf_append(fBuffer,"%s\n","true");
}else if (*i == PR_FALSE) {
fBuffer = PR_sprintf_append(fBuffer,"%s\n","false");
}
} else Flush("boolean");
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestChar(char *i) {
if(charVars.size()) {
*i = charVars.top();
charVars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%c\n",*i);
} else {
*i = end_of_data;
Flush("char");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestWChar(PRUnichar *i) {
if(wcharVars.size()) {
*i = wcharVars.top();
wcharVars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%c\n",*i);
} else {
*i = end_of_data;
Flush("wchar");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestString(char* *i) {
if(stringVars.size()) {
*i = stringVars.top();
stringVars.pop();
fBuffer = PR_sprintf_append(fBuffer,"%s\n",*i);
} else {
*i="";
fBuffer = PR_sprintf_append(fBuffer,"%s",*i);
Flush("string");
}
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestWString(PRUnichar* *i) {
char* _string="";
if (all==0) {
_string="";
nsCString* cstr=new nsCString(_string);
*i=cstr->ToNewUnicode();
nsString str = *(new nsString(*i));
{
NS_ALLOC_STR_BUF(aBuf,str,100)
fBuffer=PR_sprintf_append(fBuffer,"%s\n",aBuf);
NS_FREE_STR_BUF(aBuf)
}
}
if (all==1) {
_string="Test string.";
nsCString* cstr=new nsCString(_string);
*i=cstr->ToNewUnicode();
nsString str = *(new nsString(*i));
{
NS_ALLOC_STR_BUF(aBuf,str,100)
fBuffer=PR_sprintf_append(fBuffer,"%s\n",aBuf);
NS_FREE_STR_BUF(aBuf)
}
}
if (all==2) {
_string="null string";
nsCString* cstr=new nsCString(_string);
*i=cstr->ToNewUnicode();
nsString str = *(new nsString(*i));
{
NS_ALLOC_STR_BUF(aBuf,str,100)
fBuffer=PR_sprintf_append(fBuffer,"%s\n",aBuf);
NS_FREE_STR_BUF(aBuf)
}
Flush("wstring");
}
all++;
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestStringArray(PRUint32 count, char ***valueArray) {
char** _ret=(char**)PR_Malloc(sizeof(char*)*3);
_ret[0]="ctrl-f";
_ret[1]="iddqd";
_ret[2]="idkfa";
for(int j=0;j<count;j++)
fBuffer = PR_sprintf_append(fBuffer,"%s\n",_ret[j]);
Flush("stringArray");
*valueArray=_ret;
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestLongArray(PRUint32 count, int **intA) {
int *ret=(int*)PR_Malloc(sizeof(int)*3);
ret[0]=33;
ret[1]=44;
ret[2]=55;
for(int j=0;j<count;j++)
fBuffer = PR_sprintf_append(fBuffer,"%d\n",ret[j]);
Flush("longArray");
*intA=ret;
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestCharArray(PRUint32 count, char **valueArray) {
char* ret=(char*)PR_Malloc(sizeof(char)*3);
ret[0]='x';
ret[1]='y';
ret[2]='z';
for(int j=0;j<count;j++)
fBuffer = PR_sprintf_append(fBuffer,"%c\n",ret[j]);
Flush("charArray");
*valueArray=ret;
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestObject(iJ2XRETServerTestComponent **obj) {
*obj=this;
return NS_OK;
}
NS_IMETHODIMP J2XRETServerTestComponentImpl::TestObj() {
fBuffer = PR_sprintf_append(fBuffer,"!!!Right string!!!");
Flush("object");
return NS_OK;
}

View File

@@ -0,0 +1,61 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "iJ2XRETServerTestComponent.h"
#include "ProceedResults.h"
#include "VarContainer.h"
class J2XRETServerTestComponentImpl : public iJ2XRETServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XRETSERVERTESTCOMPONENT
DECL_PROCEED_RESULTS
DECL_VAR_STACKS
J2XRETServerTestComponentImpl();
virtual ~J2XRETServerTestComponentImpl();
};
class _MYCLASS_ : public iJ2XRETServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XRETSERVERTESTCOMPONENT
_MYCLASS_();
virtual ~_MYCLASS_();
/* additional members */
};

View File

@@ -0,0 +1,39 @@
/* -*- 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):
Client QA Team, St. Petersburg, Russia
*/
#include "nsIGenericFactory.h"
#include "J2XRETServerTestComponent.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(J2XRETServerTestComponentImpl)
static nsModuleComponentInfo components[] =
{
{ "J2XRET Server Test Component", J2XRETSERVERTESTCOMPONENT_CID, J2XRETSERVERTESTCOMPONENT_PROGID, J2XRETServerTestComponentImplConstructor,
NULL /* NULL if you dont need one */,
NULL /* NULL if you dont need one */
}
};
NS_IMPL_NSGETMODULE("J2XRETServerTestComponentFactory", components)

Some files were not shown because too many files have changed in this diff Show More