diff --git a/mozilla/java/xpcom/test/Makefile.in b/mozilla/java/xpcom/test/Makefile.in new file mode 100644 index 00000000000..330a788bc85 --- /dev/null +++ b/mozilla/java/xpcom/test/Makefile.in @@ -0,0 +1,34 @@ +#!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= \ + basic \ + $(NULL) + +include $(topsrcdir)/config/rules.mk diff --git a/mozilla/java/xpcom/test/README b/mozilla/java/xpcom/test/README new file mode 100644 index 00000000000..8d0be734764 --- /dev/null +++ b/mozilla/java/xpcom/test/README @@ -0,0 +1 @@ +see basic/params/README diff --git a/mozilla/java/xpcom/test/basic/Makefile.in b/mozilla/java/xpcom/test/basic/Makefile.in new file mode 100644 index 00000000000..010b513a925 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/Makefile.in @@ -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 diff --git a/mozilla/java/xpcom/test/basic/makefile.win b/mozilla/java/xpcom/test/basic/makefile.win new file mode 100644 index 00000000000..5957b2f72eb --- /dev/null +++ b/mozilla/java/xpcom/test/basic/makefile.win @@ -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> + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/1/MThreadComponent1.jar.info b/mozilla/java/xpcom/test/basic/mthreads/1/MThreadComponent1.jar.info new file mode 100644 index 00000000000..835263e97fd --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/1/MThreadComponent1.jar.info @@ -0,0 +1,2 @@ +a3532005-66d4-4988-8067-dd1928c60138 +component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent1 diff --git a/mozilla/java/xpcom/test/basic/mthreads/1/MThreadComponent1.java b/mozilla/java/xpcom/test/basic/mthreads/1/MThreadComponent1.java new file mode 100644 index 00000000000..917b2f3e9af --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/1/MThreadComponent1.java @@ -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(); + } + } +} + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/1/Makefile.in b/mozilla/java/xpcom/test/basic/mthreads/1/Makefile.in new file mode 100644 index 00000000000..31bad83cf86 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/1/Makefile.in @@ -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 diff --git a/mozilla/java/xpcom/test/basic/mthreads/1/iMThreadComponent1.idl b/mozilla/java/xpcom/test/basic/mthreads/1/iMThreadComponent1.idl new file mode 100644 index 00000000000..ecd188c8911 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/1/iMThreadComponent1.idl @@ -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" + +%} + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/1/iMThreadComponent1.java b/mozilla/java/xpcom/test/basic/mthreads/1/iMThreadComponent1.java new file mode 100644 index 00000000000..87f17355019 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/1/iMThreadComponent1.java @@ -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 + */ diff --git a/mozilla/java/xpcom/test/basic/mthreads/1/makefile.win b/mozilla/java/xpcom/test/basic/mthreads/1/makefile.win new file mode 100644 index 00000000000..6a2a800846f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/1/makefile.win @@ -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 diff --git a/mozilla/java/xpcom/test/basic/mthreads/1/manifest b/mozilla/java/xpcom/test/basic/mthreads/1/manifest new file mode 100644 index 00000000000..b2c42e8b52a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/1/manifest @@ -0,0 +1 @@ +Component-Class: MThreadComponent1 diff --git a/mozilla/java/xpcom/test/basic/mthreads/1/nsIComponentManager.java b/mozilla/java/xpcom/test/basic/mthreads/1/nsIComponentManager.java new file mode 100644 index 00000000000..a95b3b57459 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/1/nsIComponentManager.java @@ -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:" while filenames that are not, will have + * "abs:". + */ + + /* 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 + */ diff --git a/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2.cpp b/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2.cpp new file mode 100644 index 00000000000..0b712bd6741 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2.cpp @@ -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 +#include +#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); + +} + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2.h b/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2.h new file mode 100644 index 00000000000..9cc4ff0f127 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2.h @@ -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 +}; + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2Factory.cpp b/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2Factory.cpp new file mode 100644 index 00000000000..ad17cdc5c3d --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/2/MThreadComponent2Factory.cpp @@ -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) + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/2/Makefile.in b/mozilla/java/xpcom/test/basic/mthreads/2/Makefile.in new file mode 100644 index 00000000000..d59b7d35de0 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/2/Makefile.in @@ -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) + diff --git a/mozilla/java/xpcom/test/basic/mthreads/2/iMThreadComponent2.idl b/mozilla/java/xpcom/test/basic/mthreads/2/iMThreadComponent2.idl new file mode 100644 index 00000000000..d003d1fb8ec --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/2/iMThreadComponent2.idl @@ -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" + +%} + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/2/iMThreadComponent2.java b/mozilla/java/xpcom/test/basic/mthreads/2/iMThreadComponent2.java new file mode 100644 index 00000000000..427a40532cf --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/2/iMThreadComponent2.java @@ -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 + */ diff --git a/mozilla/java/xpcom/test/basic/mthreads/2/makefile.win b/mozilla/java/xpcom/test/basic/mthreads/2/makefile.win new file mode 100644 index 00000000000..3328a6156b6 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/2/makefile.win @@ -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 diff --git a/mozilla/java/xpcom/test/basic/mthreads/3/MThreadComponent3.jar.info b/mozilla/java/xpcom/test/basic/mthreads/3/MThreadComponent3.jar.info new file mode 100644 index 00000000000..e20bf4f72f1 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/3/MThreadComponent3.jar.info @@ -0,0 +1,2 @@ +14aac93e-d49c-4b03-a384-12e8ca9c310a +component://netscape/blackwood/blackconnect/test/mthreads/MThreadComponent3 diff --git a/mozilla/java/xpcom/test/basic/mthreads/3/MThreadComponent3.java b/mozilla/java/xpcom/test/basic/mthreads/3/MThreadComponent3.java new file mode 100644 index 00000000000..f7e27bf8e61 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/3/MThreadComponent3.java @@ -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(); + } + } +} + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/3/Makefile.in b/mozilla/java/xpcom/test/basic/mthreads/3/Makefile.in new file mode 100644 index 00000000000..2a0c1220b0b --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/3/Makefile.in @@ -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 diff --git a/mozilla/java/xpcom/test/basic/mthreads/3/iMThreadComponent3.idl b/mozilla/java/xpcom/test/basic/mthreads/3/iMThreadComponent3.idl new file mode 100644 index 00000000000..3f2b686b116 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/3/iMThreadComponent3.idl @@ -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" + +%} + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/3/iMThreadComponent3.java b/mozilla/java/xpcom/test/basic/mthreads/3/iMThreadComponent3.java new file mode 100644 index 00000000000..2555bbb8e78 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/3/iMThreadComponent3.java @@ -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 + */ diff --git a/mozilla/java/xpcom/test/basic/mthreads/3/makefile.win b/mozilla/java/xpcom/test/basic/mthreads/3/makefile.win new file mode 100644 index 00000000000..82689969890 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/3/makefile.win @@ -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 diff --git a/mozilla/java/xpcom/test/basic/mthreads/3/manifest b/mozilla/java/xpcom/test/basic/mthreads/3/manifest new file mode 100644 index 00000000000..b517b640697 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/3/manifest @@ -0,0 +1 @@ +Component-Class: MThreadComponent3 diff --git a/mozilla/java/xpcom/test/basic/mthreads/MTest.lst b/mozilla/java/xpcom/test/basic/mthreads/MTest.lst new file mode 100644 index 00000000000..5a67fca719a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/MTest.lst @@ -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 + diff --git a/mozilla/java/xpcom/test/basic/mthreads/Makefile.in b/mozilla/java/xpcom/test/basic/mthreads/Makefile.in new file mode 100644 index 00000000000..c322e5fc6eb --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/Makefile.in @@ -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 + diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/ExecutionThread.java b/mozilla/java/xpcom/test/basic/mthreads/context/ExecutionThread.java new file mode 100644 index 00000000000..5541f5d2a5a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/ExecutionThread.java @@ -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"); + } + } + +} diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContext.cpp b/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContext.cpp new file mode 100644 index 00000000000..e8c5edd066c --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContext.cpp @@ -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 +#include +#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; +} + + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContext.h b/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContext.h new file mode 100644 index 00000000000..a69001d494a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContext.h @@ -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 */ +}; + + + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContextFactory.cpp b/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContextFactory.cpp new file mode 100644 index 00000000000..c3355eb7114 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/MThreadContextFactory.cpp @@ -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) + diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/Makefile.in b/mozilla/java/xpcom/test/basic/mthreads/context/Makefile.in new file mode 100644 index 00000000000..8abcd747482 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/Makefile.in @@ -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) + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadComponent.idl b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadComponent.idl new file mode 100644 index 00000000000..9c0c27daf28 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadComponent.idl @@ -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); +}; diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadComponent.java b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadComponent.java new file mode 100644 index 00000000000..0d386c7d214 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadComponent.java @@ -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 + */ diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.h b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.h new file mode 100644 index 00000000000..da13b58283f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.h @@ -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__ */ diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.idl b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.idl new file mode 100644 index 00000000000..73fdc238e84 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.idl @@ -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" + +%} diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.java b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.java new file mode 100644 index 00000000000..9130e8d1e15 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/iMThreadContext.java @@ -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 + */ diff --git a/mozilla/java/xpcom/test/basic/mthreads/context/makefile.win b/mozilla/java/xpcom/test/basic/mthreads/context/makefile.win new file mode 100644 index 00000000000..d2311d6d467 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/context/makefile.win @@ -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 \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/mthreads/makefile.win b/mozilla/java/xpcom/test/basic/mthreads/makefile.win new file mode 100644 index 00000000000..be3ccc197fe --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/makefile.win @@ -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> + diff --git a/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStart.cpp b/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStart.cpp new file mode 100644 index 00000000000..d64a88818eb --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStart.cpp @@ -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 +#include +#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); + + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStart.h b/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStart.h new file mode 100644 index 00000000000..c3159e67137 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStart.h @@ -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 +}; + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStartFactory.cpp b/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStartFactory.cpp new file mode 100644 index 00000000000..a0589ff81a0 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/mtstart/MTStartFactory.cpp @@ -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) + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/mtstart/Makefile.in b/mozilla/java/xpcom/test/basic/mthreads/mtstart/Makefile.in new file mode 100644 index 00000000000..85e36ea2f89 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/mtstart/Makefile.in @@ -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) + diff --git a/mozilla/java/xpcom/test/basic/mthreads/mtstart/iMTStart.idl b/mozilla/java/xpcom/test/basic/mthreads/mtstart/iMTStart.idl new file mode 100644 index 00000000000..bd783f6c25a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/mtstart/iMTStart.idl @@ -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" + +%} + + diff --git a/mozilla/java/xpcom/test/basic/mthreads/mtstart/iMTStart.java b/mozilla/java/xpcom/test/basic/mthreads/mtstart/iMTStart.java new file mode 100644 index 00000000000..cc2dad6f8ca --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/mtstart/iMTStart.java @@ -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 + */ diff --git a/mozilla/java/xpcom/test/basic/mthreads/mtstart/makefile.win b/mozilla/java/xpcom/test/basic/mthreads/mtstart/makefile.win new file mode 100644 index 00000000000..0e16b9bd895 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/mtstart/makefile.win @@ -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 diff --git a/mozilla/java/xpcom/test/basic/mthreads/mtstart/start.html b/mozilla/java/xpcom/test/basic/mthreads/mtstart/start.html new file mode 100644 index 00000000000..0d00a331432 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/mthreads/mtstart/start.html @@ -0,0 +1,11 @@ + + + + + +This file can be used to start BlackConnect MULTI-thread tests. + \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/BCTest.lst b/mozilla/java/xpcom/test/basic/params/BCTest.lst new file mode 100644 index 00000000000..f7103b17b5a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/BCTest.lst @@ -0,0 +1,8 @@ +X2JIN +X2JOUT +X2JINOUT +X2JRET +J2XIN +J2XOUT +J2XINOUT +J2XRET diff --git a/mozilla/java/xpcom/test/basic/params/BCTest.lst.old b/mozilla/java/xpcom/test/basic/params/BCTest.lst.old new file mode 100644 index 00000000000..09a562ed3b2 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/BCTest.lst.old @@ -0,0 +1,9 @@ +X2JIN +X2JOUT +X2JINOUT +X2JRET +J2XIN +J2XOUT +J2XINOUT +J2XRET + diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/Makefile.in b/mozilla/java/xpcom/test/basic/params/J2XIN/Makefile.in new file mode 100644 index 00000000000..25b1fc2a7c1 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/Makefile.in @@ -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 diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponent.cpp b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponent.cpp new file mode 100644 index 00000000000..28fb3cbb02f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponent.cpp @@ -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 +#include +#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; +} diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponent.h b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponent.h new file mode 100644 index 00000000000..b69b6046b5a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponent.h @@ -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 */ +}; + + + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponentFactory.cpp b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponentFactory.cpp new file mode 100644 index 00000000000..6b9733d7ab0 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/J2XINServerTestComponentFactory.cpp @@ -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) + diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/Makefile.in b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/Makefile.in new file mode 100644 index 00000000000..7436a1a5ece --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/Makefile.in @@ -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) diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/iJ2XINServerTestComponent.idl b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/iJ2XINServerTestComponent.idl new file mode 100644 index 00000000000..8b6923eec8d --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/iJ2XINServerTestComponent.idl @@ -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" + +%} diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/iJ2XINServerTestComponent.java b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/iJ2XINServerTestComponent.java new file mode 100644 index 00000000000..2c2db9d4832 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/iJ2XINServerTestComponent.java @@ -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 + */ diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/makefile.win b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/makefile.win new file mode 100644 index 00000000000..75e1794dab6 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/cpp/makefile.win @@ -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 diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/java/J2XINClientTestComponent.jar.info b/mozilla/java/xpcom/test/basic/params/J2XIN/java/J2XINClientTestComponent.jar.info new file mode 100644 index 00000000000..e8c0156b004 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/java/J2XINClientTestComponent.jar.info @@ -0,0 +1,2 @@ +f10e3970-9778-11d4-aa21-00a024a8bbac +@mozilla/blackwood/blackconnect/test/params/J2XINClient;1 diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/java/J2XINClientTestComponent.java b/mozilla/java/xpcom/test/basic/params/J2XIN/java/J2XINClientTestComponent.java new file mode 100644 index 00000000000..edac6923513 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/java/J2XINClientTestComponent.java @@ -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 + +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 diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/java/manifest b/mozilla/java/xpcom/test/basic/params/J2XIN/java/manifest new file mode 100644 index 00000000000..0eaafdfab00 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/java/manifest @@ -0,0 +1 @@ +Component-Class: J2XINClientTestComponent diff --git a/mozilla/java/xpcom/test/basic/params/J2XIN/makefile.win b/mozilla/java/xpcom/test/basic/params/J2XIN/makefile.win new file mode 100644 index 00000000000..0b262e05c41 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XIN/makefile.win @@ -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> diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/Makefile.in b/mozilla/java/xpcom/test/basic/params/J2XINOUT/Makefile.in new file mode 100644 index 00000000000..25b1fc2a7c1 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/Makefile.in @@ -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 diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponent.cpp b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponent.cpp new file mode 100644 index 00000000000..9ff0df41f4a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponent.cpp @@ -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 +#include +#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;iTestObj(); + 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; +} diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponent.h b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponent.h new file mode 100644 index 00000000000..c561c462263 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponent.h @@ -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 */ +}; + + + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponentFactory.cpp b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponentFactory.cpp new file mode 100644 index 00000000000..2db39c86a3c --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/J2XINOUTServerTestComponentFactory.cpp @@ -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) + + diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/Makefile.in b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/Makefile.in new file mode 100644 index 00000000000..a515f7518b4 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/Makefile.in @@ -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) diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/iJ2XINOUTServerTestComponent.idl b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/iJ2XINOUTServerTestComponent.idl new file mode 100644 index 00000000000..89655b5e908 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/iJ2XINOUTServerTestComponent.idl @@ -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" + +%} diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/iJ2XINOUTServerTestComponent.java b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/iJ2XINOUTServerTestComponent.java new file mode 100644 index 00000000000..cd8038b30c4 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/iJ2XINOUTServerTestComponent.java @@ -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 + */ diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/makefile.win b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/makefile.win new file mode 100644 index 00000000000..3052820fc87 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/cpp/makefile.win @@ -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) + diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/J2XINOUTClientTestComponent.jar.info b/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/J2XINOUTClientTestComponent.jar.info new file mode 100644 index 00000000000..19890bd2257 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/J2XINOUTClientTestComponent.jar.info @@ -0,0 +1,2 @@ +1a7ecb30-6a68-4894-943f-e227bebf3861 +@mozilla/blackwood/blackconnect/test/params/J2XINOUTClient;1 diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/J2XINOUTClientTestComponent.java b/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/J2XINOUTClientTestComponent.java new file mode 100644 index 00000000000..8dea61afdda --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/J2XINOUTClientTestComponent.java @@ -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 + +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 diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/manifest b/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/manifest new file mode 100644 index 00000000000..87534d3eaeb --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/java/manifest @@ -0,0 +1 @@ +Component-Class: J2XINOUTClientTestComponent diff --git a/mozilla/java/xpcom/test/basic/params/J2XINOUT/makefile.win b/mozilla/java/xpcom/test/basic/params/J2XINOUT/makefile.win new file mode 100644 index 00000000000..851c443ba03 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XINOUT/makefile.win @@ -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> diff --git a/mozilla/java/xpcom/test/basic/params/J2XOUT/Makefile.in b/mozilla/java/xpcom/test/basic/params/J2XOUT/Makefile.in new file mode 100644 index 00000000000..25b1fc2a7c1 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XOUT/Makefile.in @@ -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 diff --git a/mozilla/java/xpcom/test/basic/params/J2XOUT/cpp/J2XOUTServerTestComponent.cpp b/mozilla/java/xpcom/test/basic/params/J2XOUT/cpp/J2XOUTServerTestComponent.cpp new file mode 100644 index 00000000000..3b3eb8e8c3a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XOUT/cpp/J2XOUTServerTestComponent.cpp @@ -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 +#include +#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 + +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) diff --git a/mozilla/java/xpcom/test/basic/params/J2XOUT/java/J2XOUTClientTestComponent.jar.info b/mozilla/java/xpcom/test/basic/params/J2XOUT/java/J2XOUTClientTestComponent.jar.info new file mode 100644 index 00000000000..0698e46c13a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XOUT/java/J2XOUTClientTestComponent.jar.info @@ -0,0 +1,2 @@ +b73109a8-c552-497e-8f42-dc0b4a8fc422 +@mozilla/blackwood/blackconnect/test/params/J2XOUTClient;1 diff --git a/mozilla/java/xpcom/test/basic/params/J2XOUT/java/J2XOUTClientTestComponent.java b/mozilla/java/xpcom/test/basic/params/J2XOUT/java/J2XOUTClientTestComponent.java new file mode 100644 index 00000000000..c82e277d140 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XOUT/java/J2XOUTClientTestComponent.java @@ -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 + +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 diff --git a/mozilla/java/xpcom/test/basic/params/J2XOUT/java/manifest b/mozilla/java/xpcom/test/basic/params/J2XOUT/java/manifest new file mode 100644 index 00000000000..956c50087c1 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XOUT/java/manifest @@ -0,0 +1 @@ +Component-Class: J2XOUTClientTestComponent diff --git a/mozilla/java/xpcom/test/basic/params/J2XOUT/makefile.win b/mozilla/java/xpcom/test/basic/params/J2XOUT/makefile.win new file mode 100644 index 00000000000..851c443ba03 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XOUT/makefile.win @@ -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> diff --git a/mozilla/java/xpcom/test/basic/params/J2XRET/Makefile.in b/mozilla/java/xpcom/test/basic/params/J2XRET/Makefile.in new file mode 100644 index 00000000000..25b1fc2a7c1 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XRET/Makefile.in @@ -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 diff --git a/mozilla/java/xpcom/test/basic/params/J2XRET/cpp/J2XRETServerTestComponent.cpp b/mozilla/java/xpcom/test/basic/params/J2XRET/cpp/J2XRETServerTestComponent.cpp new file mode 100644 index 00000000000..d2f540f8d77 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XRET/cpp/J2XRETServerTestComponent.cpp @@ -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 +#include +#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 + +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\J2XRET*.xpt +export:: + $(JAVAC) $(JAVAI) diff --git a/mozilla/java/xpcom/test/basic/params/J2XRET/java/J2XRETClientTestComponent.jar.info b/mozilla/java/xpcom/test/basic/params/J2XRET/java/J2XRETClientTestComponent.jar.info new file mode 100644 index 00000000000..cb1c0917337 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XRET/java/J2XRETClientTestComponent.jar.info @@ -0,0 +1,2 @@ +04b339f0-a412-11d4-9d3d-00a024a8bb88 +@mozilla/blackwood/blackconnect/test/params/J2XRETClient;1 diff --git a/mozilla/java/xpcom/test/basic/params/J2XRET/java/J2XRETClientTestComponent.java b/mozilla/java/xpcom/test/basic/params/J2XRET/java/J2XRETClientTestComponent.java new file mode 100644 index 00000000000..531db32d0ca --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XRET/java/J2XRETClientTestComponent.java @@ -0,0 +1,391 @@ +/* -*- 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 J2XRETClientTestComponent implements iJ2XRETClientTestComponent, iClientTestComponent, iJClientTestComponent, iExclusionSupport { + private iJ2XRETServerTestComponent server = null; + private String testLocation = null; + private String logLocation = null; + private String[] location1, location2; + private byte endOfData = 112; + private Hashtable exclusionHash = new Hashtable(); + private StringBuffer s; + + public J2XRETClientTestComponent() { + System.out.println("DEbug:avm:J2XRETClientTestComponent 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:J2XRETClientTestComponent:exclude"); + for(int i=0;i + +J2XRETClientTestComponent.jar.comp: manifest J2XRETClientTestComponent.class + $(JDKHOME)\bin\jar cvfm J2XRETClientTestComponent.jar.comp manifest *.class + +J2XRETClientTestComponent.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 J2XRETClientTestComponent.jar.comp J2XRETClientTestComponent.jar.info $(DLL) + copy J2XRETClientTestComponent.jar* $(DIST)\bin\components + +clobber:: + -del /f *.class *.jar.comp + -del /f $(DIST)\bin\components\J2XRETClientTestComponent.jar.* + -del /f $(DIST)\..\classes\org\mozilla\xpcom\iJ2XRETServerTestComponent.* + -del /f $(DIST)\..\classes\org\mozilla\xpcom\iJ2XRETClientTestComponent.* +clobber_all:: clobber +install:: install-component diff --git a/mozilla/java/xpcom/test/basic/params/J2XRET/java/manifest b/mozilla/java/xpcom/test/basic/params/J2XRET/java/manifest new file mode 100644 index 00000000000..c1805c6ef98 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XRET/java/manifest @@ -0,0 +1 @@ +Component-Class: J2XRETClientTestComponent diff --git a/mozilla/java/xpcom/test/basic/params/J2XRET/makefile.win b/mozilla/java/xpcom/test/basic/params/J2XRET/makefile.win new file mode 100644 index 00000000000..851c443ba03 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/J2XRET/makefile.win @@ -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> diff --git a/mozilla/java/xpcom/test/basic/params/Makefile.in b/mozilla/java/xpcom/test/basic/params/Makefile.in new file mode 100644 index 00000000000..942c5bae2a4 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/Makefile.in @@ -0,0 +1,40 @@ +#!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= \ + TestLoader \ + J2XIN \ + J2XOUT \ + J2XINOUT \ + J2XRET \ + X2JIN \ + X2JOUT \ + X2JINOUT \ + X2JRET \ + $(NULL) + +include $(DEPTH)/config/rules.mk diff --git a/mozilla/java/xpcom/test/basic/params/Makefile.win b/mozilla/java/xpcom/test/basic/params/Makefile.win new file mode 100644 index 00000000000..9f014757d45 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/Makefile.win @@ -0,0 +1,38 @@ +#!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= \ + TestLoader \ + J2XIN \ + X2JIN \ + X2JOUT \ + X2JINOUT \ + X2JRET \ + J2XOUT \ + J2XINOUT \ + J2XRET \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/java/xpcom/test/basic/params/README b/mozilla/java/xpcom/test/basic/params/README new file mode 100644 index 00000000000..07aece17dc5 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/README @@ -0,0 +1,27 @@ +Black Connect Tests +================================ + +Requirements: + +* same as for BlackConnect (mozilla/java/xpcom) + +How To Build: + +* Build mozilla and BlackConnect + +* Copy directory basic to mozilla/java/xpcom/test +(Then struct will mozilla/java/xpcom/test/basic/params ...) + +* Do make in mozilla/java/xpcom/test/basic/params + + +How To Run: + +* set environment variable BC_TEST_LOCATION to directory with BCTest.lst + +* set environment variable BC_LOG_LOCATION to some directory(any writable dir) + +* run mozilla and load mozilla/java/xpcom/test/basic/params/TestLoader/start.html + + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/BCITestLoader.idl b/mozilla/java/xpcom/test/basic/params/TestLoader/BCITestLoader.idl new file mode 100644 index 00000000000..feb8d83ff3f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/BCITestLoader.idl @@ -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 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): + */ + +/** + * A sample of XPConnect. This file contains a sample interface. + * + */ + +#include "nsISupports.idl" + +/** + * The uuid is a unique number identifying the interface normally + * called IID. It can be generated as follows: + * + * Windows: guidgen.exe + * Unix: uuidgen which comes with e2fsprogs package + * Mac: ??? + * All platform: Using irc, connect to irc.mozilla.org and type in + * /join #mozilla + * /msg mozbot uuid + * + */ + +[scriptable, uuid(f1bc2000-8ef3-11d4-aa1b-00a024a8bbac)] +interface BCITestLoader : nsISupports +{ + /* + attribute string value; + void writeValue(in string aPrefix); + void poke(in string aValue); + void test(); + */ +}; + + +%{ C++ +/** + * {8fb93ec0-8ef4-11d4-aa1b-00a024a8bbac} + * The CID is also a unique number that look just like the IID + * and identifies uniquely an implementation + */ +#define BCTESTLOADER_CID \ +{ /* 8fb93ec0-8ef4-11d4-aa1b-00a024a8bbac */ \ + 0x8fb93ec0, \ + 0x8ef4, \ + 0x11d4, \ + {0xaa, 0x1b, 0x00, 0xa0, 0x24, 0xa8, 0xbb, 0xac} \ +} + +#define BCTESTLOADER_PROGID "@mozilla/blackwood/blackconnect/test/params/TestLoader;1" +%} + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/BCTest.h b/mozilla/java/xpcom/test/basic/params/TestLoader/BCTest.h new file mode 100644 index 00000000000..4794054164f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/BCTest.h @@ -0,0 +1,27 @@ +/* -*- 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 +*/ + +#define BC_TEST_LIST_FILE_NAME "BCTest.lst" +#define BC_TEST_LOCATION_VAR_NAME "BC_TEST_LOCATION" +#define BC_PROGID_PREFIX "@mozilla/blackwood/blackconnect/test/params/" +#define BC_LOG_LOCATION_VAR_NAME "BC_LOG_LOCATION" diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoader.cpp b/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoader.cpp new file mode 100644 index 00000000000..45c412bd2ca --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoader.cpp @@ -0,0 +1,344 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * 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): + * Pierre Phaneuf + */ + + +/** + * + * A sample of XPConnect. This file contains an implementation nsSample + * of the interface nsISample. + * + */ +#include "plstr.h" +#include +#include +#include "stdio.h" +#include "nsIComponentManager.h" +#include "BCTestLoader.h" +#include "prprf.h" +#include "prmem.h" +#include "nsMemory.h" +#include "BCTest.h" + +////////////////// + + +///////////////// + +//////////////////////////////////////////////////////////////////////// + +BCTestLoaderImpl::BCTestLoaderImpl() +{ + NS_INIT_REFCNT(); + printf("DEbug:avm:BCTestLoaderImpl::BCTestLoaderImpl()\n"); + testLocation = getenv(BC_TEST_LOCATION_VAR_NAME); + if(!testLocation) { + fprintf(stderr, "ERROR: %s enviroment variable isn't set !\n",BC_TEST_LOCATION_VAR_NAME); + return; + } + char** testCase = LoadTestList(); + int i = 0; + if (!testCase) { + fprintf(stderr, "ERROR: Can't load test list !\n"); + return; + } + for(i=0; testCase[i]; i++) { + RunTest(testCase[i]); + } +} + +BCTestLoaderImpl::~BCTestLoaderImpl() +{ + /* + if (mValue) + PL_strfree(mValue); + */ + printf("DEbug:avm:BCTestLoaderImpl::~BCTestLoaderImpl()\n"); +} + +/** + * NS_IMPL_ISUPPORTS1 expands to a simple implementation of the nsISupports + * interface. This includes a proper implementation of AddRef, Release, + * and QueryInterface. If this class supported more interfaces than just + * nsISupports, + * you could use NS_IMPL_ADDREF() and NS_IMPL_RELEASE() to take care of the + * simple stuff, but you would have to create QueryInterface on your own. + * nsSampleFactory.cpp is an example of this approach. + * Notice that the second parameter to the macro is the static IID accessor + * method, and NOT the #defined IID. + */ +NS_IMPL_ISUPPORTS1(BCTestLoaderImpl, BCITestLoader); + +/** + * Notice that in the protoype for this function, the NS_IMETHOD macro was + * used to declare the return type. For the implementation, the return + * type is declared by NS_IMETHODIMP + */ + + + /** + * Another buffer passing convention is that buffers passed INTO your + * object ARE NOT YOURS. Keep your hands off them, unless they are + * declared "inout". If you want to keep the value for posterity, + * you will have to make a copy of it. + */ + +/** + +Custom methods + +**/ + +NS_IMETHODIMP BCTestLoaderImpl::RunTest(char* ID) { + nsresult rv; + iClientTestComponent* client = NULL; + printf("DEbug:avm:Running test %s\n",ID); + rv = InitClient(ID,&client); + if(NS_FAILED(rv)) { + return rv; + } + rv = client->Execute(); + return rv; +} + + +NS_IMETHODIMP BCTestLoaderImpl::InitClient(char* ID, iClientTestComponent** client) { + char * testProgID = NULL; + char * clientProgID = NULL; + char * serverProgID = NULL; + nsresult rv; + testProgID = PL_strdup(BC_PROGID_PREFIX); + clientProgID = PR_sprintf_append(clientProgID,"%s%sClient;1",testProgID, ID); + serverProgID = PR_sprintf_append(serverProgID,"%s%sServer;1",testProgID, ID); + fprintf(stderr,"DEbug:avm:Loading %s\n",clientProgID); + char** exclusionList = LoadExclusionList(ID); + if(ID[0] == 'J') { + fprintf(stderr,"DEbug:avm:Loks that we are running J2X tests\n"); + iJClientTestComponent* client1=(iJClientTestComponent*)client; + rv = nsComponentManager::CreateInstance(clientProgID, + nsnull, + NS_GET_IID(iJClientTestComponent), + (void**)&client1); + if(NS_FAILED(rv)) { + fprintf(stderr, "ERROR: Can't create instance of %s !\n",clientProgID); + return rv; + } + nsIComponentManager* cm; + rv = NS_GetGlobalComponentManager(&cm); + if(NS_FAILED(rv)) { + fprintf(stderr, "ERROR: Can't get GlobalComponentManager!!\n"); + return rv; + } + rv = client1->THack(cm, serverProgID); + client1->QueryInterface(NS_GET_IID(iClientTestComponent),(void**)client); + NS_RELEASE(client1); + }else { + rv = nsComponentManager::CreateInstance(clientProgID, + nsnull, + NS_GET_IID(iClientTestComponent), + (void**)client); + if(NS_FAILED(rv)) { + fprintf(stderr, "ERROR: Can't create instance of %s !\n",clientProgID); + return rv; + } + + rv = (*client)->Initialize(serverProgID); + if(NS_FAILED(rv)) { + fprintf(stderr, "ERROR: Can't initialize client with param %s !\n",serverProgID); + return rv; + } + } + if(exclusionList != NULL) { + iExclusionSupport* exClient; + rv = (*client)->QueryInterface(NS_GET_IID(iExclusionSupport),(void**)&exClient); + if(NS_FAILED(rv)) { + fprintf(stderr, "Looks, that %s tests is still not support exculsion!!!\n",ID); + return NS_OK; + }else { + fprintf(stderr, "Looks, that %s tests support exculsion!!!\n",ID); + } + PRInt32 count; + for(count=0; exclusionList[count]; count++); + exClient->Exclude(count,(const char **) exclusionList); + NS_RELEASE(exClient); + } + return NS_OK; +} + + +/* +*** char** BCTestLoaderImpl::LoadTestList(). +*** Loads list of tests to execute. Derived from OJI TestLoader loadTestList(); +*/ + +char** BCTestLoaderImpl::LoadTestList() { + struct stat st; + FILE *file = NULL; + char *content; + int nRead, nTests, count = 0; + char *pos, *pos1; + char **testList; + char *lstFile = NULL; + lstFile = PR_sprintf_append(lstFile,"%s/%s",testLocation,BC_TEST_LIST_FILE_NAME); + 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 %ld) !\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; + +} + + + +/* +*** char** BCTestLoaderImpl::LoadExclusionList(). +*** Loads list of tests to exclude from execution. +*/ + +char** BCTestLoaderImpl::LoadExclusionList(char* ID) { + struct stat st; + FILE *file = NULL; + char *content; + int nRead, nTests, count = 0; + char *pos, *pos1; + char **excludeList; + char *excludeFile = NULL; + excludeFile = PR_sprintf_append(excludeFile,"%s/%s.exclude",testLocation,ID); + if (stat(excludeFile, &st) < 0) { + fprintf(stderr, "Can't found exclusion file %s for %s tests\n",excludeFile,ID); + return NULL; + } + content = (char*)PR_Calloc(1, st.st_size+1); + if ((file = fopen(excludeFile, "r")) == NULL) { + fprintf(stderr, "ERROR: can't open file %s\n",excludeFile); + 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 %ld) !\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); + excludeList = (char**)PR_Calloc(sizeof(char*), nTests); + excludeList[0] = 0; + pos = content; + while((pos1 = PL_strchr(pos, '\n'))) { + *pos1 = 0; + if(PL_strlen(pos) > 0 && *pos != '#') { + //printf("First char: %c\n", *pos); + excludeList[count++] = PL_strdup(pos); + } + pos = pos1+1; + if (!(*pos)) { + printf("Parser done: %d .. ", count); + excludeList[count] = 0; + printf("ok\n"); + break; + } + } + //If there is no \n after last line + if (PL_strlen(pos) > 0 && *pos != '#') { + excludeList[count++] = PL_strdup(pos); + excludeList[count] = 0; + } + //free(content); + return excludeList; + +} + +int BCTestLoaderImpl::countChars(char* buf, char ch) { + char *pos = buf; + int count = 0; + + while((pos = PL_strchr(pos, ch))) { + pos++; + count++; + } + return count; +} + + + +/* +NS_IMETHODIMP +BCTestLoaderImpl::Start() +{ + printf("Test method called"); + return NS_OK; +} +*/ + + + + + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoader.h b/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoader.h new file mode 100644 index 00000000000..90326b5779e --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoader.h @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * 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): + */ + +/** + * A sample of XPConnect. This file is the header of an implementation + * nsSample of the nsISample interface. + * + */ + +#include "BCITestLoader.h" +#include "iClientTestComponent.h" +#include "iJClientTestComponent.h" +#include "iExclusionSupport.h" +/** + * SampleImpl is an implementation of the nsISample interface. In XPCOM, + * there can be more than one implementation of an given interface. Class + * IDs (CIDs) uniquely identify a particular implementation of an interface. + * Interface IDs (IIDs) uniquely identify an interface. + */ +class BCTestLoaderImpl : public BCITestLoader +{ +public: + BCTestLoaderImpl(); + virtual ~BCTestLoaderImpl(); + + /** + * This macro expands into a declaration of the nsISupports interface. + * Every XPCOM component needs to implement nsISupports, as it acts + * as the gateway to other interfaces this component implements. You + * could manually declare QueryInterface, AddRef, and Release instead + * of using this macro, but why? + */ + // nsISupports interface + NS_DECL_ISUPPORTS + + /** + * This macro is defined in the nsISample.h file, and is generated + * automatically by the xpidl compiler. It expands to + * declarations of all of the methods required to implement the + * interface. xpidl will generate a NS_DECL_[INTERFACENAME] macro + * for each interface that it processes. + * + * The methods of nsISample are discussed individually below, but + * commented out (because this macro already defines them.) + */ + NS_DECL_BCITESTLOADER + + /** + * The following is an explanation of how the interface header + * file expands to for a c++ implementation. NS_DELC_NSISAMPLE + * takes care of defining the right c++ implementation. + * + * The following if provided for more understanding. + * + * NS_IMETHOD expands to the standard XPCOM return type. XPCOM methods + * should never return any other type. The return value is used + * behind the scenes by the XPConnect runtime to figure out if the call + * failed in any way. + * These methods were generated by "attribute string Value" in + * nsISample.idl. When reflected into JavaScript, XPCOM will use these + * calls as Getter/Setter ops, so that they can be called transparently + * as "sample.Value='foo';" and "var val = sample.Value" + */ + /* NS_IMETHOD GetValue(char * *aValue); */ + /* NS_IMETHOD SetValue(char * aValue); */ + + /** + * The const came from the "in" specifier in nsISample.idl. "in" + * specifies that the value of this parameter is used only for input, + * this method is not allowed to modify the contents of the buffer. + */ + /* NS_IMETHOD WriteValue(const char *aPrefix); */ + + /** + * nsISample.idl specifies all of it's string types as string, instead + * of wstring (wide string), the Unicode type. If the world were a + * perfect place, all normal strings in XPCOM interfaces would be unicode. + * If this type had been specified as wstring, it would appear as + * PRUnichar * in C++, which is the NSPR type for unicode characters. + */ + /* NS_IMETHOD Poke(const char* aValue); */ + +private: + char** LoadTestList(); + char** LoadExclusionList(char* ID); + int countChars(char* buf, char ch); + NS_IMETHOD RunTest(char* ID); + NS_IMETHOD InitClient(char* ID, iClientTestComponent** client); + +private: + char* testLocation; + /* + char* mValue; + */ +}; + + + + + + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoaderFactory.cpp b/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoaderFactory.cpp new file mode 100644 index 00000000000..4e9fc3a4a06 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/BCTestLoaderFactory.cpp @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * 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): + * Suresh Duddu + */ +#include "nsIGenericFactory.h" + +#include "BCTestLoader.h" + + +NS_GENERIC_FACTORY_CONSTRUCTOR(BCTestLoaderImpl) + +static nsModuleComponentInfo components[] = +{ + { "BlackConnect TestLoader", BCTESTLOADER_CID, BCTESTLOADER_PROGID, BCTestLoaderImplConstructor, + NULL /* dont need additional registration */, + NULL /* dont need additional unregistration */ + } +}; + + +NS_IMPL_NSGETMODULE("BCTestLoaderFactory", components) + + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/Makefile.in b/mozilla/java/xpcom/test/basic/params/TestLoader/Makefile.in new file mode 100644 index 00000000000..2582575f21d --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/Makefile.in @@ -0,0 +1,83 @@ +#!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 = BCTestLoader +LIBRARY_NAME = $(MODULE) +XPIDL_MODULE = $(MODULE) +IS_COMPONENT = 1 + +EXPORTS = \ + BCTest.h \ + ProceedResults.h \ + Values.h \ + VarContainer.h +CPPSRCS = \ + BCTestLoader.cpp \ + BCTestLoaderFactory.cpp \ + $(NULL) +XPIDLSRCS = \ + BCITestLoader.idl \ + iClientTestComponent.idl \ + iJClientTestComponent.idl\ + iExclusionSupport.idl\ + $(NULL) +JAVAI= iClientTestComponent.java \ + iJClientTestComponent.java \ + iExclusionSupport.java +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + +COMMON_JAVA = VarContainer.java + +include $(topsrcdir)/config/rules.mk + +export:: + $(JDKHOME)/bin/javac -classpath .:$(DEPTH)/dist/classes -d $(DEPTH)/dist/classes $(JAVAI) $(COMMON_JAVA) + + +#A little temporary hack with messenger +install:: + cp -f start.html $(DIST)/bin/chrome/messenger/content/messenger + +clobber-java: + rm -f *.class *.jar +clobber:: clobber-java +clobber_all:: clobber-java + + + + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/ProceedResults.h b/mozilla/java/xpcom/test/basic/params/TestLoader/ProceedResults.h new file mode 100644 index 00000000000..63bf54348c6 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/ProceedResults.h @@ -0,0 +1,134 @@ +/* -*- 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 "prio.h" +//#include "prmem.h" +#include "prprf.h" + +//Output methods + +#define defaultPerm 00660 +#define defaultFlags PR_CREATE_FILE|PR_RDWR + +#define DECL_PROCEED_RESULTS \ +NS_IMETHOD PrintResult(char* fileName, const char* result); \ +NS_IMETHOD PrintResultArray(char* fileName, PRInt32 count, const char** result); \ +NS_IMETHOD PrintResultArray(char* fileName, PRInt32 count, const int* result); \ +NS_IMETHOD PrintResultArray(char* fileName, PRInt32 count, const char* result); \ +NS_IMETHOD PrintResultMixed(char* fileName, PRBool result1, char result2, PRUint8 result3, \ + PRInt16 result4, PRUint16 result5, PRInt32 result6, \ + PRUint32 result7, PRInt64 result8, PRUint64 result9, float result10, \ + double result11, char* result12, PRInt32 count, PRInt32* result13); \ + + +#define IMPL_PROCEED_RESULTS(_MYCLASS_) \ + \ +NS_IMETHODIMP _MYCLASS_::PrintResult(char* fileName,const char* result) { \ + char* fullName = NULL;\ + fullName = PR_sprintf_append(fullName,"%s",logLocation);\ + fullName = PR_sprintf_append(fullName,"/%s",fileName);\ + PRFileDesc* f = PR_Open(fullName,defaultFlags,defaultPerm);\ + if (!f) {\ + fprintf(stderr, "ERROR: File %s is not created", fullName);\ + return NS_OK;\ + }\ + PR_fprintf(f,"%s\n",result);\ + PR_Close(f);\ + PR_smprintf_free(fullName);\ + return NS_OK;\ +}\ +NS_IMETHODIMP _MYCLASS_::PrintResultArray(char* fileName, PRInt32 count, const char** result) { \ + char* fullName = NULL;\ + fullName = PR_sprintf_append(fullName,"%s",logLocation);\ + fullName = PR_sprintf_append(fullName,"/%s",fileName);\ + PRFileDesc* f = PR_Open(fullName,defaultFlags,defaultPerm);\ + if (!f) {\ + fprintf(stderr, "ERROR: File %s is not created", fullName);\ + return NS_OK;\ + }\ + for(int i=0;i +#include + +#define byte_min (PRUint8)0 +#define byte_mid (PRUint8)1 +#define byte_max (PRUint8)127 +#define short_min (PRInt16)SHRT_MIN +#define short_zerro (PRInt16)0 +#define short_mid (PRInt16)1 +#define short_max (PRInt16)SHRT_MAX +#define int_min (PRInt32)INT_MIN +#define int_zerro (PRInt32)0 +#define int_mid (PRInt32)1 +#define int_max (PRInt32)INT_MAX +#define long_min (PRInt64)LL_MinInt() +#define long_zerro (PRInt64)0 +#define long_mid (PRInt64)1 +#define long_max (PRInt64)LL_MaxInt() +#define ushort_min (PRUint16)0 +#define ushort_mid (PRUint16)1 +#define ushort_max (PRUint16)SHRT_MAX +#define uint_min (PRUint32)0 +#define uint_mid (PRUint32)1 +#define uint_max (PRUint32)INT_MAX +#define ulong_min (PRUint64)0 +#define ulong_mid (PRUint64)1 +#define ulong_max (PRUint64)LL_MaxInt() +#define float_min (float)FLT_MIN +#define float_zerro (float)0 +#define float_mid (float)1 +#define float_max (float)FLT_MAX +#define double_min (double)DBL_MIN +#define double_zerro (double)0 +#define double_mid (double)1 +#define double_max (double)DBL_MAX +#define char_first '0' +#define char_last 'Z' +#define wchar_first '0' +#define wchar_last 'Z' +#define string_first "iddqd" +#define string_empty "" +#define string_null "Here must be the NULL string" +#define string_last "112" + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/VarContainer.h b/mozilla/java/xpcom/test/basic/params/TestLoader/VarContainer.h new file mode 100644 index 00000000000..9326c6163bd --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/VarContainer.h @@ -0,0 +1,83 @@ +#include +#include +#include +#include "prtypes.h" +#include "Values.h" + +typedef std::stack PRInt16Stack; +typedef std::stack PRInt32Stack; +typedef std::stack PRInt64Stack; +typedef std::stack PRUint8Stack; +typedef std::stack PRUint16Stack; +typedef std::stack PRUint32Stack; +typedef std::stack PRUint64Stack; +typedef std::stack floatStack; +typedef std::stack doubleStack; +typedef std::stack PRBoolStack; +typedef std::stack charStack; +typedef std::stack wcharStack; +typedef std::stack stringStack; + +#define DECL_VAR_STACKS \ +NS_IMETHOD InitStackVars(); \ +PRInt16Stack PRInt16Vars; \ +PRInt32Stack PRInt32Vars; \ +PRInt64Stack PRInt64Vars; \ +PRUint8Stack PRUint8Vars; \ +PRUint16Stack PRUint16Vars; \ +PRUint32Stack PRUint32Vars; \ +PRUint64Stack PRUint64Vars; \ +floatStack floatVars; \ +doubleStack doubleVars; \ +PRBoolStack PRBoolVars; \ +charStack charVars; \ +wcharStack wcharVars; \ +stringStack stringVars; \ + +#define IMPL_VAR_STACKS(_MYCLASS_) \ + \ +NS_IMETHODIMP _MYCLASS_::InitStackVars() { \ +PRInt16Vars.push(short_min); \ +PRInt16Vars.push(short_mid); \ +PRInt16Vars.push(short_max); \ +PRInt16Vars.push(short_zerro); \ +PRInt32Vars.push(int_min); \ +PRInt32Vars.push(int_mid); \ +PRInt32Vars.push(int_max); \ +PRInt32Vars.push(int_zerro); \ +PRInt64Vars.push(long_min); \ +PRInt64Vars.push(long_mid); \ +PRInt64Vars.push(long_max); \ +PRInt64Vars.push(long_zerro); \ +PRUint8Vars.push(byte_min); \ +PRUint8Vars.push(byte_mid); \ +PRUint8Vars.push(byte_max); \ +PRUint16Vars.push(ushort_min); \ +PRUint16Vars.push(ushort_mid); \ +PRUint16Vars.push(ushort_max); \ +PRUint32Vars.push(uint_min); \ +PRUint32Vars.push(uint_mid); \ +PRUint32Vars.push(uint_max); \ +PRUint64Vars.push(ulong_min); \ +PRUint64Vars.push(ulong_mid); \ +PRUint64Vars.push(ulong_max); \ +floatVars.push(float_min); \ +floatVars.push(float_mid); \ +floatVars.push(float_max); \ +floatVars.push(float_zerro); \ +doubleVars.push(double_min); \ +doubleVars.push(double_mid); \ +doubleVars.push(double_max); \ +doubleVars.push(double_zerro); \ +PRBoolVars.push(PR_TRUE); \ +PRBoolVars.push(PR_FALSE); \ +charVars.push(char_first); \ +charVars.push(char_last); \ +wcharVars.push(wchar_first); \ +wcharVars.push(wchar_last); \ +stringVars.push(string_last); \ +stringVars.push(string_first); \ +stringVars.push(string_empty); \ +stringVars.push(string_null); \ +return NS_OK; \ +} diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/VarContainer.java b/mozilla/java/xpcom/test/basic/params/TestLoader/VarContainer.java new file mode 100644 index 00000000000..9ec7c0380f5 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/VarContainer.java @@ -0,0 +1,253 @@ +/* -*- 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 java.util.Stack; +import java.util.EmptyStackException; + +public class VarContainer { + //Compatibility section + public static byte byteVar = -123; + public static short shortVar = -30001; + public static int intVar = -2147483601; + public static long longVar = -93674872; + public static byte unsignedByteVar = 101; + public static short unsignedShortVar = 601; + public static int unsignedIntVar = 3000000; + public static long unsignedLongVar = 1000001; + public static float floatVar = (float)2.0; + public static double doubleVar = 3.0; + public static boolean booleanVar = true; + public static char charTruncVar = 'A'; + public static char charVar = 'B'; + public static String charPVar = "This is some string"; + public static String unicharPVar = "UUUAAARRR"; + //end of compatibility section + + public static byte endOfData = 112; + + public static byte byteMin = 0; + public static byte byteMid = 1; + public static byte byteMax = 127; + public static short shortMin = Short.MIN_VALUE; + public static short shortZerro = 0; + public static short shortMid = 1; + public static short shortMax = Short.MAX_VALUE; + public static int intMin = Integer.MIN_VALUE; + public static int intZerro = 0; + public static int intMid = 1; + public static int intMax = Integer.MAX_VALUE; + public static long longMin = Long.MIN_VALUE; + public static long longZerro = 0; + public static long longMid = 1; + public static long longMax = Long.MAX_VALUE; + public static short ushortMin = 0; + public static short ushortMid = 1; + public static short ushortMax = Short.MAX_VALUE; + public static int uintMin = 0; + public static int uintMid = 1; + public static int uintMax = Integer.MAX_VALUE; + public static long ulongMin = 0; + public static long ulongMid = 1; + public static long ulongMax = Long.MAX_VALUE; + public static float floatMin = Float.MIN_VALUE; + public static float floatZerro = 0; + public static float floatMid = 1; + public static float floatMax = Float.MAX_VALUE; + public static double doubleMin = Double.MIN_VALUE; + public static double doubleZerro = 0; + public static double doubleMid = 1; + public static double doubleMax = Double.MAX_VALUE; + public static char charFirst = '0'; + public static char charLast = 'Z'; + public static char wcharFirst = '0'; + public static char wcharLast = 'Z'; + public static String stringFirst = "iddqd"; + public static String stringEmpty = ""; + public static String stringNull = "Here must be the NULL string"; + public static String stringLast = "112"; + + //stacks +public Stack byteStack = null; +public Stack shortStack = null; +public Stack intStack = null; +public Stack longStack = null; +public Stack ushortStack = null; +public Stack uintStack = null; +public Stack ulongStack = null; +public Stack floatStack = null; +public Stack doubleStack = null; +public Stack charStack = null; +public Stack wcharStack = null; +public Stack stringStack = null; + //Constructor with stacks initialization +public VarContainer() { + byteStack = new Stack(); + byteStack.push(new Byte(byteMin)); + byteStack.push(new Byte(byteMid)); + byteStack.push(new Byte(byteMax)); + shortStack = new Stack(); + shortStack.push(new Short(shortMin)); + shortStack.push(new Short(shortMid)); + shortStack.push(new Short(shortMax)); + shortStack.push(new Short(shortZerro)); + intStack = new Stack(); + intStack.push(new Integer(intMin)); + intStack.push(new Integer(intMid)); + intStack.push(new Integer(intMax)); + intStack.push(new Integer(intZerro)); + longStack = new Stack(); + longStack.push(new Long(longMin)); + longStack.push(new Long(longMid)); + longStack.push(new Long(longMax)); + longStack.push(new Long(longZerro)); + ushortStack = new Stack(); + ushortStack.push(new Short(ushortMin)); + ushortStack.push(new Short(ushortMid)); + ushortStack.push(new Short(ushortMax)); + uintStack = new Stack(); + uintStack.push(new Integer(uintMin)); + uintStack.push(new Integer(uintMid)); + uintStack.push(new Integer(uintMax)); + ulongStack = new Stack(); + ulongStack.push(new Long(ulongMin)); + ulongStack.push(new Long(ulongMid)); + ulongStack.push(new Long(ulongMax)); + floatStack = new Stack(); + floatStack.push(new Float(floatMin)); + floatStack.push(new Float(floatMid)); + floatStack.push(new Float(floatMax)); + floatStack.push(new Float(floatZerro)); + doubleStack = new Stack(); + doubleStack.push(new Double(doubleMin)); + doubleStack.push(new Double(doubleMid)); + doubleStack.push(new Double(doubleMax)); + doubleStack.push(new Double(doubleZerro)); + charStack = new Stack(); + charStack.push(new Character(charFirst)); + charStack.push(new Character(charLast)); + wcharStack = new Stack(); + wcharStack.push(new Character(wcharFirst)); + wcharStack.push(new Character(wcharLast)); + stringStack = new Stack(); + stringStack.push(stringFirst); + stringStack.push(stringEmpty); + stringStack.push(stringNull); + stringStack.push(stringLast); + +} + +public byte getNextByte() { + try { + return ((Byte)byteStack.pop()).byteValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} +public short getNextShort() { + try { + return ((Short)shortStack.pop()).shortValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} + + +public int getNextInt() { + try { + return ((Integer)intStack.pop()).intValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} +public long getNextLong() { + try { + return ((Long)longStack.pop()).longValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} +public short getNextUshort() { + try { + return ((Short)ushortStack.pop()).shortValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} + +public int getNextUint() { + try { + return ((Integer)uintStack.pop()).intValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} +public long getNextUlong() { + try { + return ((Long)ulongStack.pop()).longValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} + +public float getNextFloat() { + try { + return ((Float)floatStack.pop()).floatValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} +public double getNextDouble() { + try { + return ((Double)doubleStack.pop()).doubleValue(); + }catch(EmptyStackException e) { + return endOfData; + } +} + +public char getNextChar() { + try { + return ((Character)charStack.pop()).charValue(); + }catch(EmptyStackException e) { + return (char)endOfData; + } +} +public char getNextWchar() { + try { + return ((Character)wcharStack.pop()).charValue(); + }catch(EmptyStackException e) { + return (char)endOfData; + } +} + +public String getNextString() { + try { + return (String)stringStack.pop(); + }catch(EmptyStackException e) { + return stringLast; + } +} + +} + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/iClientTestComponent.idl b/mozilla/java/xpcom/test/basic/params/TestLoader/iClientTestComponent.idl new file mode 100644 index 00000000000..6b380b02218 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/iClientTestComponent.idl @@ -0,0 +1,11 @@ +#include "nsISupports.idl" +#include "nsIComponentManager.idl" + +[scriptable, uuid(c254aa00-9084-11d4-aa1b-00a024a8bbac)] +interface iClientTestComponent : nsISupports +{ + void Initialize(in string serverProgID); + void Execute(); +}; + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/iClientTestComponent.java b/mozilla/java/xpcom/test/basic/params/TestLoader/iClientTestComponent.java new file mode 100644 index 00000000000..cff3fa4549b --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/iClientTestComponent.java @@ -0,0 +1,33 @@ +/* + * ************* DO NOT EDIT THIS FILE *********** + * + * This file was automatically generated from iClientTestComponent.idl. + */ + + +package org.mozilla.xpcom; + + +/** + * Interface iClientTestComponent + * + * IID: 0xc254aa00-9084-11d4-aa1b-00a024a8bbac + */ + +public interface iClientTestComponent extends nsISupports +{ + public static final IID IID = + new IID("c254aa00-9084-11d4-aa1b-00a024a8bbac"); + + + /* void Initialize (in string serverProgID); */ + public void initialize(String serverProgID); + + /* void Execute (); */ + public void execute(); + +} + +/* + * end + */ diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/iExclusionSupport.idl b/mozilla/java/xpcom/test/basic/params/TestLoader/iExclusionSupport.idl new file mode 100644 index 00000000000..e16197176ed --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/iExclusionSupport.idl @@ -0,0 +1,10 @@ +#include "nsISupports.idl" + +[scriptable, uuid(f271bdb9-44e8-4f34-a345-490300f1f141)] +interface iExclusionSupport : nsISupports +{ + void exclude(in unsigned long count,[array, size_is(count)] in string exclusionList); + +}; + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/iExclusionSupport.java b/mozilla/java/xpcom/test/basic/params/TestLoader/iExclusionSupport.java new file mode 100644 index 00000000000..d715c5837ad --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/iExclusionSupport.java @@ -0,0 +1,30 @@ +/* + * ************* DO NOT EDIT THIS FILE *********** + * + * This file was automatically generated from iExclusionSupport.idl. + */ + + +package org.mozilla.xpcom; + + +/** + * Interface iExclusionSupport + * + * IID: 0xf271bdb9-44e8-4f34-a345-490300f1f141 + */ + +public interface iExclusionSupport extends nsISupports +{ + public static final IID IID = + new IID("f271bdb9-44e8-4f34-a345-490300f1f141"); + + + /* void exclude (in unsigned long count, [array, size_is (count)] in string exclusionList); */ + public void exclude(int count, String[] exclusionList); + +} + +/* + * end + */ diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/iJClientTestComponent.idl b/mozilla/java/xpcom/test/basic/params/TestLoader/iJClientTestComponent.idl new file mode 100644 index 00000000000..33a86ea6b02 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/iJClientTestComponent.idl @@ -0,0 +1,10 @@ +#include "nsISupports.idl" +#include "nsIComponentManager.idl" + +[scriptable, uuid(9e5fe0c0-985e-11d4-aa22-00a024a8bbac)] +interface iJClientTestComponent : nsISupports +{ + void tHack(in nsIComponentManager cm, in string serverProgID); +}; + + diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/iJClientTestComponent.java b/mozilla/java/xpcom/test/basic/params/TestLoader/iJClientTestComponent.java new file mode 100644 index 00000000000..13180ddc1a2 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/iJClientTestComponent.java @@ -0,0 +1,30 @@ +/* + * ************* DO NOT EDIT THIS FILE *********** + * + * This file was automatically generated from iJClientTestComponent.idl. + */ + + +package org.mozilla.xpcom; + + +/** + * Interface iJClientTestComponent + * + * IID: 0x9e5fe0c0-985e-11d4-aa22-00a024a8bbac + */ + +public interface iJClientTestComponent extends nsISupports +{ + public static final IID IID = + new IID("9e5fe0c0-985e-11d4-aa22-00a024a8bbac"); + + + /* void tHack (in nsIComponentManager cm, in string serverProgID); */ + public void tHack(nsIComponentManager cm, String serverProgID); + +} + +/* + * end + */ diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/makefile.win b/mozilla/java/xpcom/test/basic/params/TestLoader/makefile.win new file mode 100644 index 00000000000..8c56c876807 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/makefile.win @@ -0,0 +1,82 @@ +#!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=..\..\..\..\..\.. +MODULE=BCTestLoader + +MAKE_OBJ_TYPE=DLL +DLLNAME=$(MODULE) +DLL=.\$(OBJDIR)\$(DLLNAME).dll +JAVAI= iClientTestComponent.java \ + iJClientTestComponent.java \ + iExclusionSupport.java + +COMMON_JAVA= VarContainer.java + +XPIDLSRCS= .\BCITestLoader.idl \ + .\iClientTestComponent.idl \ + .\iJClientTestComponent.idl \ + .\iExclusionSupport.idl\ + $(NULL) + +CPP_OBJS=\ + .\$(OBJDIR)\BCTestLoader.obj \ + .\$(OBJDIR)\BCTestLoaderFactory.obj \ + $(NULL) + +LLIBS=\ + $(DIST)\lib\xpcom.lib \ + $(LIBPLC) \ + $(LIBNSPR) \ + $(NULL) + +LINCS=\ + -I$(PUBLIC)\sample \ + -I$(PUBLIC)\raptor \ + -I$(PUBLIC)\xpcom \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> + +javai: + echo $(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes:$(CLASSPATH) -d $(DEPTH)\dist\classes $(JAVAI) $(COMMON_JAVA) + $(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes:$(CLASSPATH) -d $(DEPTH)\dist\classes $(JAVAI) $(COMMON_JAVA) + +#A little temporary hack with messenger +install:: $(DLL) javai + $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components + $(MAKE_INSTALL) start.html $(DIST)\bin\chrome\messenger\content\messenger + $(MAKE_INSTALL) BCTest.h $(DIST)\..\include + $(MAKE_INSTALL) ProceedResults.h $(DIST)\..\include + $(MAKE_INSTALL) PseudoHash.h $(DIST)\..\include + $(MAKE_INSTALL) Values.h $(DIST)\..\include + $(MAKE_INSTALL) VarContainer.h $(DIST)\..\include + +clobber:: + del /f $(DIST)\..\include\BCTest.h + del /f $(DIST)\..\include\ProceedResults.h + del /f $(DIST)\..\include\Values.h + del /f $(DIST)\..\include\VarContainer.h + del /f $(DIST)\..\include\PseudoHash.h + del /f $(DIST)\..\classes\org\mozilla\xpcom\iClientTestComponent.class + del /f $(DIST)\..\classes\org\mozilla\xpcom\iJClientTestComponent.class + del /f $(DIST)\..\classes\org\mozilla\xpcom\iExclusionSupport.class + del /f $(DIST)\..\classes\VarContainer.class diff --git a/mozilla/java/xpcom/test/basic/params/TestLoader/start.html b/mozilla/java/xpcom/test/basic/params/TestLoader/start.html new file mode 100644 index 00000000000..0b8b4dc391c --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/TestLoader/start.html @@ -0,0 +1,11 @@ + + + + + +This file can be used to start BlackConnect tests. + \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JIN/Makefile.in new file mode 100644 index 00000000000..066e959b631 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/Makefile.in @@ -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 \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/Makefile.in new file mode 100644 index 00000000000..b40da8ed077 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/Makefile.in @@ -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): +# Client QA Team, St. Petersburg, Russia +# + +DEPTH=../../../../../../.. +topsrcdir = $(DEPTH) +srcdir = . +VPATH = . + +include $(DEPTH)/config/autoconf.mk + +MODULE = X2JINClientTestComponent +LIBRARY_NAME = $(MODULE) +XPIDL_MODULE = $(MODULE) +IS_COMPONENT = 1 + +CPPSRCS = \ + X2JINClientTestComponent.cpp \ + X2JINClientTestComponentFactory.cpp \ + $(NULL) +XPIDLSRCS = iX2JINClientTestComponent.idl + +JAVAI = iX2JINClientTestComponent.class +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + +$(JAVAI):: + $(JDKHOME)/bin/javac -classpath .:$(DIST)/classes -d $(DIST)/classes $< + +install:: $(JAVAI) diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponent.cpp b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponent.cpp new file mode 100644 index 00000000000..480b6bf7cfa --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponent.cpp @@ -0,0 +1,579 @@ +/* -*- 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 "prmem.h" +#include "stdio.h" +#include "nsIComponentManager.h" +#include "X2JINClientTestComponent.h" +#include "nsMemory.h" +#include "BCTest.h" +#include +#include +#include "nsString.h" +#include "nsStringUtil.h" + + iX2JINServerTestComponent* serverComponent; + char* testLocation=NULL; + char* logLocation=NULL; + char* val=NULL; + char** hash=NULL; + PRUint8 hashCount=0; + PseudoHash* exclusionHash; + + X2JINClientTestComponentImpl::X2JINClientTestComponentImpl() { + NS_INIT_REFCNT(); + testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME); + logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME); + printf("X2JINClientTestComponentImpl::X2JINClientTestComponentImp\n"); + InitStackVars(); + hash=(char**)PR_Malloc(sizeof(char*)*50); + exclusionHash=new PseudoHash(); + } + + X2JINClientTestComponentImpl::~X2JINClientTestComponentImpl() { + + } + + NS_IMPL_ISUPPORTS3(X2JINClientTestComponentImpl, iX2JINClientTestComponent, + iClientTestComponent,iExclusionSupport); + IMPL_PROCEED_RESULTS(X2JINClientTestComponentImpl); + IMPL_VAR_STACKS(X2JINClientTestComponentImpl); + IMPL_PSEUDOHASH(X2JINClientTestComponentImpl); + +/** + * This method creates an instance of server test component and + * transfers test and log locations to that instance. + */ + NS_IMETHODIMP X2JINClientTestComponentImpl::Initialize(const char* serverProgID){ + nsresult rv; + rv = nsComponentManager::CreateInstance(serverProgID, + nsnull, + NS_GET_IID(iX2JINServerTestComponent), + (void**)&serverComponent); + if (NS_FAILED(rv)) { + printf("Create instance failed!!!"); + return rv; + } + + serverComponent->SetTestLocation(testLocation, logLocation); + return NS_OK; + } + + NS_IMETHODIMP X2JINClientTestComponentImpl::Exclude(PRUint32 count, const char **exclusionList) { + printf("Debug:ovk:X2JINClientTestComponentImpl::exclude\n"); + for(int i=0;iput((char*)exclusionList[i]); + hashCount++; + } + return NS_OK; + } + +/** + * This method executes all tests. See more comments below. + */ + NS_IMETHODIMP X2JINClientTestComponentImpl::Execute(){ + + if (!exclusionHash->containsKey("octet")) TestByte(); + if (!exclusionHash->containsKey("short")) TestShort(); + if (!exclusionHash->containsKey("long")) TestLong(); + if (!exclusionHash->containsKey("longlong")) TestLonglong(); + 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("char")) TestChar(); + if (!exclusionHash->containsKey("wchar")) TestWChar(); + 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("mixed")) TestMixed(); + if (!exclusionHash->containsKey("object")) TestObject(); + if (!exclusionHash->containsKey("nsIIDRef")) TestIID(); + if (!exclusionHash->containsKey("nsCIDRef")) TestCID(); + + return NS_OK; + } + +/** + * This method sets C++ side test results for short and transfers + * different short values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestShort() { + + PRInt16 i; + val=NULL; + + while(PRInt16Vars.size()) { + i = PRInt16Vars.top(); + PRInt16Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestShort(i); + } + + PrintResult("x2j.in.client.short",val); + serverComponent->Flush("short"); + } + +/** + * This method sets C++ side test results for int and transfers + * different int values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestLong() { + + PRInt32 i; + val=NULL; + + while(PRInt32Vars.size()) { + i = PRInt32Vars.top(); + PRInt32Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestLong(i); + } + + PrintResult("x2j.in.client.long",val); + serverComponent->Flush("long"); + } + +/** + * This method sets C++ side test results for long and transfers + * different long values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestLonglong() { + + PRInt64 i; + val=NULL; + + while(PRInt64Vars.size()) { + i = PRInt64Vars.top(); + PRInt64Vars.pop(); + val=PR_sprintf_append(val,"%lld\n",i); + serverComponent->TestLonglong(i); + } + + PrintResult("x2j.in.client.longlong",val); + serverComponent->Flush("longlong"); + } + +/** + * This method sets C++ side test results for byte and transfers + * different byte values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestByte() { + + PRUint8 i; + val=NULL; + + while(PRUint8Vars.size()) { + i = PRUint8Vars.top(); + PRUint8Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestByte(i); + } + + PrintResult("x2j.in.client.octet",val); + serverComponent->Flush("octet"); + } + +/** + * This method sets C++ side test results for unsigned short and + * transfers different ushort values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestUShort() { + + PRUint16 i; + val=NULL; + + while(PRUint16Vars.size()) { + i = PRUint16Vars.top(); + PRUint16Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestUShort(i); + } + + PrintResult("x2j.in.client.ushort",val); + serverComponent->Flush("ushort"); + } + +/** + * This method sets C++ side test results for unsigned int and + * transfers different uint values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestULong() { + + PRUint32 i; + val=NULL; + + while(PRUint32Vars.size()) { + i = PRUint32Vars.top(); + PRUint32Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestULong(i); + } + + PrintResult("x2j.in.client.ulong",val); + serverComponent->Flush("ulong"); + } + +/** + * This method sets C++ side test results for unsigned long and + * transfers different ulong values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestULonglong() { + + PRUint64 i; + val=NULL; + + while(PRUint64Vars.size()) { + i = PRUint64Vars.top(); + PRUint64Vars.pop(); + val=PR_sprintf_append(val,"%lld\n",i); + serverComponent->TestULonglong(i); + } + + PrintResult("x2j.in.client.ulonglong",val); + serverComponent->Flush("ulonglong"); + } + +/** + * This method sets C++ side test results for float and transfers + * different float values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestFloat() { + + float i; + val=NULL; + + while(floatVars.size()) { + i = floatVars.top(); + floatVars.pop(); + val=PR_sprintf_append(val,"%.3e\n",i); + serverComponent->TestFloat(i); + } + + PrintResult("x2j.in.client.float",val); + serverComponent->Flush("float"); + } + +/** + * This method sets C++ side test results for double and transfers + * different double values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestDouble() { + + double i; + val=NULL; + + while(doubleVars.size()) { + i = doubleVars.top(); + doubleVars.pop(); + val=PR_sprintf_append(val,"%.3e\n",i); + serverComponent->TestDouble(i); + } + + PrintResult("x2j.in.client.double",val); + serverComponent->Flush("double"); + } + +/** + * This method sets C++ side test results for boolean and transfers + * different boolean values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestBoolean() { + + PRBool i; + val=NULL; + + while(PRBoolVars.size()) { + i = PRBoolVars.top(); + PRBoolVars.pop(); + if (i==PR_TRUE) val=PR_sprintf_append(val,"true\n"); + else if (i==PR_FALSE) val=PR_sprintf_append(val,"false\n"); + else val=PR_sprintf_append(val,"strange result\n"); + serverComponent->TestBoolean(i); + } + + PrintResult("x2j.in.client.boolean",val); + serverComponent->Flush("boolean"); + } + +/** + * This method sets C++ side test results for char and transfers + * different char values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestChar() { + + char i; + val=NULL; + + while(charVars.size()) { + i = charVars.top(); + charVars.pop(); + val=PR_sprintf_append(val,"%c\n",i); + serverComponent->TestChar(i); + } + + PrintResult("x2j.in.client.char",val); + serverComponent->Flush("char"); + } + +/** + * This method sets C++ side test results for PRUnichar and transfers + * different PRUnichar values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestWChar() { + + PRUnichar i; + val=NULL; + + while(wcharVars.size()) { + i = wcharVars.top(); + wcharVars.pop(); + val=PR_sprintf_append(val,"%c\n",i); + serverComponent->TestWChar(i); + } + + PrintResult("x2j.in.client.wchar",val); + serverComponent->Flush("wchar"); + } + +/** + * This method sets C++ side test results for char* and transfers + * different char* values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestString() { + + char* i; + val=NULL; + + while(stringVars.size()) { + i = stringVars.top(); + stringVars.pop(); + val=PR_sprintf_append(val,"%s\n",i); + serverComponent->TestString(i); + } + + PrintResult("x2j.in.client.string",val); + serverComponent->Flush("string"); + } + +/** + * This method sets C++ side test results for PRUnichar* and transfers + * different PRUnichar* values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestWString() { + val=NULL; + + PRUnichar* _wstring; + char* _string="Test wstring"; + + nsCString* cstr=new nsCString(_string); + _wstring=cstr->ToNewUnicode(); + + nsString str = *(new nsString(_wstring)); + + NS_ALLOC_STR_BUF(aBuf,str,14) + val=PR_sprintf_append(val,"%s\n",aBuf); + NS_FREE_STR_BUF(aBuf) + + serverComponent->TestWString(_wstring); + + PrintResult("x2j.in.client.wstring",val); + serverComponent->Flush("wstring"); + } + +/** + * This method sets C++ side test results for char* array and transfers + * char* array to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestStringArray() { + + PRUint32 count=3; + const char** _stringArray=(const char**)PR_Malloc(sizeof(const char*)*count); + _stringArray[0]="ctrl-f"; + _stringArray[1]="iddqd"; + _stringArray[2]="idkfa"; + + PrintResultArray("x2j.in.client.stringArray",count,_stringArray); + serverComponent->TestStringArray(count,_stringArray); + serverComponent->Flush("stringArray"); + + } + +/** + * This method sets C++ side test results for int array and transfers + * int array to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestLongArray() { + + PRUint32 count=3; + PRInt32* _intArray=(PRInt32*)PR_Malloc(sizeof(PRInt32)*count); + _intArray[0]=3; + _intArray[1]=4; + _intArray[2]=5; + + PrintResultArray("x2j.in.client.longArray",count,_intArray); + serverComponent->TestLongArray(count,_intArray); + serverComponent->Flush("longArray"); + } + +/** + * This method sets C++ side test results for char array and transfers + * char array to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestCharArray() { + + PRUint32 count=3; + char* _charArray=(char*)PR_Malloc(sizeof(char)*count); + _charArray[0]='x'; + _charArray[1]='y'; + _charArray[2]='z'; + + PrintResultArray("x2j.in.client.charArray",count,_charArray); + serverComponent->TestCharArray(count,_charArray); + serverComponent->Flush("charArray"); + } + +/** + * This method sets C++ side test results for misc values and transfers + * these values to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestMixed() { + PRBool _bool=true; + char _char='s'; + PRUint8 _byte=3; + PRInt16 _short=3; + PRUint16 _ushort=3; + PRInt32 _int=3; + PRUint32 _uint=3; + PRInt64 _long=3; + PRUint64 _ulong=3; + float _float=7; + double _double=7; + char* _string="abc"; + PRUint32 count=3; + PRInt32* _intArray=(PRInt32*)PR_Malloc(sizeof(PRInt32)*count); + _intArray[0]=8; + _intArray[1]=9; + _intArray[2]=10; + + PrintResultMixed("x2j.in.client.mixed",_bool, _char, _byte, _short, + _ushort, _int, _uint, _long, _ulong, _float, + _double, _string, count, _intArray); + + serverComponent->TestMixed(_bool, _char, _byte, _short, _ushort, + _int, _uint, _long, _ulong, _float, + _double, _string, count, _intArray); + serverComponent->Flush("mixed"); + } + +/** + * This method sets C++ side test results for object and transfers + * serverComponent object to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestObject() { + PrintResult("x2j.in.client.object","!!!Right string!!!"); + serverComponent->TestObject(serverComponent); + serverComponent->Flush("object"); + } + +/** + * This method sets C++ side test results for IID and transfers + * IID object to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestIID() { + + const nsIID& iid=NS_GET_IID(iX2JINServerTestComponent); + val=NULL; + + val=iid.ToString(); + + val=PR_sprintf_append(val,"%s\n",val); + PrintResult("x2j.in.client.iid",val); + serverComponent->TestIID(iid); + serverComponent->Flush("iid"); + } + +/** + * This method sets C++ side test results for CID and transfers + * CID object to java side. + * At the end of this method the flush(...) method is invoked to set + * results on java side. + */ + void X2JINClientTestComponentImpl::TestCID() { + + NS_DEFINE_CID(cid,X2JINCLIENTTESTCOMPONENT_CID); + val=NULL; + + val=cid.ToString(); + + val=PR_sprintf_append(val,"%s\n",val); + PrintResult("x2j.in.client.cid",val); + serverComponent->TestCID(cid); + serverComponent->Flush("cid"); + } diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponent.h b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponent.h new file mode 100644 index 00000000000..e4a440f4449 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponent.h @@ -0,0 +1,68 @@ +/* -*- 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 "iX2JINClientTestComponent.h" +#include "iX2JINServerTestComponent.h" +#include "iClientTestComponent.h" +#include "iExclusionSupport.h" +#include "ProceedResults.h" +#include "VarContainer.h" +#include "PseudoHash.h" + +class X2JINClientTestComponentImpl : public iX2JINClientTestComponent, + public iClientTestComponent, + public iExclusionSupport +{ + public: + X2JINClientTestComponentImpl(); + virtual ~X2JINClientTestComponentImpl(); + void TestByte(void); + void TestShort(void); + void TestLong(void); + void TestLonglong(void); + void TestUShort(void); + void TestULong(void); + void TestULonglong(void); + void TestFloat(void); + void TestDouble(void); + void TestBoolean(void); + void TestChar(void); + void TestWChar(void); + void TestString(void); + void TestWString(void); + void TestStringArray(void); + void TestLongArray(void); + void TestCharArray(void); + void TestMixed(void); + void TestObject(void); + void TestIID(void); + void TestCID(void); + + NS_DECL_ISUPPORTS + NS_DECL_ICLIENTTESTCOMPONENT + NS_DECL_IEXCLUSIONSUPPORT + + DECL_PROCEED_RESULTS + DECL_VAR_STACKS +}; + DECL_PSEUDOHASH diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponentFactory.cpp b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponentFactory.cpp new file mode 100644 index 00000000000..8534d8dd1de --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/X2JINClientTestComponentFactory.cpp @@ -0,0 +1,42 @@ +/* -*- 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 "X2JINClientTestComponent.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(X2JINClientTestComponentImpl) + +static nsModuleComponentInfo components[] = +{ + { "X2JIN Client Test Component", + X2JINCLIENTTESTCOMPONENT_CID, + X2JINCLIENTTESTCOMPONENT_PROGID, + X2JINClientTestComponentImplConstructor, + NULL /* NULL if you dont need one */, + NULL /* NULL if you dont need one */ + } +}; + +NS_IMPL_NSGETMODULE("X2JINClientTestComponentFactory", components) + diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/iX2JINClientTestComponent.idl b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/iX2JINClientTestComponent.idl new file mode 100644 index 00000000000..664bc17ac2c --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/iX2JINClientTestComponent.idl @@ -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" +#include "iClientTestComponent.idl" + +[scriptable, uuid(02748330-9086-11d4-9d38-00a024a8bb88)] +interface iX2JINClientTestComponent : nsISupports +{ + +}; + + +%{ C++ +#define X2JINCLIENTTESTCOMPONENT_CID \ +{ /*16027d70-9086-11d4-9d38-00a024a8bb88*/ \ + 0x16027d70, \ + 0x9086, \ + 0x11d4, \ + {0x9d, 0x38, 0x00, 0xa0, 0x24, 0xa8, 0xbb, 0x88} \ +} + +#define X2JINCLIENTTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/X2JINClient;1" + +%} + + diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/makefile.win new file mode 100644 index 00000000000..1cb3b93af68 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/cpp/makefile.win @@ -0,0 +1,51 @@ +#!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 = X2JINClientTestComponent +DLL=.\$(OBJDIR)\$(DLLNAME).dll +MODULE = X2JINClientTestComponent +COMPONENT = 1 + +XPIDLSRCS = \ + .\iX2JINClientTestComponent.idl \ + $(NULL) + +CPP_OBJS= \ + .\$(OBJDIR)\X2JINClientTestComponent.obj \ + .\$(OBJDIR)\X2JINClientTestComponentFactory.obj \ + $(NULL) + + +LLIBS= $(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib + + +include <$(DEPTH)\config\rules.mak> + +install:: $(DLL) + $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components +clobber:: + del /f $(DIST)\bin\components\$(DLLNAME).dll + del /f $(DIST)\bin\components\X2JIN*.xpt diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/java/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JIN/java/Makefile.in new file mode 100644 index 00000000000..fcf5e72d632 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/java/Makefile.in @@ -0,0 +1,59 @@ +#!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 = . +XPIDLSRCS = iX2JINServerTestComponent.idl +XPIDL_MODULE = X2JINServerTestComponent +JAVA_OR_NSJVM = 1 + +include $(DEPTH)/config/autoconf.mk + + +include $(topsrcdir)/config/rules.mk + + +JAVA_SRC=X2JINServerTestComponent.java + +JAVAI_SRC=iX2JINServerTestComponent.java + +X2JINServerTestComponent.jar.comp: manifest X2JINServerTestComponent.class + $(JDKHOME)/bin/jar cvfm X2JINServerTestComponent.jar.comp manifest *.class + +X2JINServerTestComponent.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: javai X2JINServerTestComponent.jar.comp X2JINServerTestComponent.jar.info + cp -f X2JINServerTestComponent.jar* $(DIST)/bin/components + +clobber:: + rm -f *.class *.jar.comp + rm -f $(DIST)/bin/components/X2JINServerTestComponent.jar.* +clobber_all:: clobber +install:: install-component diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/java/X2JINServerTestComponent.jar.info b/mozilla/java/xpcom/test/basic/params/X2JIN/java/X2JINServerTestComponent.jar.info new file mode 100644 index 00000000000..eb6749fec1f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/java/X2JINServerTestComponent.jar.info @@ -0,0 +1,2 @@ +9f3e8810-9092-11d4-9d38-00a024a8bb88 +@mozilla/blackwood/blackconnect/test/params/X2JINServer;1 diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/java/X2JINServerTestComponent.java b/mozilla/java/xpcom/test/basic/params/X2JIN/java/X2JINServerTestComponent.java new file mode 100644 index 00000000000..73cc748f330 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/java/X2JINServerTestComponent.java @@ -0,0 +1,310 @@ +/* -*- 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.*; +import java.lang.reflect.*; +import java.io.*; + +public class X2JINServerTestComponent implements iX2JINServerTestComponent { + + private static String testLocation=null; + private static String logLocation=null; + private String S=""; + + public X2JINServerTestComponent() { + System.out.println("--[java] X2JINServerTestComponent constructor"); + } + + public Object queryInterface(IID iid) { + System.out.println("--[java]X2JINServerTestComponent::queryInterface iid="+iid); + if (iid.equals(nsISupports.IID) + || iid.equals(iX2JINServerTestComponent.IID)) { + return this; + } else { + return null; + } + } + +/** + * This method sets locations, which are passed from C++ client + * side. + * First parameter - test location, + * Second parameter - log location. + */ + public void setTestLocation(String location, String location2) { + testLocation=location; + logLocation=location2; + } + +/** + * This method writes server side test result to a log file. + * These test results were accumulated in apropriated test + * methods. This method takes tested type as parameter. + */ + public void flush(String name) { + try{ + DataOutputStream f=new DataOutputStream(new FileOutputStream(logLocation+"/x2j.in.server."+name)); + f.writeBytes(S); + } catch(Exception e) { + System.out.println("Exception during writing the file"); + } + S=""; + } + +/****************************************/ +/* TEST METHODS */ +/****************************************/ + +/** + * This method accumulates short values, which are passed from C++ + * client side. + */ + public void testShort(short i) { + S=S+new Short(i).toString()+"\n"; + } + +/** + * This method accumulates int values, which are passed from C++ + * client side. + */ + public void testLong(int i) { + S=S+new Integer(i).toString()+"\n"; + } + +/** + * This method accumulates long values, which are passed from C++ + * client side. + */ + public void testLonglong(long i) { + S=S+new Long(i).toString()+"\n"; + } + +/** + * This method accumulates byte values, which are passed from C++ + * client side. + */ + public void testByte(byte i) { + S=S+new Byte(i).toString()+"\n"; + } + +/** + * This method accumulates short values (unsigned short on C++ + * side), which are passed from C++ client side. + */ + public void testUShort(short i) { + S=S+new Short(i).toString()+"\n"; + } + +/** + * This method accumulates int values (unsigned int on C++ + * side), which are passed from C++ client side. + */ + public void testULong(int i) { + S=S+new Integer(i).toString()+"\n"; + } + +/** + * This method accumulates long values (unsigned long on C++ + * side), which are passed from C++ client side. + */ + public void testULonglong(long i) { + S=S+new Long(i).toString()+"\n"; + } + +/** + * This method accumulates float values, which are passed from C++ + * client side. + */ + public void testFloat(float i) { + S=S+new Float(i).toString()+"\n"; + } + +/** + * This method accumulates double values, which are passed from + * C++ client side. + */ + public void testDouble(double i) { + S=S+new Double(i).toString()+"\n"; + } + +/** + * This method accumulates boolean values, which are passed from + * C++ client side. + */ + public void testBoolean(boolean i) { + S=S+new Boolean(i).toString()+"\n"; + } + +/** + * This method accumulates char values, which are passed from + * C++ client side. + */ + public void testChar(char i) { + S=S+new Character(i).toString()+"\n"; + } + +/** + * This method accumulates char values (wchar on C++ side), + * which are passed from C++ client side. + */ + public void testWChar(char i) { + S=S+new Character(i).toString()+"\n"; + } + +/** + * This method accumulates String values, which are passed from + * C++ client side. + */ + public void testString(String i) { + S=S+i+"\n"; + } + +/** + * This method accumulates String values (wstring on C++ side), + * which are passed from C++ client side. + */ + public void testWString(String i) { + S=S+i+"\n"; + } + +/** + * This method accumulates String array values, which are passed + * from C++ client side. + * First parameter - number of an array elements. + */ + public void testStringArray(int count, String[] stringArray) { + for(int j=0;j + +X2JINServerTestComponent.jar.comp: manifest iX2JINServerTestComponent.class X2JINServerTestComponent.class + $(JDKHOME)\bin\jar cvfm X2JINServerTestComponent.jar.comp manifest *.class + +.SUFFIXES: .java .class + +.java.class: + $(JDKHOME)\bin\javac -classpath $(CLASSPATH) -d $(DEPTH)\dist\classes iX2JINServerTestComponent.java + $(JDKHOME)\bin\javac -classpath $(CLASSPATH) X2JINServerTestComponent.java + +install-component: X2JINServerTestComponent.jar.comp X2JINServerTestComponent.jar.info $(DLL) + copy X2JINServerTestComponent.jar* $(DIST)\bin\components + +clobber:: + -del /f *.class *.jar.comp + -del /f $(DIST)\bin\components\X2JINServerTestComponent.jar.* + -del /f $(DIST)\..\classes\org\mozilla\xpcom\iX2JINServerTestComponent.* +clobber_all:: clobber +install:: install-component diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/java/manifest b/mozilla/java/xpcom/test/basic/params/X2JIN/java/manifest new file mode 100644 index 00000000000..d28fc504175 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/java/manifest @@ -0,0 +1 @@ +Component-Class: X2JINServerTestComponent diff --git a/mozilla/java/xpcom/test/basic/params/X2JIN/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JIN/makefile.win new file mode 100644 index 00000000000..5f369c57d0f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JIN/makefile.win @@ -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> \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JINOUT/Makefile.in new file mode 100644 index 00000000000..066e959b631 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/Makefile.in @@ -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 \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/Makefile.in new file mode 100644 index 00000000000..624bb1c5391 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/Makefile.in @@ -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): +# Client QA Team, St. Petersburg, Russia +# + +DEPTH=../../../../../../.. +topsrcdir = $(DEPTH) +srcdir = . +VPATH = . + +include $(DEPTH)/config/autoconf.mk + +MODULE = X2JINOUTClientTestComponent +LIBRARY_NAME = $(MODULE) +XPIDL_MODULE = $(MODULE) +IS_COMPONENT = 1 + +CPPSRCS = \ + X2JINOUTClientTestComponent.cpp \ + X2JINOUTClientTestComponentFactory.cpp \ + $(NULL) +XPIDLSRCS = iX2JINOUTClientTestComponent.idl + +JAVAI = iX2JINOUTClientTestComponent.class +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + +$(JAVAI):: + $(JDKHOME)/bin/javac -classpath .:$(DIST)/classes -d $(DIST)/classes $< + +install:: $(JAVAI) diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponent.cpp b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponent.cpp new file mode 100644 index 00000000000..3aef604b07f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponent.cpp @@ -0,0 +1,668 @@ +/* -*- 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 "prmem.h" +#include "stdio.h" +#include "nsIComponentManager.h" +#include "X2JINOUTClientTestComponent.h" +#include "nsMemory.h" +#include "BCTest.h" +#include +#include +#include "nsString.h" +#include "nsStringUtil.h" + + iX2JINOUTServerTestComponent *serverComponent, *obj; + char* testLocation=NULL; + char* logLocation=NULL; + char* val=NULL; + char* xval=NULL; + char** hash=NULL; + PRUint8 hashCount=0; + PseudoHash* exclusionHash; + +X2JINOUTClientTestComponentImpl::X2JINOUTClientTestComponentImpl() { + NS_INIT_REFCNT(); + testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME); + logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME); + printf("DEbug:avm:X2JINOUTClientTestComponentImpl::X2JINOUTClientTestComponentImp\n"); + InitStackVars(); + hash=(char**)PR_Malloc(sizeof(char*)*50); + exclusionHash=new PseudoHash(); +} + +X2JINOUTClientTestComponentImpl::~X2JINOUTClientTestComponentImpl() { +} + + NS_IMPL_ISUPPORTS3(X2JINOUTClientTestComponentImpl, + iX2JINOUTClientTestComponent, + iClientTestComponent, iExclusionSupport); + IMPL_PROCEED_RESULTS(X2JINOUTClientTestComponentImpl); + IMPL_VAR_STACKS(X2JINOUTClientTestComponentImpl); + IMPL_PSEUDOHASH(X2JINOUTClientTestComponentImpl); + +/** + * This method creates an instance of server test component and + * transfers test and log locations to that instance. + */ +NS_IMETHODIMP X2JINOUTClientTestComponentImpl::Initialize(const char* serverProgID){ + + nsresult rv; + rv = nsComponentManager::CreateInstance(serverProgID, + nsnull, + NS_GET_IID(iX2JINOUTServerTestComponent), + (void**)&serverComponent); + if (NS_FAILED(rv)) { + printf("Create instance failed!!!"); + return rv; + } + + serverComponent->SetTestLocation(testLocation, logLocation); + return NS_OK; +} + + NS_IMETHODIMP X2JINOUTClientTestComponentImpl::Exclude(PRUint32 count, const char **exclusionList) { + printf("Debug:ovk:X2JINOUTClientTestComponentImpl::exclude\n"); + for(int i=0;iput((char*)exclusionList[i]); + hashCount++; + } + return NS_OK; + } + +/** + * This method executes all tests. See more comments below. + */ +NS_IMETHODIMP X2JINOUTClientTestComponentImpl::Execute(){ + + if (!exclusionHash->containsKey("octet")) TestByte(); + if (!exclusionHash->containsKey("short")) TestShort(); + if (!exclusionHash->containsKey("long")) TestLong(); + if (!exclusionHash->containsKey("longlong")) TestLonglong(); + 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("char")) TestChar(); + if (!exclusionHash->containsKey("wchar")) TestWChar(); + 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("mixed")) TestMixed(); + if (!exclusionHash->containsKey("object")) TestObject(); +// if (!exclusionHash->containsKey("iid")) TestIID(); +// if (!exclusionHash->containsKey("cid")) TestCID(); + + return NS_OK; +} +/** + * This method sets C++ side short values and transfers them + * to java side. + * After that this method gets setted short values from java side and + * sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestShort(){ + + PRInt16 i; + val=NULL; + xval=NULL; + + while(PRInt16Vars.size()) { + i = PRInt16Vars.top(); + PRInt16Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestShort(&i); + xval=PR_sprintf_append(xval,"%d\n",i); + } + + PrintResult("x2j.inout.client.short",val); + PrintResult("x2j.inout.xclient.short",xval); + serverComponent->Flush("short"); +} + +/** + * This method sets C++ side byte values and transfers them + * to java side. + * After that this method gets setted byte values from java side + * and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestByte(){ + + PRUint8 i; + val=NULL; + xval=NULL; + + while(PRUint8Vars.size()) { + i = PRUint8Vars.top(); + PRUint8Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestByte(&i); + xval=PR_sprintf_append(xval,"%d\n",i); + } + + PrintResult("x2j.inout.client.octet",val); + PrintResult("x2j.inout.xclient.octet",xval); + serverComponent->Flush("octet"); +} + +/** + * This method sets C++ side int values and transfers them + * to java side. + * After that this method gets setted int values from java side + * and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestLong(){ + + PRInt32 i; + val=NULL; + xval=NULL; + + while(PRInt32Vars.size()) { + i = PRInt32Vars.top(); + PRInt32Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestLong(&i); + xval=PR_sprintf_append(xval,"%d\n",i); + } + + PrintResult("x2j.inout.client.long",val); + PrintResult("x2j.inout.xclient.long",xval); + serverComponent->Flush("long"); +} + +/** + * This method sets C++ side long values and transfers them + * to java side. + * After that this method gets setted long values from java side + * and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestLonglong(){ + + PRInt64 i; + val=NULL; + xval=NULL; + + while(PRInt64Vars.size()) { + i = PRInt64Vars.top(); + PRInt64Vars.pop(); + val=PR_sprintf_append(val,"%lld\n",i); + serverComponent->TestLonglong(&i); + xval=PR_sprintf_append(xval,"%lld\n",i); + } + + PrintResult("x2j.inout.client.longlong",val); + PrintResult("x2j.inout.xclient.longlong",xval); + serverComponent->Flush("longlong"); +} + +/** + * This method sets C++ side unsigned short values and transfers + * them to java side. + * After that this method gets setted unsigned short values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestUShort(){ + + PRUint16 i; + val=NULL; + xval=NULL; + + while(PRUint16Vars.size()) { + i = PRUint16Vars.top(); + PRUint16Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestUShort(&i); + xval=PR_sprintf_append(xval,"%d\n",i); + } + + PrintResult("x2j.inout.client.ushort",val); + PrintResult("x2j.inout.xclient.ushort",xval); + serverComponent->Flush("ushort"); +} + +/** + * This method sets C++ side unsigned int values and transfers + * them to java side. + * After that this method gets setted unsigned int values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestULong(){ + + PRUint32 i; + val=NULL; + xval=NULL; + + while(PRUint32Vars.size()) { + i = PRUint32Vars.top(); + PRUint32Vars.pop(); + val=PR_sprintf_append(val,"%d\n",i); + serverComponent->TestULong(&i); + xval=PR_sprintf_append(xval,"%d\n",i); + } + + PrintResult("x2j.inout.client.ulong",val); + PrintResult("x2j.inout.xclient.ulong",xval); + serverComponent->Flush("ulong"); +} + +/** + * This method sets C++ side unsigned long values and transfers + * them to java side. + * After that this method gets setted unsigned long values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestULonglong(){ + + PRUint64 i; + val=NULL; + xval=NULL; + + while(PRUint64Vars.size()) { + i = PRUint64Vars.top(); + PRUint64Vars.pop(); + val=PR_sprintf_append(val,"%lld\n",i); + serverComponent->TestULonglong(&i); + xval=PR_sprintf_append(xval,"%lld\n",i); + } + + PrintResult("x2j.inout.client.ulonglong",val); + PrintResult("x2j.inout.xclient.ulonglong",xval); + serverComponent->Flush("ulonglong"); +} + +/** + * This method sets C++ side float values and transfers + * them to java side. + * After that this method gets setted float values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestFloat(){ + + float i; + val=NULL; + xval=NULL; + + while(floatVars.size()) { + i = floatVars.top(); + floatVars.pop(); + val=PR_sprintf_append(val,"%.3e\n",i); + serverComponent->TestFloat(&i); + xval=PR_sprintf_append(xval,"%.3e\n",i); + } + + PrintResult("x2j.inout.client.float",val); + PrintResult("x2j.inout.xclient.float",xval); + serverComponent->Flush("float"); +} + +/** + * This method sets C++ side double values and transfers + * them to java side. + * After that this method gets setted double values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestDouble(){ + + double i; + val=NULL; + xval=NULL; + + while(doubleVars.size()) { + i = doubleVars.top(); + doubleVars.pop(); + val=PR_sprintf_append(val,"%.3e\n",i); + serverComponent->TestDouble(&i); + xval=PR_sprintf_append(xval,"%.3e\n",i); + } + + PrintResult("x2j.inout.client.double",val); + PrintResult("x2j.inout.xclient.double",xval); + serverComponent->Flush("double"); +} + +/** + * This method sets C++ side boolean values and transfers + * them to java side. + * After that this method gets setted boolean values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestBoolean(){ + + PRBool i; + val=NULL; + xval=NULL; + + while(PRBoolVars.size()) { + i = PRBoolVars.top(); + PRBoolVars.pop(); + if (i==PR_TRUE) val=PR_sprintf_append(val,"true\n"); + else if (i==PR_FALSE) val=PR_sprintf_append(val,"false\n"); + else val=PR_sprintf_append(val,"strange result\n"); + serverComponent->TestBoolean(&i); + if (i==PR_TRUE) xval=PR_sprintf_append(xval,"true\n"); + else if (i==PR_FALSE) xval=PR_sprintf_append(xval,"false\n"); + else xval=PR_sprintf_append(xval,"strange result\n"); + } + + PrintResult("x2j.inout.client.boolean",val); + PrintResult("x2j.inout.xclient.boolean",xval); + serverComponent->Flush("boolean"); +} + +/** + * This method sets C++ side char values and transfers + * them to java side. + * After that this method gets setted char values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestChar(){ + + char i; + val=NULL; + xval=NULL; + + while(charVars.size()) { + i = charVars.top(); + charVars.pop(); + val=PR_sprintf_append(val,"%c\n",i); + serverComponent->TestChar(&i); + xval=PR_sprintf_append(xval,"%c\n",i); + } + + PrintResult("x2j.inout.client.char",val); + PrintResult("x2j.inout.xclient.char",xval); + serverComponent->Flush("char"); +} + +/** + * This method sets C++ side PRUnichar values and transfers + * them to java side. + * After that this method gets setted PRUnichar values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestWChar(){ + + PRUnichar i; + val=NULL; + xval=NULL; + + while(wcharVars.size()) { + i = wcharVars.top(); + wcharVars.pop(); + val=PR_sprintf_append(val,"%c\n",i); + serverComponent->TestWChar(&i); + xval=PR_sprintf_append(xval,"%c\n",i); + } + + PrintResult("x2j.inout.client.wchar",val); + PrintResult("x2j.inout.xclient.wchar",xval); + serverComponent->Flush("wchar"); +} + +/** + * This method sets C++ side char* values and transfers + * them to java side. + * After that this method gets setted char* values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestString(){ + + char* i; + val=NULL; + xval=NULL; + + while(stringVars.size()) { + i = stringVars.top(); + stringVars.pop(); + val=PR_sprintf_append(val,"%s\n",i); + serverComponent->TestString(&i); + xval=PR_sprintf_append(xval,"%s\n",i); + } + + PrintResult("x2j.inout.client.string",val); + PrintResult("x2j.inout.xclient.string",xval); + serverComponent->Flush("string"); +} + +/** + * This method sets C++ side PRUnichar* values and transfers + * them to java side. + * After that this method gets setted PRUnichar* values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestWString(){ + + PRUnichar* _wstring; + val=NULL; xval=NULL; + + char* _string=""; + nsCString* cstr=new nsCString(_string); + _wstring=cstr->ToNewUnicode(); + nsString str = *(new nsString(_wstring)); + { + NS_ALLOC_STR_BUF(aBuf1,str,100) + val=PR_sprintf_append(val,"%s\n",aBuf1); + NS_FREE_STR_BUF(aBuf1) + } + serverComponent->TestWString(&_wstring); + str = *(new nsString(_wstring)); + { + NS_ALLOC_STR_BUF(aBuf2,str,100) + xval=PR_sprintf_append(xval,"%s\n",aBuf2); + NS_FREE_STR_BUF(aBuf2) + } + + _string="Test string."; + cstr=new nsCString(_string); + _wstring=cstr->ToNewUnicode(); + str = *(new nsString(_wstring)); + { + NS_ALLOC_STR_BUF(aBuf3,str,100) + val=PR_sprintf_append(val,"%s\n",aBuf3); + NS_FREE_STR_BUF(aBuf3) + } + serverComponent->TestWString(&_wstring); + str = *(new nsString(_wstring)); + { + NS_ALLOC_STR_BUF(aBuf4,str,100) + xval=PR_sprintf_append(xval,"%s\n",aBuf4); + NS_FREE_STR_BUF(aBuf4) + } + + PrintResult("x2j.inout.client.wstring",val); + PrintResult("x2j.inout.xclient.wstring",xval); +} + +/** + * This method sets C++ side char* array and transfers + * it to java side. + * After that this method gets setted char* array from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestStringArray(){ + + int count=3; + char** _stringArray=(char**)PR_Malloc(sizeof(char*)*count); + _stringArray[0]="aaa"; + _stringArray[1]="bbb"; + _stringArray[2]="ccc"; + + PrintResultArray("x2j.inout.client.stringArray",count,(const char**)_stringArray); + serverComponent->TestStringArray(count,&_stringArray); + PrintResultArray("x2j.inout.xclient.stringArray",count,(const char**)_stringArray); +} + +/** + * This method sets C++ side int array and transfers + * it to java side. + * After that this method gets setted int array from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestLongArray(){ + + int count=3; + PRInt32* _intArray=(PRInt32*)PR_Malloc(sizeof(PRInt32)*count); + _intArray[0]=3; + _intArray[1]=4; + _intArray[2]=5; + + PrintResultArray("x2j.inout.client.longArray",count, _intArray); + serverComponent->TestLongArray(count,&_intArray); + PrintResultArray("x2j.inout.xclient.longArray",count, _intArray); +} + +/** + * This method sets C++ side char array and transfers + * it to java side. + * After that this method gets setted char array from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestCharArray(){ + + int count=3; + char* _charArray=(char*)PR_Malloc(sizeof(char)*count); + _charArray[0]=120; + _charArray[1]=121; + _charArray[2]=122; + + PrintResultArray("x2j.inout.client.charArray",count,_charArray); + serverComponent->TestCharArray(count,&_charArray); + PrintResultArray("x2j.inout.xclient.charArray",count,_charArray); +} + +/** + * This method sets C++ side misc values and transfers + * them to java side. + * After that this method gets setted misc values from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +void X2JINOUTClientTestComponentImpl::TestMixed(){ + + val=NULL; xval=NULL; + PRBool _bool=true; + char _char='s'; + PRUint8 _byte=3; + PRInt16 _short=3; PRUint16 _ushort=3; + PRInt32 _int=3; PRUint32 _uint=3; + PRInt64 _long=3; PRUint64 _ulong=3; + float _float=7; + double _double=7; + char* _string="abc"; + int count=3; + PRInt32* _intArray=(PRInt32*)PR_Malloc(sizeof(PRInt32)*count); + _intArray[0]=33; + _intArray[1]=44; + _intArray[2]=55; + + + PrintResultMixed("x2j.inout.client.mixed",_bool, _char, _byte, _short, + _ushort, _int, _uint, _long, _ulong, _float, + _double, _string, count, _intArray); + serverComponent->TestMixed(&_bool, &_char, &_byte, &_short, &_ushort, + &_int, &_uint, &_long, &_ulong, &_float, + &_double, &_string, count, &_intArray); + PrintResultMixed("x2j.inout.xclient.mixed",_bool, _char, _byte, _short, + _ushort, _int, _uint, _long, _ulong, _float, + _double, _string, count, _intArray); + +} + +/** + * This method sets C++ side iX2JINOUTServerTestComponent value + * and transfers it to java side. + * After that this method gets setted iX2JINOUTServerTestComponent + * value from java side. + * TestObj2() is invoked on java side, using that value. + */ +void X2JINOUTClientTestComponentImpl::TestObject(){ + + PrintResult("x2j.inout.client.object","!!!Right string!!!"); + serverComponent->TestObject(&serverComponent); + serverComponent->TestObject2(&obj); + obj->TestObj2(); +} + + +/** + * This method sets C++ side test results for IID and transfers + * IID object to java side. + * After that this method gets setted char array from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +// void X2JINOUTClientTestComponentImpl::TestIID() { +/* + const nsIID& iid=NS_GET_IID(iX2JINOUTServerTestComponent); + val=NULL; + + val=PR_sprintf_append(val,"%s\n",iid.ToString()); + PrintResult("x2j.inout.client.iid",val); + serverComponent->TestIID(&iid); + xval=PR_sprintf_append(xval,"%s\n",iid.ToString()); + PrintResult("x2j.inout.xclient.iid",xval); +*/ +// } + +/** + * This method sets C++ side test results for CID and transfers + * CID object to java side. + * After that this method gets setted char array from + * java side and sets test results for C++ side. + * Both values must be equal. + */ +/* void X2JINOUTClientTestComponentImpl::TestCID() { + + NS_DEFINE_CID(cid,X2JINOUTCLIENTTESTCOMPONENT_CID); + val=NULL; + + val=PR_sprintf_append(val,"%s\n",cid.ToString()); + PrintResult("x2j.inout.client.cid",val); + serverComponent->TestCID(&cid); + xval=PR_sprintf_append(val,"%s\n",cid.ToString()); + PrintResult("x2j.inout.xclient.cid",xval); + + }*/ diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponent.h b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponent.h new file mode 100644 index 00000000000..6c730cc955d --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponent.h @@ -0,0 +1,69 @@ +/* -*- 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 "iX2JINOUTClientTestComponent.h" +#include "iX2JINOUTServerTestComponent.h" +#include "iClientTestComponent.h" +#include "iExclusionSupport.h" +#include "ProceedResults.h" +#include "VarContainer.h" +#include "PseudoHash.h" + +class X2JINOUTClientTestComponentImpl : public iX2JINOUTClientTestComponent, + public iClientTestComponent, + public iExclusionSupport +{ + public: + X2JINOUTClientTestComponentImpl(); + virtual ~X2JINOUTClientTestComponentImpl(); + void TestByte(void); + void TestShort(void); + void TestLong(void); + void TestLonglong(void); + void TestUShort(void); + void TestULong(void); + void TestULonglong(void); + void TestFloat(void); + void TestDouble(void); + void TestBoolean(void); + void TestChar(void); + void TestWChar(void); + void TestString(void); + void TestWString(void); + void TestStringArray(void); + void TestLongArray(void); + void TestCharArray(void); + void TestMixed(void); + void TestObject(void); +// void TestIID(void); +// void TestCID(void); + + NS_DECL_ISUPPORTS + NS_DECL_ICLIENTTESTCOMPONENT + NS_DECL_IEXCLUSIONSUPPORT + + DECL_PROCEED_RESULTS + DECL_VAR_STACKS +}; + DECL_PSEUDOHASH + \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponentFactory.cpp b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponentFactory.cpp new file mode 100644 index 00000000000..5da90ddaeb6 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/X2JINOUTClientTestComponentFactory.cpp @@ -0,0 +1,42 @@ +/* -*- 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 "X2JINOUTClientTestComponent.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(X2JINOUTClientTestComponentImpl) + +static nsModuleComponentInfo components[] = +{ + {"X2JINOUT Client Test Component", + X2JINOUTCLIENTTESTCOMPONENT_CID, + X2JINOUTCLIENTTESTCOMPONENT_PROGID, + X2JINOUTClientTestComponentImplConstructor, + NULL /* NULL if you dont need one */, + NULL /* NULL if you dont need one */ + } +}; + +NS_IMPL_NSGETMODULE("X2JINOUTClientTestComponentFactory", components) + diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/iX2JINOUTClientTestComponent.idl b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/iX2JINOUTClientTestComponent.idl new file mode 100644 index 00000000000..f6c954363b9 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/iX2JINOUTClientTestComponent.idl @@ -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 "iClientTestComponent.idl" + +[scriptable, uuid(0c529c00-9ac3-11d4-9d3b-00a024a8bb88)] +interface iX2JINOUTClientTestComponent : nsISupports +{ + +}; + + +%{ C++ +#define X2JINOUTCLIENTTESTCOMPONENT_CID \ +{ /*1a5379e0-9ac3-11d4-9d3b-00a024a8bb88*/ \ + 0x1a5379e0, \ + 0x9ac3, \ + 0x11d4, \ + {0x9d, 0x3b, 0x00, 0xa0, 0x24, 0xa8, 0xbb, 0x88} \ +} + +#define X2JINOUTCLIENTTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/X2JINOUTClient;1" + +%} diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/makefile.win new file mode 100644 index 00000000000..ff42138835d --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/cpp/makefile.win @@ -0,0 +1,49 @@ +#!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 = X2JINOUTClientTestComponent +DLL=.\$(OBJDIR)\$(DLLNAME).dll +MODULE = X2JINOUTClientTestComponent +COMPONENT = 1 + +XPIDLSRCS = \ + .\iX2JINOUTClientTestComponent.idl \ + $(NULL) + +CPP_OBJS= \ + .\$(OBJDIR)\X2JINOUTClientTestComponent.obj \ + .\$(OBJDIR)\X2JINOUTClientTestComponentFactory.obj \ + $(NULL) + +LLIBS= $(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib + +include <$(DEPTH)\config\rules.mak> + +install:: $(DLL) + $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components +clobber:: + del /f $(DIST)\bin\components\$(DLLNAME).dll + del /f $(DIST)\bin\components\X2JINOUT*.xpt diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/Makefile.in new file mode 100644 index 00000000000..53dc1d8a258 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/Makefile.in @@ -0,0 +1,59 @@ +#!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 = . +XPIDLSRCS = iX2JINOUTServerTestComponent.idl +XPIDL_MODULE = X2JINOUTServerTestComponent +JAVA_OR_NSJVM = 1 + +include $(DEPTH)/config/autoconf.mk + + +include $(topsrcdir)/config/rules.mk + + +JAVA_SRC=X2JINOUTServerTestComponent.java + +JAVAI_SRC=iX2JINOUTServerTestComponent.java + +X2JINOUTServerTestComponent.jar.comp: manifest X2JINOUTServerTestComponent.class + $(JDKHOME)/bin/jar cvfm X2JINOUTServerTestComponent.jar.comp manifest *.class + +X2JINOUTServerTestComponent.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: javai X2JINOUTServerTestComponent.jar.comp X2JINOUTServerTestComponent.jar.info + cp -f X2JINOUTServerTestComponent.jar* $(DIST)/bin/components + +clobber:: + rm -f *.class *.jar.comp + rm -f $(DIST)/bin/components/X2JINOUTServerTestComponent.jar.* +clobber_all:: clobber +install:: install-component diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/X2JINOUTServerTestComponent.jar.info b/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/X2JINOUTServerTestComponent.jar.info new file mode 100644 index 00000000000..efc4766d6bf --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/X2JINOUTServerTestComponent.jar.info @@ -0,0 +1,2 @@ +457f2290-9abc-11d4-9d3b-00a024a8bb88 +@mozilla/blackwood/blackconnect/test/params/X2JINOUTServer;1 diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/X2JINOUTServerTestComponent.java b/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/X2JINOUTServerTestComponent.java new file mode 100644 index 00000000000..265a1c1fedc --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/X2JINOUTServerTestComponent.java @@ -0,0 +1,331 @@ +/* -*- 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.*; +import java.lang.reflect.*; +import java.io.*; + +public class X2JINOUTServerTestComponent implements iX2JINOUTServerTestComponent { + + private static String testLocation=null; + private static String logLocation=null; + private int all=0; + private String S=""; + + public X2JINOUTServerTestComponent() { + System.out.println("--[java] X2JINOUTServerTestComponent constructor"); + } + + public Object queryInterface(IID iid) { + System.out.println("--[java]X2JINOUTServerTestComponent::queryInterface iid="+iid); + if ( iid.equals(nsISupports.IID) + || iid.equals(iX2JINOUTServerTestComponent.IID)) { + return this; + } else { + return null; + } + } + +/** + * This method sets locations, which are passed from C++ client + * side. + * First parameter - test location, + * Second parameter - log location. + */ + public void setTestLocation(String location, String location2) { + testLocation=location; + logLocation=location2; + } + +/** + * This method writes server side test result to a log file. + * These test results were accumulated in apropriated test + * methods. This method takes tested type as parameter. + */ + public void flush(String name) { + try{ + DataOutputStream f=new DataOutputStream(new FileOutputStream(logLocation+"/x2j.inout.server."+name)); + f.writeBytes(S); + }catch(Exception e) { + System.out.println("Exception during writing the file"); + } + S=""; + all=0; + } + +/****************************************/ +/* TEST METHODS */ +/****************************************/ + +/** + * This method accumulates short values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testShort(short[] i) { + S=S+new Short(i[0]).toString()+"\n"; + } + +/** + * This method accumulates int values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testLong(int[] i) { + S=S+new Integer(i[0]).toString()+"\n"; + } + +/** + * This method accumulates long values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testLonglong(long[] i) { + S=S+new Long(i[0]).toString()+"\n"; + } + +/** + * This method accumulates byte values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testByte(byte[] i) { + S=S+new Byte(i[0]).toString()+"\n"; + } + +/** + * This method accumulates short values, which are passed from C++ + * client side and transfers them back to C++ side as unsigned short. + */ + public void testUShort(short[] i) { + S=S+new Short(i[0]).toString()+"\n"; + } + +/** + * This method accumulates int values, which are passed from C++ + * client side and transfers them back to C++ side as unsigned int. + */ + public void testULong(int[] i) { + S=S+new Integer(i[0]).toString()+"\n"; + } + +/** + * This method accumulates long values, which are passed from C++ + * client side and transfers them back to C++ side as unsigned long. + */ + public void testULonglong(long[] i) { + S=S+new Long(i[0]).toString()+"\n"; + } + +/** + * This method accumulates float values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testFloat(float[] i) { + S=S+new Float(i[0]).toString()+"\n"; + } + +/** + * This method accumulates double values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testDouble(double[] i) { + S=S+new Double(i[0]).toString()+"\n"; + } + +/** + * This method accumulates boolean values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testBoolean(boolean[] i) { + S=S+new Boolean(i[0]).toString()+"\n"; + } + +/** + * This method accumulates char values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testChar(char[] i) { + S=S+new Character(i[0]).toString()+"\n"; + } + +/** + * This method accumulates char values, which are passed from C++ + * client side and transfers them back to C++ side as PRUnichar. + */ + public void testWChar(char[] i) { + S=S+i[0]+"\n"; + } + +/** + * This method accumulates string values, which are passed from C++ + * client side and transfers them back to C++ side. + */ + public void testString(String[] i) { + S=S+i[0]+"\n"; + } + +/** + * This method accumulates string values, which are passed from C++ + * client side and transfers them back to C++ side as PRUnichar*. + */ + public void testWString(String[] i) { + S=S+i[0]+"\n"; + all++; + if (all==2) { + flush("wstring"); + } + } + +/** + * This method accumulates string array values, which are passed + * from C++ client side and transfers them back to C++ side. + */ + public void testStringArray(int count, String[][] stringArray) { + for(int i=0;i + +X2JINOUTServerTestComponent.jar.comp: manifest iX2JINOUTServerTestComponent.class X2JINOUTServerTestComponent.class + $(JDKHOME)\bin\jar cvfm X2JINOUTServerTestComponent.jar.comp manifest *.class + +.SUFFIXES: .java .class + +.java.class: + $(JDKHOME)\bin\javac -classpath $(CLASSPATH) -d $(DEPTH)\dist\classes iX2JINOUTServerTestComponent.java + $(JDKHOME)\bin\javac -classpath $(CLASSPATH) X2JINOUTServerTestComponent.java + +install-component: X2JINOUTServerTestComponent.jar.comp X2JINOUTServerTestComponent.jar.info $(DLL) + copy X2JINOUTServerTestComponent.jar* $(DIST)\bin\components + +clobber:: + -del /f *.class *.jar.comp + -del /f $(DIST)\bin\components\X2JINOUTServerTestComponent.jar.* + -del /f $(DIST)\..\classes\org\mozilla\xpcom\iX2JINOUTServerTestComponent.* +clobber_all:: clobber +install:: install-component diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/manifest b/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/manifest new file mode 100644 index 00000000000..7a1f7b1686a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/java/manifest @@ -0,0 +1 @@ +Component-Class: X2JINOUTServerTestComponent diff --git a/mozilla/java/xpcom/test/basic/params/X2JINOUT/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JINOUT/makefile.win new file mode 100644 index 00000000000..851c443ba03 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JINOUT/makefile.win @@ -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> diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JOUT/Makefile.in new file mode 100644 index 00000000000..066e959b631 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/Makefile.in @@ -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 \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/Makefile.in new file mode 100644 index 00000000000..d0ee2d4ac74 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/Makefile.in @@ -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): +# Client QA Team, St. Petersburg, Russia +# + +DEPTH=../../../../../../.. +topsrcdir = $(DEPTH) +srcdir = . +VPATH = . + +include $(DEPTH)/config/autoconf.mk + +MODULE = X2JOUTClientTestComponent +LIBRARY_NAME = $(MODULE) +XPIDL_MODULE = $(MODULE) +IS_COMPONENT = 1 + +CPPSRCS = \ + X2JOUTClientTestComponent.cpp \ + X2JOUTClientTestComponentFactory.cpp \ + $(NULL) +XPIDLSRCS = iX2JOUTClientTestComponent.idl + +JAVAI = iX2JOUTClientTestComponent.class +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + +$(JAVAI):: + $(JDKHOME)/bin/javac -classpath .:$(DIST)/classes -d $(DIST)/classes $< + +install:: $(JAVAI) diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponent.cpp b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponent.cpp new file mode 100644 index 00000000000..b09018f2aea --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponent.cpp @@ -0,0 +1,483 @@ +/* -*- 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 "prmem.h" +#include "prenv.h" +#include "stdio.h" +#include "nsIComponentManager.h" +#include "X2JOUTClientTestComponent.h" +#include "nsMemory.h" +#include "BCTest.h" +#include +#include +#include "nsString.h" +#include "nsStringUtil.h" + + iX2JOUTServerTestComponent *serverComponent; + char* testLocation=NULL; + char* logLocation=NULL; + char* val=NULL; + char** hash=NULL; + PRUint8 hashCount=0; + PseudoHash* exclusionHash; + +X2JOUTClientTestComponentImpl::X2JOUTClientTestComponentImpl() { + NS_INIT_REFCNT(); + testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME); + logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME); + printf("DEbug:avm:X2JOUTClientTestComponentImpl::X2JOUTClientTestComponentImp\n"); + hash=(char**)PR_Malloc(sizeof(char*)*50); + exclusionHash=new PseudoHash(); +} + +X2JOUTClientTestComponentImpl::~X2JOUTClientTestComponentImpl() { +} + + NS_IMPL_ISUPPORTS3(X2JOUTClientTestComponentImpl, iX2JOUTClientTestComponent, + iClientTestComponent, iExclusionSupport); + IMPL_PROCEED_RESULTS(X2JOUTClientTestComponentImpl); + IMPL_PSEUDOHASH(X2JOUTClientTestComponentImpl); + +/** + * This method creates an instance of server test component and + * transfers test and log locations to that instance. + */ +NS_IMETHODIMP X2JOUTClientTestComponentImpl::Initialize(const char* serverProgID) { + + nsresult rv; + rv = nsComponentManager::CreateInstance(serverProgID, + nsnull, + NS_GET_IID(iX2JOUTServerTestComponent), + (void**)&serverComponent); + if (NS_FAILED(rv)) { + printf("Create instance failed!!!"); + return rv; + } + + serverComponent->SetTestLocation(testLocation, logLocation); + return NS_OK; +} + + NS_IMETHODIMP X2JOUTClientTestComponentImpl::Exclude(PRUint32 count, const char **exclusionList) { + printf("Debug:ovk:X2JOUTClientTestComponentImpl::exclude\n"); + for(int i=0;iput((char*)exclusionList[i]); + hashCount++; + } + return NS_OK; + } + +/** + * This method executes all tests. See more comments below. + */ +NS_IMETHODIMP X2JOUTClientTestComponentImpl::Execute(){ + + if (!exclusionHash->containsKey("octet")) TestByte(); + if (!exclusionHash->containsKey("short")) TestShort(); + if (!exclusionHash->containsKey("long")) TestLong(); + if (!exclusionHash->containsKey("longlong")) TestLonglong(); + 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("char")) TestChar(); + if (!exclusionHash->containsKey("wchar")) TestWChar(); + 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("mixed")) TestMixed(); + if (!exclusionHash->containsKey("object")) TestObject(); +// if (!exclusionHash->containsKey("iid")) TestIID(); +// if (!exclusionHash->containsKey("cid")) TestCID(); + + return NS_OK; +} + +/** + * This block gets different short values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestShort(){ + + val=NULL; + PRInt16 _short=0; + + for(int i=0;i<3;i++) { + serverComponent->TestShort(&_short); + val=PR_sprintf_append(val,"%d\n",_short); + } + + PrintResult("x2j.out.client.short",val); +} + +/** + * This block gets different byte values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestByte(){ + + val=NULL; + PRUint8 _byte=0; + + for(int i=0;i<3;i++) { + serverComponent->TestByte(&_byte); + val=PR_sprintf_append(val,"%d\n",_byte); + } + + PrintResult("x2j.out.client.octet",val); +} + +/** + * This block gets different int values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestLong(){ + + val=NULL; + PRInt32 _int=0; + + for(int i=0;i<3;i++) { + serverComponent->TestLong(&_int); + val=PR_sprintf_append(val,"%d\n",_int); + } + + PrintResult("x2j.out.client.long",val); +} + +/** + * This block gets different long values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestLonglong(){ + + val=NULL; + PRInt64 _long=0; + + for(int i=0;i<3;i++) { + serverComponent->TestLonglong(&_long); + val=PR_sprintf_append(val,"%lld\n",_long); + } + + PrintResult("x2j.out.client.longlong",val); +} + +/** + * This block gets different unsigned short values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestUShort(){ + + val=NULL; + PRUint16 _ushort=0; + + for(int i=0;i<3;i++) { + serverComponent->TestUShort(&_ushort); + val=PR_sprintf_append(val,"%d\n",_ushort); + } + + PrintResult("x2j.out.client.ushort",val); +} + +/** + * This block gets different unsigned int values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestULong(){ + + val=NULL; + PRUint32 _uint=0; + + for(int i=0;i<3;i++) { + serverComponent->TestULong(&_uint); + val=PR_sprintf_append(val,"%d\n",_uint); + } + + PrintResult("x2j.out.client.ulong",val); +} + +/** + * This block gets different unsigned long values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestULonglong(){ + + val=NULL; + PRUint64 _ulong=0; + + for(int i=0;i<3;i++) { + serverComponent->TestULonglong(&_ulong); + val=PR_sprintf_append(val,"%lld\n",_ulong); + } + + PrintResult("x2j.out.client.ulonglong",val); +} + +/** + * This block gets different float values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestFloat(){ + + val=NULL; + float _float=0; + + for(int i=0;i<3;i++) { + serverComponent->TestFloat(&_float); + val=PR_sprintf_append(val,"%.3e\n",_float); + } + + PrintResult("x2j.out.client.float",val); +} + +/** + * This block gets different double values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestDouble(){ + + val=NULL; + double _double=0; + + for(int i=0;i<3;i++) { + serverComponent->TestDouble(&_double); + val=PR_sprintf_append(val,"%.3e\n",_double); + } + + PrintResult("x2j.out.client.double",val); +} + +/** + * This block gets different boolean values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestBoolean(){ + + val=NULL; + PRBool _bool=false; + + for(int i=0;i<2;i++) { + serverComponent->TestBoolean(&_bool); + if (_bool==PR_TRUE) val=PR_sprintf_append(val,"%s\n","true"); + else if (_bool==PR_FALSE) val=PR_sprintf_append(val,"%s\n","false"); + else val=PR_sprintf_append(val,"%s\n","strange result"); + } + + PrintResult("x2j.out.client.boolean",val); +} + +/** + * This block gets different char values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestChar(){ + + val=NULL; + char _char='f'; + + for(int i=0;i<2;i++) { + serverComponent->TestChar(&_char); + val=PR_sprintf_append(val,"%c\n",_char); + } + + PrintResult("x2j.out.client.char",val); +} + +/** + * This block gets different PRUnichar values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestWChar(){ + + val=NULL; + PRUnichar _wchar=0; + + for(int i=0;i<2;i++) { + serverComponent->TestWChar(&_wchar); + val=PR_sprintf_append(val,"%c\n",_wchar); + } + + PrintResult("x2j.out.client.wchar",val); +} + +/** + * This block gets different char* values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestString(){ + + val=NULL; + char* _string="0"; + + for(int i=0;i<3;i++) { + serverComponent->TestString(&_string); + val=PR_sprintf_append(val,"%s\n",_string); + } + + PrintResult("x2j.out.client.string",val); +} + +/** + * This block gets different PRUnichar* values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestWString(){ + + val=NULL; + PRUnichar* _wstring=NULL; + + { + serverComponent->TestWString(&_wstring); + nsString str = *(new nsString(_wstring)); + NS_ALLOC_STR_BUF(aBuf1,str,100) + val=PR_sprintf_append(val,"%s\n",aBuf1); + NS_FREE_STR_BUF(aBuf1) + } + { + serverComponent->TestWString(&_wstring); + nsString str = *(new nsString(_wstring)); + NS_ALLOC_STR_BUF(aBuf2,str,100) + val=PR_sprintf_append(val,"%s\n",aBuf2); + NS_FREE_STR_BUF(aBuf2) + } + { + serverComponent->TestWString(&_wstring); + nsString str = *(new nsString(_wstring)); + NS_ALLOC_STR_BUF(aBuf3,str,100) + val=PR_sprintf_append(val,"%s\n",aBuf3); + NS_FREE_STR_BUF(aBuf3) + } + + PrintResult("x2j.out.client.wstring",val); +} + +/** + * This block gets char* array from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestStringArray(){ + + PRUint32 count=3; + char** _stringArray=(char**)PR_Malloc(sizeof(char*)*count); + const char** sA=(const char**)PR_Malloc(sizeof(const char*)*count); + serverComponent->TestStringArray(count,&_stringArray); + sA=(const char**) _stringArray; + PrintResultArray("x2j.out.client.stringArray",count,sA); +} + +/** + * This block gets PRInt32 array from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestLongArray(){ + + PRUint32 count=3; + PRInt32* _intArray=(PRInt32*)PR_Malloc(sizeof(PRInt32)*count); + serverComponent->TestLongArray(count,&_intArray); + PrintResultArray("x2j.out.client.longArray",count,_intArray); +} + +/** + * This block gets char array from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestCharArray(){ + + PRUint32 count=3; + char* _charArray=(char*)PR_Malloc(sizeof(char)*count); + serverComponent->TestCharArray(count,&_charArray); + PrintResultArray("x2j.out.client.charArray",count,_charArray); +} + +/** + * This block gets misc values from java side and + * sets test results for C++ side. + */ +void X2JOUTClientTestComponentImpl::TestMixed(){ + + PRBool _bool=false; + char _char='0'; + PRUint8 _byte=0; + PRInt16 _short=0; PRUint16 _ushort=0; + PRInt32 _int=0; PRUint32 _uint=0; + PRInt64 _long=0; PRUint64 _ulong=0; + float _float=0; + double _double=0; + char* _string="000"; + int count=3; + PRInt32* _intArray=(PRInt32*)PR_Malloc(sizeof(PRInt32)*count); + + serverComponent->TestMixed(&_bool, &_char, &_byte, &_short, &_ushort, + &_int, &_uint, &_long, &_ulong, &_float, + &_double, &_string, count, &_intArray); + + PrintResultMixed("x2j.out.client.mixed",_bool, _char, _byte, _short, + _ushort, _int, _uint, _long, _ulong, _float, + _double, _string, count, _intArray); +} + +/** + * This block gets iX2JOUTServerTestComponent object from java side and + * try to invoke TestObj() method from java side, using this + * object. + */ +void X2JOUTClientTestComponentImpl::TestObject(){ + + iX2JOUTServerTestComponent* obj=NULL; + + serverComponent->TestObject(&obj); + obj->TestObj(); + + PrintResult("x2j.out.client.object","!!!Right string!!!"); +} + + +// void X2JOUTClientTestComponentImpl::TestIID() { + +/* const nsIID& iid=NS_GET_IID(iX2JOUTServerTestComponent); + val=NULL; + + val=iid.ToString(); + + val=PR_sprintf_append(val,"%s\n",val); + PrintResult("x2j.out.client.iid",val); + serverComponent->TestIID(&iid); +*/ +// } + +// void X2JOUTClientTestComponentImpl::TestCID() { +/* + NS_DEFINE_CID(cid,X2JOUTCLIENTTESTCOMPONENT_CID); + val=NULL; + + val=cid.ToString(); + + val=PR_sprintf_append(val,"%s\n",val); + PrintResult("x2j.out.client.cid",val); + serverComponent->TestCID(&cid); +*/ +// } diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponent.h b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponent.h new file mode 100644 index 00000000000..4efaf5310e6 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponent.h @@ -0,0 +1,67 @@ +/* -*- 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 "iX2JOUTClientTestComponent.h" +#include "iX2JOUTServerTestComponent.h" +#include "iClientTestComponent.h" +#include "iExclusionSupport.h" +#include "ProceedResults.h" +#include "PseudoHash.h" + +class X2JOUTClientTestComponentImpl : public iX2JOUTClientTestComponent, + public iClientTestComponent, + public iExclusionSupport +{ +public: + X2JOUTClientTestComponentImpl(); + virtual ~X2JOUTClientTestComponentImpl(); + void TestByte(void); + void TestShort(void); + void TestLong(void); + void TestLonglong(void); + void TestUShort(void); + void TestULong(void); + void TestULonglong(void); + void TestFloat(void); + void TestDouble(void); + void TestBoolean(void); + void TestChar(void); + void TestWChar(void); + void TestString(void); + void TestWString(void); + void TestStringArray(void); + void TestLongArray(void); + void TestCharArray(void); + void TestMixed(void); + void TestObject(void); +// void TestIID(void); +// void TestCID(void); + + NS_DECL_ISUPPORTS + NS_DECL_ICLIENTTESTCOMPONENT + NS_DECL_IEXCLUSIONSUPPORT + + DECL_PROCEED_RESULTS +}; + + DECL_PSEUDOHASH diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponentFactory.cpp b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponentFactory.cpp new file mode 100644 index 00000000000..b9744d51fb4 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/X2JOUTClientTestComponentFactory.cpp @@ -0,0 +1,42 @@ +/* -*- 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 "X2JOUTClientTestComponent.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(X2JOUTClientTestComponentImpl) + +static nsModuleComponentInfo components[] = +{ + { + "X2JOUT Client Test Component", + X2JOUTCLIENTTESTCOMPONENT_CID, + X2JOUTCLIENTTESTCOMPONENT_PROGID, + X2JOUTClientTestComponentImplConstructor, + NULL /* NULL if you dont need one */, + NULL /* NULL if you dont need one */ + } +}; + +NS_IMPL_NSGETMODULE("X2JOUTClientTestComponentFactory", components) diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/iX2JOUTClientTestComponent.idl b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/iX2JOUTClientTestComponent.idl new file mode 100644 index 00000000000..8c0252a5e73 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/iX2JOUTClientTestComponent.idl @@ -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" +#include "iClientTestComponent.idl" + +[scriptable, uuid(6e765da0-9605-11d4-9d3a-00a024a8bb88)] +interface iX2JOUTClientTestComponent : nsISupports +{ + +}; + + +%{ C++ +#define X2JOUTCLIENTTESTCOMPONENT_CID \ +{ /*847cf780-9605-11d4-9d3a-00a024a8bb88*/ \ + 0x847cf780, \ + 0x9605, \ + 0x11d4, \ + {0x9d, 0x3a, 0x00, 0xa0, 0x24, 0xa8, 0xbb, 0x88} \ +} + +#define X2JOUTCLIENTTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/X2JOUTClient;1" + +%} + + diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/makefile.win new file mode 100644 index 00000000000..d2bbd1059ba --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/cpp/makefile.win @@ -0,0 +1,51 @@ +#!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 = X2JOUTClientTestComponent +DLL=.\$(OBJDIR)\$(DLLNAME).dll +MODULE = X2JOUTClientTestComponent +COMPONENT = 1 + +XPIDLSRCS = \ + .\iX2JOUTClientTestComponent.idl \ + $(NULL) + +CPP_OBJS= \ + .\$(OBJDIR)\X2JOUTClientTestComponent.obj \ + .\$(OBJDIR)\X2JOUTClientTestComponentFactory.obj \ + $(NULL) + + +LLIBS= $(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib + + +include <$(DEPTH)\config\rules.mak> + +install:: $(DLL) + $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components +clobber:: + del /f $(DIST)\bin\components\$(DLLNAME).dll + del /f $(DIST)\bin\components\X2JOUT*.xpt diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/java/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JOUT/java/Makefile.in new file mode 100644 index 00000000000..6787f18df5c --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/java/Makefile.in @@ -0,0 +1,56 @@ +#!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 = . +XPIDLSRCS = iX2JOUTServerTestComponent.idl +XPIDL_MODULE = X2JOUTServerTestComponent +JAVA_OR_NSJVM = 1 + +include $(DEPTH)/config/autoconf.mk + + +include $(topsrcdir)/config/rules.mk + + +JDIRS=. + +X2JOUTServerTestComponent.jar.comp: manifest iX2JOUTServerTestComponent.class X2JOUTServerTestComponent.class + $(JDKHOME)/bin/jar cvfm X2JOUTServerTestComponent.jar.comp manifest *.class + +.SUFFIXES: .java .class + +.java.class: + $(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes -d $(DEPTH)/dist/classes iX2JOUTServerTestComponent.java + $(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes X2JOUTServerTestComponent.java + +install-component: X2JOUTServerTestComponent.jar.comp X2JOUTServerTestComponent.jar.info + cp -f X2JOUTServerTestComponent.jar* $(DIST)/bin/components +clobber:: + rm -f *.class *.jar.comp + rm -f $(DIST)/bin/components/X2JOUTServerTestComponent.jar.* +clobber_all:: clobber +install:: install-component + diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/java/X2JOUTServerTestComponent.jar.info b/mozilla/java/xpcom/test/basic/params/X2JOUT/java/X2JOUTServerTestComponent.jar.info new file mode 100644 index 00000000000..2f829298caf --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/java/X2JOUTServerTestComponent.jar.info @@ -0,0 +1,2 @@ +3f949800-9603-11d4-9d3a-00a024a8bb88 +@mozilla/blackwood/blackconnect/test/params/X2JOUTServer;1 diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/java/X2JOUTServerTestComponent.java b/mozilla/java/xpcom/test/basic/params/X2JOUT/java/X2JOUTServerTestComponent.java new file mode 100644 index 00000000000..251ec8b0dc8 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/java/X2JOUTServerTestComponent.java @@ -0,0 +1,450 @@ +/* -*- 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.*; +import java.lang.reflect.*; +import java.io.*; + +public class X2JOUTServerTestComponent implements iX2JOUTServerTestComponent { + + private static String testLocation=""; + private static String logLocation=""; + private String S=""; + private int all=0; + private short _s=0; + private short _us=0; + private int _i=0; + private int _ui=0; + private long _l=0; + private long _ul=0; + private float _f=0; + private double _d=0; + + public X2JOUTServerTestComponent() { + System.out.println("--[java] X2JOUTServerTestComponent constructor"); + } + + public Object queryInterface(IID iid) { + System.out.println("--[java]X2JOUTServerTestComponent::queryInterface iid="+iid); + if ( iid.equals(nsISupports.IID) + || iid.equals(iX2JOUTServerTestComponent.IID)) { + return this; + } else { + return null; + } + } + +/** + * This method sets locations, which are passed from C++ client + * side. + * First parameter - test location, + * Second parameter - log location. + */ + public void setTestLocation(String location, String location2) { + testLocation=location; + logLocation=location2; + } + +/** + * This method writes server side test result to a log file. + * These test results were accumulated in apropriated test + * methods. This method takes tested type as parameter. + */ + public void flush(String name) { + try{ + DataOutputStream f=new DataOutputStream(new FileOutputStream(logLocation+"/x2j.out.server."+name)); + f.writeBytes(S); + } catch(Exception e) { + System.out.println("Exception during writing the file"); + } + S=""; + all=0; + } + +/****************************************/ +/* TEST METHODS */ +/****************************************/ + +/** + * This method sets short values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testShort(short[] i) { + switch (all) { + case 0: i[0]=new Short(_s).MIN_VALUE; break; + case 1: i[0]=1000; break; + case 2: i[0]=new Short(_s).MAX_VALUE; break; + } + all++; + S=S+new Short(i[0]).toString()+"\n"; + if (all==3) { + flush("short"); + } + } + +/** + * This method sets int values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testLong(int[] i) { + switch (all) { + case 0: i[0]=new Integer(_i).MIN_VALUE; break; + case 1: i[0]=1000; break; + case 2: i[0]=new Integer(_i).MAX_VALUE; break; + } + all++; + S=S+new Integer(i[0]).toString()+"\n"; + if (all==3) { + flush("long"); + } + } + +/** + * This method sets long values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testLonglong(long[] i) { + switch (all) { + case 0: i[0]=new Long(_l).MIN_VALUE; break; + case 1: i[0]=1000; break; + case 2: i[0]=new Long(_l).MAX_VALUE; break; + } + all++; + S=S+new Long(i[0]).toString()+"\n"; + if (all==3) { + flush("longlong"); + } + } + +/** + * This method sets byte values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testByte(byte[] i) { + switch (all) { + case 0: i[0]=0; break; + case 1: i[0]=10; break; + case 2: i[0]=127; break; + } + all++; + S=S+new Byte(i[0]).toString()+"\n"; + if (all==3) { + flush("octet"); + } + } + +/** + * This method sets short values, which will pass to C++ + * client side as unsigned short and sets test result, + * using flush(...) method. + */ + public void testUShort(short[] i) { + switch (all) { + case 0: i[0]=0; break; + case 1: i[0]=1000; break; + case 2: i[0]=new Short(_s).MAX_VALUE; break; + } + all++; + S=S+new Short(i[0]).toString()+"\n"; + if (all==3) { + flush("ushort"); + } + } + +/** + * This method sets int values, which will pass to C++ + * client side as unsigned int and sets test result, + * using flush(...) method. + */ + public void testULong(int[] i) { + switch (all) { + case 0: i[0]=0; break; + case 1: i[0]=1000; break; + case 2: i[0]=new Integer(_i).MAX_VALUE; break; + } + all++; + S=S+new Integer(i[0]).toString()+"\n"; + if (all==3) { + flush("ulong"); + } + } + +/** + * This method sets long values, which will pass to C++ + * client side as unsigned long and sets test result, + * using flush(...) method. + */ + public void testULonglong(long[] i) { + switch (all) { + case 0: i[0]=0; break; + case 1: i[0]=1000; break; + case 2: i[0]=new Long(_l).MAX_VALUE; break; + } + all++; + S=S+new Long(i[0]).toString()+"\n"; + if (all==3) { + flush("ulonglong"); + } + } + +/** + * This method sets float values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testFloat(float[] i) { + switch (all) { + case 0: i[0]=new Float(_f).MIN_VALUE; break; + case 1: i[0]=1; break; + case 2: i[0]=new Float(_f).MAX_VALUE; break; + } + all++; + S=S+new Float(i[0]).toString()+"\n"; + if (all==3) { + flush("float"); + } + } + +/** + * This method sets double values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testDouble(double[] i) { + switch (all) { + case 0: i[0]=new Double(_d).MIN_VALUE; break; + case 1: i[0]=1; break; + case 2: i[0]=new Double(_d).MAX_VALUE; break; + } + all++; + S=S+new Double(i[0]).toString()+"\n"; + if (all==3) { + flush("double"); + } + } + +/** + * This method sets boolean values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testBoolean(boolean[] i) { + switch (all) { + case 0: i[0]=true; break; + case 1: i[0]=false; break; + } + all++; + S=S+new Boolean(i[0]).toString()+"\n"; + if (all==2) { + flush("boolean"); + } + } + +/** + * This method sets char values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testChar(char[] i) { + switch (all) { + case 0: i[0]='0'; break; + case 1: i[0]='Z'; break; + } + all++; + S=S+new Character(i[0]).toString()+"\n"; + if (all==2) { + flush("char"); + } + } + +/** + * This method sets char values, which will pass to C++ + * client side as PRUnichar and sets test result, + * using flush(...) method. + */ + public void testWChar(char[] i) { + switch (all) { + case 0: i[0]='A'; break; + case 1: i[0]='Z'; break; + } + all++; + S=S+new Character(i[0]).toString()+"\n"; + if (all==2) { + flush("wchar"); + } + } + +/** + * This method sets string values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testString(String[] i) { + switch (all) { + case 0: i[0]=""; break; + case 1: i[0]=null; break; + case 2: i[0]="abc"; break; + } + all++; + S=S+i[0]+"\n"; + if (all==3) { + flush("string"); + } + } + +/** + * This method sets string values, which will pass to C++ + * client side as PRUnichar* and sets test result, + * using flush(...) method. + */ + public void testWString(String[] i) { + switch (all) { + case 0: i[0]=""; break; + case 1: i[0]="Null must be here"; break; + case 2: i[0]="abc"; break; + } + all++; + S=S+i[0]+"\n"; + if (all==3) { + flush("wstring"); + } + } + +/** + * This method sets string array, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testStringArray(int count, String[][] valueArray) { + String[] returnArray={"qqq","aaa","zzz"}; + S=returnArray[0]+"\n"+returnArray[1]+"\n"+returnArray[2]+"\n"; + valueArray[0]=returnArray; + flush("stringArray"); + } + +/** + * This method sets int array, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testLongArray(int count, int[][] intArray) { + int[] returnArray={1,2,3}; + S=returnArray[0]+"\n"+returnArray[1]+"\n"+returnArray[2]+"\n"; + intArray[0]=returnArray; + flush("longArray"); + } + +/** + * This method sets char array, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testCharArray(int count, char[][] charArray) { + char[] returnArray={'a','b','c'}; + S=returnArray[0]+"\n"+returnArray[1]+"\n"+returnArray[2]+"\n"; + charArray[0]=returnArray; + flush("charArray"); + } + +/** + * This method sets misc values, which will pass to C++ + * client side and sets test result, using flush(...) method. + */ + public void testMixed(boolean[] _bool, char[] _char, byte[] _byte, + short[] _short, short[] _ushort, int[] _int, + int[] _uint, long[] _long, long []_ulong, + float[] _float, double[] _double, String[] _string, + int count, int[][] _intArray) { + + int[] returnArray={1,2,3}; + _intArray[0]=returnArray; + _bool[0]=true; + _char[0]='q'; + _byte[0]=10; + _short[0]=200; _ushort[0]=200; + _int[0]=3000; _uint[0]=3000; + _long[0]=40000; _ulong[0]=40000; + _float[0]=500000; _double[0]=6000000; + _string[0]="iddqd"; + + S=new Boolean(_bool[0]).toString()+"\n"+ + new Character(_char[0]).toString()+"\n"+ + new Byte(_byte[0]).toString()+"\n"+ + new Short(_short[0]).toString()+"\n"+new Short(_ushort[0]).toString()+"\n"+ + new Integer(_int[0]).toString()+"\n"+new Integer(_uint[0]).toString()+"\n"+ + new Long(_long[0]).toString()+"\n"+new Long(_ulong[0]).toString()+"\n"+ + new Float(_float[0]).toString()+"\n"+ + new Double(_double[0]).toString()+"\n"+_string[0]+"\n"; + + for(int i=0;i + +X2JOUTServerTestComponent.jar.comp: manifest iX2JOUTServerTestComponent.class X2JOUTServerTestComponent.class + $(JDKHOME)\bin\jar cvfm X2JOUTServerTestComponent.jar.comp manifest *.class + +.SUFFIXES: .java .class + +.java.class: + $(JDKHOME)\bin\javac -classpath $(CLASSPATH) -d $(DEPTH)\dist\classes iX2JOUTServerTestComponent.java + $(JDKHOME)\bin\javac -classpath $(CLASSPATH) X2JOUTServerTestComponent.java + +install-component: X2JOUTServerTestComponent.jar.comp X2JOUTServerTestComponent.jar.info $(DLL) + copy X2JOUTServerTestComponent.jar* $(DIST)\bin\components + +clobber:: + -del /f *.class *.jar.comp + -del /f $(DIST)\bin\components\X2JOUTServerTestComponent.jar.* + -del /f $(DIST)\..\classes\org\mozilla\xpcom\iX2JOUTServerTestComponent.* + +clobber_all:: clobber +install:: install-component \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/java/manifest b/mozilla/java/xpcom/test/basic/params/X2JOUT/java/manifest new file mode 100644 index 00000000000..df289d0da46 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/java/manifest @@ -0,0 +1 @@ +Component-Class: X2JOUTServerTestComponent diff --git a/mozilla/java/xpcom/test/basic/params/X2JOUT/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JOUT/makefile.win new file mode 100644 index 00000000000..5f369c57d0f --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JOUT/makefile.win @@ -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> \ No newline at end of file diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JRET/Makefile.in new file mode 100644 index 00000000000..25b1fc2a7c1 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/Makefile.in @@ -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 diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/Makefile.in new file mode 100644 index 00000000000..5fc72ed820b --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/Makefile.in @@ -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): +# Client QA Team, St. Petersburg, Russia +# + +DEPTH=../../../../../../.. +topsrcdir = $(DEPTH) +srcdir = . +VPATH = . + +include $(DEPTH)/config/autoconf.mk + +MODULE = X2JRETClientTestComponent +LIBRARY_NAME = $(MODULE) +XPIDL_MODULE = $(MODULE) +IS_COMPONENT = 1 + +CPPSRCS = \ + X2JRETClientTestComponent.cpp \ + X2JRETClientTestComponentFactory.cpp \ + $(NULL) +XPIDLSRCS = iX2JRETClientTestComponent.idl + +JAVAI = iX2JRETClientTestComponent.class +DSO_LDOPTS += \ + $(XPCOM_LIBS) \ + $(NSPR_LIBS) \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + +$(JAVAI):: + $(JDKHOME)/bin/javac -classpath .:$(DIST)/classes -d $(DIST)/classes $< + +install:: $(JAVAI) diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponent.cpp b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponent.cpp new file mode 100644 index 00000000000..225f8517af9 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponent.cpp @@ -0,0 +1,445 @@ +/* -*- 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 "prmem.h" +#include "stdio.h" +#include "nsIComponentManager.h" +#include "X2JRETClientTestComponent.h" +#include "nsMemory.h" +#include "BCTest.h" +#include +#include +#include "nsString.h" +#include "nsStringUtil.h" + + iX2JRETServerTestComponent *serverComponent; + char* testLocation=""; + char* logLocation=""; + char* val=NULL; + char** hash=NULL; + PRUint8 hashCount=0; + PseudoHash* exclusionHash; + +X2JRETClientTestComponentImpl::X2JRETClientTestComponentImpl() { + NS_INIT_REFCNT(); + testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME); + logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME); + printf("DEbug:avm:X2JRETClientTestComponentImpl::X2JRETClientTestComponentImp\n"); + hash=(char**)PR_Malloc(sizeof(char*)*50); + exclusionHash=new PseudoHash(); +} + +X2JRETClientTestComponentImpl::~X2JRETClientTestComponentImpl() { +} + + NS_IMPL_ISUPPORTS3(X2JRETClientTestComponentImpl, + iX2JRETClientTestComponent, + iClientTestComponent, iExclusionSupport); + IMPL_PROCEED_RESULTS(X2JRETClientTestComponentImpl); + IMPL_PSEUDOHASH(X2JRETClientTestComponentImpl); + +/** + * This method creates an instance of server test component and + * transfers test and log locations to that instance. + */ +NS_IMETHODIMP X2JRETClientTestComponentImpl::Initialize(const char* serverProgID){ + + nsresult rv; + rv = nsComponentManager::CreateInstance(serverProgID, + nsnull, + NS_GET_IID(iX2JRETServerTestComponent), + (void**)&serverComponent); + if (NS_FAILED(rv)) { + printf("Create instance failed!!!"); + return rv; + } + + serverComponent->SetTestLocation(testLocation, logLocation); + return NS_OK; +} + + NS_IMETHODIMP X2JRETClientTestComponentImpl::Exclude(PRUint32 count, const char **exclusionList) { + printf("Debug:ovk:X2JRETClientTestComponentImpl::exclude\n"); + for(int i=0;iput((char*)exclusionList[i]); + hashCount++; + } + return NS_OK; + } + +/** + * This method executes all tests. See more comments below. + */ +NS_IMETHODIMP X2JRETClientTestComponentImpl::Execute(){ + + if (!exclusionHash->containsKey("octet")) TestByte(); + if (!exclusionHash->containsKey("short")) TestShort(); + if (!exclusionHash->containsKey("long")) TestLong(); + if (!exclusionHash->containsKey("longlong")) TestLonglong(); + 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("char")) TestChar(); + if (!exclusionHash->containsKey("wchar")) TestWChar(); + 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("iid")) TestIID(); +// if (!exclusionHash->containsKey("cid")) TestCID(); + + return NS_OK; +} +/** + * This method gets different short values from java side and + * sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestShort(){ + + val=NULL; + PRInt16 _short=0; + + for(int i=0;i<3;i++) { + serverComponent->TestShort(&_short); + val=PR_sprintf_append(val,"%d\n",_short); + } + + PrintResult("x2j.ret.client.short",val); +} + +/** + * This method gets different byte values from java side and + * sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestByte(){ + + val=NULL; + PRUint8 _byte=0; + + for(int i=0;i<3;i++) { + serverComponent->TestByte(&_byte); + val=PR_sprintf_append(val,"%d\n",_byte); + } + + PrintResult("x2j.ret.client.octet",val); +} + +/** + * This method gets different int values from java side and + * sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestLong(){ + + val=NULL; + PRInt32 _int=0; + + for(int i=0;i<3;i++) { + serverComponent->TestLong(&_int); + val=PR_sprintf_append(val,"%d\n",_int); + } + + PrintResult("x2j.ret.client.long",val); +} + +/** + * This method gets different long values from java side and + * sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestLonglong(){ + + val=NULL; + PRInt64 _long=0; + + for(int i=0;i<3;i++) { + serverComponent->TestLonglong(&_long); + val=PR_sprintf_append(val,"%lld\n",_long); + } + + PrintResult("x2j.ret.client.longlong",val); +} + +/** + * This method gets different unsigned short values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestUShort(){ + + val=NULL; + PRUint16 _ushort=0; + + for(int i=0;i<3;i++) { + serverComponent->TestUShort(&_ushort); + val=PR_sprintf_append(val,"%d\n",_ushort); + } + + PrintResult("x2j.ret.client.ushort",val); +} + +/** + * This method gets different unsigned int values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestULong(){ + + val=NULL; + PRUint32 _uint=0; + + for(int i=0;i<3;i++) { + serverComponent->TestULong(&_uint); + val=PR_sprintf_append(val,"%d\n",_uint); + } + + PrintResult("x2j.ret.client.ulong",val); +} + +/** + * This method gets different unsigned long values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestULonglong(){ + + val=NULL; + PRUint64 _ulong=0; + + for(int i=0;i<3;i++) { + serverComponent->TestULonglong(&_ulong); + val=PR_sprintf_append(val,"%lld\n",_ulong); + } + + PrintResult("x2j.ret.client.ulonglong",val); +} + +/** + * This method gets different float values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestFloat(){ + + val=NULL; + float _float=0; + + for(int i=0;i<4;i++) { + serverComponent->TestFloat(&_float); + val=PR_sprintf_append(val,"%.3e\n",_float); + } + + PrintResult("x2j.ret.client.float",val); +} + +/** + * This method gets different double values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestDouble(){ + + val=NULL; + double _double=0; + + for(int i=0;i<4;i++) { + serverComponent->TestDouble(&_double); + val=PR_sprintf_append(val,"%.3e\n",_double); + } + + PrintResult("x2j.ret.client.double",val); +} + +/** + * This method gets different boolean values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestBoolean(){ + + val=NULL; + PRBool _bool=false; + + for(int i=0;i<2;i++) { + serverComponent->TestBoolean(&_bool); + if (_bool==PR_TRUE) { + val=PR_sprintf_append(val,"%s\n","true"); + } else if (_bool==PR_FALSE) { + val=PR_sprintf_append(val,"%s\n","false"); + } else val=PR_sprintf_append(val,"%s\n","strange result"); + } + + PrintResult("x2j.ret.client.boolean",val); +} + +/** + * This method gets different char values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestChar(){ + + val=NULL; + char _char='f'; + + for(int i=0;i<2;i++) { + serverComponent->TestChar(&_char); + val=PR_sprintf_append(val,"%c\n",_char); + } + + PrintResult("x2j.ret.client.char",val); +} + +/** + * This method gets different PRUnichar values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestWChar(){ + + val=NULL; + PRUnichar _wchar=0; + + for(int i=0;i<2;i++) { + serverComponent->TestWChar(&_wchar); + val=PR_sprintf_append(val,"%c\n",_wchar); + } + + PrintResult("x2j.ret.client.wchar",val); +} + +/** + * This method gets different char* values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestString(){ + + val=NULL; + char* _string="0"; + + for(int i=0;i<3;i++) { + serverComponent->TestString(&_string); + val=PR_sprintf_append(val,"%s\n",_string); + } + + PrintResult("x2j.ret.client.string",val); +} + +/** + * This method gets different PRUnichar* values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestWString(){ + + val=NULL; + PRUnichar* _wstring; + + for(int i=0;i<3;i++) { + serverComponent->TestWString(&_wstring); + { + nsString str = *(new nsString(_wstring)); + NS_ALLOC_STR_BUF(aBuf,str,100) + val=PR_sprintf_append(val,"%s\n",aBuf); + NS_FREE_STR_BUF(aBuf) + } + } + + PrintResult("x2j.ret.client.wstring",val); +} + +/** + * This method gets char* array values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestStringArray(){ + + PRUint32 count=3; + char** _stringArray=(char**)PR_Malloc(sizeof(char*)*count); + const char** sA=(const char**)PR_Malloc(sizeof(const char*)*count); + serverComponent->TestStringArray(count,&_stringArray); + sA=(const char**) _stringArray; + PrintResultArray("x2j.ret.client.stringArray",count,sA); +} + +/** + * This method gets int array values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestLongArray(){ + + PRUint32 count=3; + PRInt32* _intArray=(PRInt32*)PR_Malloc(sizeof(PRInt32)*count); + serverComponent->TestLongArray(count,&_intArray); + PrintResultArray("x2j.ret.client.longArray",count,_intArray); +} + +/** + * This method gets char array values from java side + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestCharArray(){ + + PRUint32 count=3; + char* _charArray=(char*)PR_Malloc(sizeof(char)*count); + serverComponent->TestCharArray(count,&_charArray); + PrintResultArray("x2j.ret.client.charArray",count,_charArray); +} + +/** + * This method gets iX2JRETServerTestComponent object from java + * side, tries to invoke TestObj() on java side, using this object, + * and sets test results for C++ side. + */ +void X2JRETClientTestComponentImpl::TestObject(){ + + val=NULL; + iX2JRETServerTestComponent* obj=NULL; + + serverComponent->TestObject(&obj); + obj->TestObj(); + PrintResult("x2j.ret.client.object","!!!Right string!!!"); +} +/* + void X2JRETClientTestComponentImpl::TestIID() { + + const nsIID& iid=NS_GET_IID(iX2JRETServerTestComponent); + val=NULL; + + val=iid.ToString(); + + val=PR_sprintf_append(val,"%s\n",val); + PrintResult("x2j.ret.client.iid",val); + serverComponent->TestIID(&iid); + + } + + void X2JRETClientTestComponentImpl::TestCID() { + + NS_DEFINE_CID(cid,X2JRETCLIENTTESTCOMPONENT_CID); + val=NULL; + + val=cid.ToString(); + + val=PR_sprintf_append(val,"%s\n",val); + PrintResult("x2j.ret.client.cid",val); + serverComponent->TestCID(&cid); + + } +*/ diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponent.h b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponent.h new file mode 100644 index 00000000000..63d9de5c484 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponent.h @@ -0,0 +1,65 @@ +/* -*- 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 "iX2JRETClientTestComponent.h" +#include "iX2JRETServerTestComponent.h" +#include "iClientTestComponent.h" +#include "iExclusionSupport.h" +#include "ProceedResults.h" +#include "PseudoHash.h" + +class X2JRETClientTestComponentImpl : public iX2JRETClientTestComponent, + public iClientTestComponent, + public iExclusionSupport +{ + public: + X2JRETClientTestComponentImpl(); + virtual ~X2JRETClientTestComponentImpl(); + void TestByte(void); + void TestShort(void); + void TestLong(void); + void TestLonglong(void); + void TestUShort(void); + void TestULong(void); + void TestULonglong(void); + void TestFloat(void); + void TestDouble(void); + void TestBoolean(void); + void TestChar(void); + void TestWChar(void); + void TestString(void); + void TestWString(void); + void TestStringArray(void); + void TestLongArray(void); + void TestCharArray(void); + void TestObject(void); +// void TestIID(void); +// void TestCID(void); + + NS_DECL_ISUPPORTS + NS_DECL_ICLIENTTESTCOMPONENT + NS_DECL_IEXCLUSIONSUPPORT + + DECL_PROCEED_RESULTS +}; + DECL_PSEUDOHASH diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponentFactory.cpp b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponentFactory.cpp new file mode 100644 index 00000000000..9989fa56dc5 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/X2JRETClientTestComponentFactory.cpp @@ -0,0 +1,41 @@ +/* -*- 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 "X2JRETClientTestComponent.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(X2JRETClientTestComponentImpl) + +static nsModuleComponentInfo components[] = +{ + {"X2JRET Client Test Component", + X2JRETCLIENTTESTCOMPONENT_CID, + X2JRETCLIENTTESTCOMPONENT_PROGID, + X2JRETClientTestComponentImplConstructor, + NULL /* NULL if you dont need one */, + NULL /* NULL if you dont need one */ + } +}; + +NS_IMPL_NSGETMODULE("X2JRETClientTestComponentFactory", components) diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/iX2JRETClientTestComponent.idl b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/iX2JRETClientTestComponent.idl new file mode 100644 index 00000000000..49e3ebfe5b5 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/iX2JRETClientTestComponent.idl @@ -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" +#include "iClientTestComponent.idl" + +[scriptable, uuid(0e7b4fa0-a10c-11d4-9d3d-00a024a8bb88)] +interface iX2JRETClientTestComponent : nsISupports +{ + +}; + + +%{ C++ +#define X2JRETCLIENTTESTCOMPONENT_CID \ +{ /*ec924f70-a10b-11d4-9d3d-00a024a8bb88*/ \ + 0xec924f70, \ + 0xa10b, \ + 0x11d4, \ + {0x9d, 0x3d, 0x00, 0xa0, 0x24, 0xa8, 0xbb, 0x88} \ +} + +#define X2JRETCLIENTTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/X2JRETClient;1" + +%} + + diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/makefile.win new file mode 100644 index 00000000000..f0036b8cf67 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/cpp/makefile.win @@ -0,0 +1,51 @@ +#!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 = X2JRETClientTestComponent +DLL=.\$(OBJDIR)\$(DLLNAME).dll +MODULE = X2JRETClientTestComponent +COMPONENT = 1 + +XPIDLSRCS = \ + .\iX2JRETClientTestComponent.idl \ + $(NULL) + +CPP_OBJS= \ + .\$(OBJDIR)\X2JRETClientTestComponent.obj \ + .\$(OBJDIR)\X2JRETClientTestComponentFactory.obj \ + $(NULL) + + +LLIBS= $(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib + + +include <$(DEPTH)\config\rules.mak> + +install:: $(DLL) + $(MAKE_INSTALL) $(DLL) $(DIST)\bin\components +clobber:: + del /f $(DIST)\bin\components\$(DLLNAME).dll + del /f $(DIST)\bin\components\X2JRET*.xpt diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/java/Makefile.in b/mozilla/java/xpcom/test/basic/params/X2JRET/java/Makefile.in new file mode 100644 index 00000000000..7fb101a027d --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/java/Makefile.in @@ -0,0 +1,56 @@ +#!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 = . +XPIDLSRCS = iX2JRETServerTestComponent.idl +XPIDL_MODULE = X2JRETServerTestComponent +JAVA_OR_NSJVM = 1 + +include $(DEPTH)/config/autoconf.mk + + +include $(topsrcdir)/config/rules.mk + + +JDIRS=. + +X2JRETServerTestComponent.jar.comp: manifest iX2JRETServerTestComponent.class X2JRETServerTestComponent.class + $(JDKHOME)/bin/jar cvfm X2JRETServerTestComponent.jar.comp manifest *.class + +.SUFFIXES: .java .class + +.java.class: + $(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes -d $(DEPTH)/dist/classes iX2JRETServerTestComponent.java + $(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes X2JRETServerTestComponent.java + +install-component: X2JRETServerTestComponent.jar.comp X2JRETServerTestComponent.jar.info + cp -f X2JRETServerTestComponent.jar* $(DIST)/bin/components +clobber:: + rm -f *.class *.jar.comp + rm -f $(DIST)/bin/components/X2JRETServerTestComponent.jar.* +clobber_all:: clobber +install:: install-component + diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/java/X2JRETServerTestComponent.jar.info b/mozilla/java/xpcom/test/basic/params/X2JRET/java/X2JRETServerTestComponent.jar.info new file mode 100644 index 00000000000..09e32560eec --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/java/X2JRETServerTestComponent.jar.info @@ -0,0 +1,2 @@ +b7dafef0-a110-11d4-9d3d-00a024a8bb88 +@mozilla/blackwood/blackconnect/test/params/X2JRETServer;1 diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/java/X2JRETServerTestComponent.java b/mozilla/java/xpcom/test/basic/params/X2JRET/java/X2JRETServerTestComponent.java new file mode 100644 index 00000000000..d9ce1c7edc2 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/java/X2JRETServerTestComponent.java @@ -0,0 +1,452 @@ +/* -*- 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.*; +import java.lang.reflect.*; +import java.io.*; + +public class X2JRETServerTestComponent implements iX2JRETServerTestComponent { + + private static String testLocation=""; + private static String logLocation=""; + private String S=""; + private int all=0; + + public X2JRETServerTestComponent() { + System.out.println("--[java] X2JRETServerTestComponent constructor"); + } + + public Object queryInterface(IID iid) { + System.out.println("--[java]X2JRETServerTestComponent::queryInterface iid="+iid); + if (iid.equals(nsISupports.IID) + || iid.equals(iX2JRETServerTestComponent.IID)) { + return this; + }else { + return null; + } + } + +/** + * This method sets locations, which are passed from C++ client + * side. + * First parameter - test location, + * Second parameter - log location. + */ + public void setTestLocation(String location, String location2) { + testLocation=location; + logLocation=location2; + } + +/** + * This method writes server side test result to a log file. + * These test results were accumulated in apropriated test + * methods. This method takes tested type as parameter. + */ + public void flush(String name) { + try{ + DataOutputStream f=new DataOutputStream(new FileOutputStream(logLocation+"/x2j.ret.server."+name)); + f.writeBytes(S); + } catch(Exception e) { + System.out.println("Exception during writing the file"); + } + S=""; + all=0; + } + +/****************************************/ +/* TEST METHODS */ +/****************************************/ + +/** + * This method sets short values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public short testShort() { + short _short=0; + switch (all) { + case 0: _short=java.lang.Short.MIN_VALUE; break; + case 1: _short=1000; break; + case 2: _short=java.lang.Short.MAX_VALUE; break; + } + all++; + S=S+new Short(_short).toString()+"\n"; + if (all==3) { + flush("short"); + } + return _short; + } + +/** + * This method sets int values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public int testLong() { + int _int=0; + switch (all) { + case 0: _int=java.lang.Integer.MIN_VALUE; break; + case 1: _int=1000; break; + case 2: _int=java.lang.Integer.MAX_VALUE; break; + } + all++; + S=S+new Integer(_int).toString()+"\n"; + if (all==3) { + flush("long"); + } + return _int; + } + +/** + * This method sets long values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public long testLonglong() { + long _long=0; + switch (all) { + case 0: _long=java.lang.Long.MIN_VALUE; break; + case 1: _long=1000; break; + case 2: _long=java.lang.Long.MAX_VALUE; break; + } + all++; + S=S+new Long(_long).toString()+"\n"; + if (all==3) { + flush("longlong"); + } + return _long; + } + +/** + * This method sets byte values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public byte testByte() { + byte _byte=0; + switch (all) { + case 0: _byte=0; break; + case 1: _byte=10; break; + case 2: _byte=127; break; + } + all++; + S=S+new Byte(_byte).toString()+"\n"; + if (all==3) { + flush("octet"); + } + return _byte; + } + +/** + * This method sets short values and returns them to C++ + * client side as unsigned short and sets java side test result, + * using flush(...) method. + */ + public short testUShort() { + short _ushort=0; + switch (all) { + case 0: _ushort=0; break; + case 1: _ushort=1000; break; + case 2: _ushort=java.lang.Short.MAX_VALUE; break; + } + all++; + S=S+new Short(_ushort).toString()+"\n"; + if (all==3) { + flush("ushort"); + } + return _ushort; + } + +/** + * This method sets int values and returns them to C++ + * client side as unsigned int and sets java side test result, + * using flush(...) method. + */ + public int testULong() { + int _uint=0; + switch (all) { + case 0: _uint=0; break; + case 1: _uint=1000; break; + case 2: _uint=java.lang.Integer.MAX_VALUE; break; + } + all++; + S=S+new Integer(_uint).toString()+"\n"; + if (all==3) { + flush("ulong"); + } + return _uint; + } + +/** + * This method sets long values and returns them to C++ + * client side as unsigned long and sets java side test result, + * using flush(...) method. + */ + public long testULonglong() { + long _ulong=0; + switch (all) { + case 0: _ulong=0; break; + case 1: _ulong=1000; break; + case 2: _ulong=java.lang.Long.MAX_VALUE; break; + } + all++; + S=S+new Long(_ulong).toString()+"\n"; + if (all==3) { + flush("ulonglong"); + } + return _ulong; + } + +/** + * This method sets float values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public float testFloat() { + float _float=0; + switch (all) { + case 0: _float=java.lang.Float.MIN_VALUE; break; + case 1: _float=1; break; + case 2: _float=java.lang.Float.MAX_VALUE; break; + case 3: _float=0; break; + } + all++; + S=S+new Float(_float).toString()+"\n"; + if (all==4) { + flush("float"); + } + return _float; + } + +/** + * This method sets double values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public double testDouble() { + double _double=0; + switch (all) { + case 0: _double=java.lang.Double.MIN_VALUE; break; + case 1: _double=1; break; + case 2: _double=java.lang.Double.MAX_VALUE; break; + case 3: _double=0; break; + } + all++; + S=S+new Double(_double).toString()+"\n"; + if (all==4) { + flush("double"); + } + return _double; + } + +/** + * This method sets boolean values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public boolean testBoolean() { + boolean _bool=true; + switch (all) { + case 0: _bool=true; break; + case 1: _bool=false; break; + } + all++; + S=S+new Boolean(_bool).toString()+"\n"; + if (all==2) { + flush("boolean"); + } + return _bool; + } + +/** + * This method sets char values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public char testChar() { + char _char='0'; + switch (all) { + case 0: _char='0'; break; + case 1: _char='Z'; break; + } + all++; + S=S+new Character(_char).toString()+"\n"; + if (all==2) { + flush("char"); + } + return _char; + } + +/** + * This method sets char values and returns them to C++ + * client side as PRUnichar and sets java side test result, + * using flush(...) method. + */ + public char testWChar() { + char _wchar='0'; + switch (all) { + case 0: _wchar='A'; break; + case 1: _wchar='Z'; break; + } + all++; + S=S+new Character(_wchar).toString()+"\n"; + if (all==2) { + flush("wchar"); + } + return _wchar; + } + +/** + * This method sets string values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public String testString() { + String _string="0"; + switch (all) { + case 0: _string=""; break; + case 1: _string="abc"; break; + case 2: _string="NULL string must be here"; break; + } + all++; + S=S+_string+"\n"; + if (all==3) { + flush("string"); + } + return _string; + } + +/** + * This method sets string values and returns them to C++ + * client side as PRUnichar* and sets java side test result, + * using flush(...) method. + */ + public String testWString() { + String _wstring="0"; + switch (all) { + case 0: _wstring=""; break; + case 1: _wstring="abc"; break; + case 2: _wstring="ctrl"; break; + } + all++; + S=S+_wstring+"\n"; + if (all==3) { + flush("wstring"); + } + return _wstring; + } + +/** + * This method sets string array values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public String[] testStringArray(int count) { + String[] stringArray={"iddqd","idkfa","ctrl-x"}; + S=stringArray[0]+"\n"+stringArray[1]+"\n"+stringArray[2]+"\n"; + flush("stringArray"); + return stringArray; + } + +/** + * This method sets int array values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public int[] testLongArray(int count) { + int[] intArray={11,22,33}; + S=intArray[0]+"\n"+intArray[1]+"\n"+intArray[2]+"\n"; + flush("longArray"); + return intArray; + } + +/** + * This method sets char array values and returns them to C++ + * client side and sets java side test result, + * using flush(...) method. + */ + public char[] testCharArray(int count) { + char[] charArray={'a','b','c'}; + S=charArray[0]+"\n"+charArray[1]+"\n"+charArray[2]+"\n"; + flush("charArray"); + return charArray; + } + +/** + * This method returns iX2JRETServerTestComponent object to C++ + * client side and sets java side test result, using flush(...) + * method. + */ + public iX2JRETServerTestComponent testObject() { + return this; + } + +/** + * This method is invoked from C++ client side, using + * iX2JRETServerTestComponent object. + * It sets java side test result, using flush(...) method. + */ + public void testObj() { + S="!!!Right string!!!"+"\n"; + flush("object"); + } + +/* + public IID testIID() { + IID _iid=new IID("5e946b90-3a31-11d5-b653-005004552ed1"); + S=_iid.toString()+"\n"; + flush("iid"); + return _iid; + } + + public CID testCID() { + CID _cid=new CID("5e946b90-3a31-11d5-b653-005004552ed1"); + S=_cid.toString()+"\n"; + flush("cid"); + return _cid; + } +*/ +/****************************************/ +/* /TEST METHODS */ +/****************************************/ + + static { + try { + Class nsISupportsStringClass = Class.forName("org.mozilla.xpcom.nsISupportsString"); + Class iX2JRETServerTestComponentClass = Class.forName("org.mozilla.xpcom.iX2JRETServerTestComponent"); + Class nsIComponentManagerClass = Class.forName("org.mozilla.xpcom.nsIComponentManager"); + Class nsIFactoryClass = Class.forName("org.mozilla.xpcom.nsIFactory"); + Class nsIEnumeratorClass = Class.forName("org.mozilla.xpcom.nsIEnumerator"); + + InterfaceRegistry.register(nsIComponentManagerClass); + InterfaceRegistry.register(nsIFactoryClass); + InterfaceRegistry.register(nsIEnumeratorClass); + InterfaceRegistry.register(iX2JRETServerTestComponentClass); + InterfaceRegistry.register(nsISupportsStringClass); + + }catch (Exception e) { + System.out.println(e); + } + } +}; diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/java/iX2JRETServerTestComponent.idl b/mozilla/java/xpcom/test/basic/params/X2JRET/java/iX2JRETServerTestComponent.idl new file mode 100644 index 00000000000..0e0d35c160a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/java/iX2JRETServerTestComponent.idl @@ -0,0 +1,54 @@ +/* -*- 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(b7dafef0-a110-11d4-9d3d-00a024a8bb88)] +interface iX2JRETServerTestComponent : nsISupports { + void setTestLocation(in string testLocation, in string logLocation); + void flush(in string name); + short testShort(); + long testLong(); + long long testLonglong(); + octet testByte(); + unsigned short testUShort(); + unsigned long testULong(); + unsigned long long testULonglong(); + float testFloat(); + double testDouble(); + boolean testBoolean(); + char testChar(); + wchar testWChar(); + string testString(); + wstring testWString(); + void testStringArray(in unsigned long count, + [retval, array, size_is(count)] out string stringArray); + void testLongArray(in unsigned long count, + [retval, array, size_is(count)] out long intArray); + void testCharArray(in unsigned long count, + [retval, array, size_is(count)] out char charArray); + iX2JRETServerTestComponent testObject(); + void testObj(); +// nsIIDRef testIID(); +// nsCIDRef testCID(); +}; diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/java/iX2JRETServerTestComponent.java b/mozilla/java/xpcom/test/basic/params/X2JRET/java/iX2JRETServerTestComponent.java new file mode 100644 index 00000000000..6b311b5dd90 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/java/iX2JRETServerTestComponent.java @@ -0,0 +1,90 @@ +/* + * ************* DO NOT EDIT THIS FILE *********** + * + * This file was automatically generated from iX2JRETServerTestComponent.idl. + */ + + +package org.mozilla.xpcom; + + +/** + * Interface iX2JRETServerTestComponent + * + * IID: 0xb7dafef0-a110-11d4-9d3d-00a024a8bb88 + */ + +public interface iX2JRETServerTestComponent extends nsISupports +{ + public static final IID IID = + new IID("b7dafef0-a110-11d4-9d3d-00a024a8bb88"); + + + /* void setTestLocation (in string testLocation, in string logLocation); */ + public void setTestLocation(String testLocation, String logLocation); + + /* void flush (in string name); */ + public void flush(String name); + + /* short testShort (); */ + public short testShort(); + + /* long testLong (); */ + public int testLong(); + + /* long long testLonglong (); */ + public long testLonglong(); + + /* octet testByte (); */ + public byte testByte(); + + /* unsigned short testUShort (); */ + public short testUShort(); + + /* unsigned long testULong (); */ + public int testULong(); + + /* unsigned long long testULonglong (); */ + public long testULonglong(); + + /* float testFloat (); */ + public float testFloat(); + + /* double testDouble (); */ + public double testDouble(); + + /* boolean testBoolean (); */ + public boolean testBoolean(); + + /* char testChar (); */ + public char testChar(); + + /* wchar testWChar (); */ + public char testWChar(); + + /* string testString (); */ + public String testString(); + + /* wstring testWString (); */ + public String testWString(); + + /* void testStringArray (in unsigned long count, [array, size_is (count), retval] out string stringArray); */ + public String[] testStringArray(int count); + + /* void testLongArray (in unsigned long count, [array, size_is (count), retval] out long intArray); */ + public int[] testLongArray(int count); + + /* void testCharArray (in unsigned long count, [array, size_is (count), retval] out char charArray); */ + public char[] testCharArray(int count); + + /* iX2JRETServerTestComponent testObject (); */ + public iX2JRETServerTestComponent testObject(); + + /* void testObj (); */ + public void testObj(); + +} + +/* + * end + */ diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/java/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JRET/java/makefile.win new file mode 100644 index 00000000000..cbfd2bff852 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/java/makefile.win @@ -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 +# +# Client QA Team, St. Petersburg, Russia +# + +DEPTH = ..\..\..\..\..\..\.. +topsrcdir = $(DEPTH) +srcdir = . +VPATH = . + +MAKE_OBJ_TYPE=DLL +MODULE=X2JRETServerTestComponent +COMPONENT=1 + +XPIDLSRCS = \ + .\iX2JRETServerTestComponent.idl \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> + +X2JRETServerTestComponent.jar.comp: manifest iX2JRETServerTestComponent.class X2JRETServerTestComponent.class + $(JDKHOME)\bin\jar cvfm X2JRETServerTestComponent.jar.comp manifest *.class + +.SUFFIXES: .java .class + +.java.class: + $(JDKHOME)\bin\javac -classpath $(CLASSPATH) -d $(DEPTH)\dist\classes iX2JRETServerTestComponent.java + $(JDKHOME)\bin\javac -classpath $(CLASSPATH) X2JRETServerTestComponent.java + +install-component: X2JRETServerTestComponent.jar.comp X2JRETServerTestComponent.jar.info $(DLL) + copy X2JRETServerTestComponent.jar* $(DIST)\bin\components + +clobber:: + -del /f *.class *.jar.comp + -del /f $(DIST)\bin\components\X2JRETServerTestComponent.jar.* + -del /f $(DIST)\..\classes\org\mozilla\xpcom\iX2JRETServerTestComponent.* +clobber_all:: clobber +install:: install-component diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/java/manifest b/mozilla/java/xpcom/test/basic/params/X2JRET/java/manifest new file mode 100644 index 00000000000..9c4b30fb6fe --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/java/manifest @@ -0,0 +1 @@ +Component-Class: X2JRETServerTestComponent diff --git a/mozilla/java/xpcom/test/basic/params/X2JRET/makefile.win b/mozilla/java/xpcom/test/basic/params/X2JRET/makefile.win new file mode 100644 index 00000000000..851c443ba03 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/X2JRET/makefile.win @@ -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> diff --git a/mozilla/java/xpcom/test/basic/params/XPCOM.html b/mozilla/java/xpcom/test/basic/params/XPCOM.html new file mode 100644 index 00000000000..9dea42661a9 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/XPCOM.html @@ -0,0 +1,301 @@ + + + + + + + Description of XPCOM tests. + + + +This document contains a simple description +of XPCOM tests. + + +

+1. Tests for X2JIN xpcom component.

+Client part of the X2JIN component is written in C++. +
Server part of the X2JIN component is written in Java. +
How it works: Client part is loaded by Mozilla browser and loads +server part of component. After that, client part sets different parameters +and tries to invoke methods with these parameters from the server part. +
Expected result: Parameters, which were set in client part, +are transferred to the server part correctly. +
List of test methods: +
testShort(in short); +
testInt(in long); +
testLong(in long long); +
testByte(in octet); +
testUShort(in unsigned short); +
testUInt(in unsigned long); +
testULong(in unsigned long long); +
testFloat(in float); +
testDouble(in double); +
testBoolean(in boolean); +
testChar(in char); +
testWChar(in wchar); +
testString(in string); +
testWString(in wstring); +
testStringArray(in unsigned long,[array, size_is(count)] in string); +
testIntArray(in unsigned long, [array, size_is(count)] in long); +
testCharArray(in unsigned long,[array, size_is(count)] in char); +
testMixed(in boolean, in char, in octet, in short, in unsigned short, +in long, in unsigned long, in long long, in unsigned long long, in float, +in double, in string, in unsigned long, [array, size_is(count)] in long); +
testObject(in iX2JINServerTestComponent); +
+

+2. Tests for X2JOUT xpcom component.

+Client part of the X2JOUT component is written in C++. +
Server part of the X2JOUT component is written in Java. +
How it works: Client part is loaded by Mozilla browser and loads +server part of component. After that, client part gets different parameters +invoking methods from the server part. +
Expected result: Parameters, which were set in server part, +are transferred to the client part correctly. +
List of test methods: +
testShort(out short); +
testInt(out long); +
testLong(out long long); +
testByte(out octet); +
testUShort(out unsigned short); +
testUInt(out unsigned long); +
testULong(out unsigned long long); +
testFloat(out float); +
testDouble(out double); +
testBoolean(out boolean); +
testChar(out char); +
testWChar(out wchar); +
testString(out string); +
testWString(out wstring); +
testStringArray(in unsigned long,[array, size_is(count)] out string); +
testIntArray(in unsigned long, [array, size_is(count)] out long); +
testCharArray(in unsigned long,[array, size_is(count)] out char); +
testMixed(out boolean, out char, out octet, out short, out unsigned +short, out long, out unsigned long, out long long, out unsigned long long, +out float, out double, out string, in unsigned long, [array, size_is(count)] +out long); +
testObject(out iX2JOUTServerTestComponent); +
+

+3. Tests for X2JINOUT xpcom component.

+Client part of the X2JINOUT component is written in C++. +
Server part of the X2JINOUT component is written in Java. +
How it works: Client part is loaded by Mozilla browser and loads +server part of component. After that, client part sets different parameters +and transfers them to the server part. The server part transfers these +parameters back to the client part. +
Expected result: Parameters, which were set in the client part, +are transferred to the server part and back to the client part correctly. +
List of test methods: +
testShort(inout short); +
testInt(inout long); +
testLong(inout long long); +
testByte(inout octet); +
testUShort(inout unsigned short); +
testUInt(inout unsigned long); +
testULong(inout unsigned long long); +
testFloat(inout float); +
testDouble(inout double); +
testBoolean(inout boolean); +
testChar(inout char); +
testWChar(inout wchar); +
testString(inout string); +
testWString(inout wstring); +
testStringArray(in unsigned long,[array, size_is(count)] inout string); +
testIntArray(in unsigned long, [array, size_is(count)] inout long); +
testCharArray(in unsigned long,[array, size_is(count)] inout char); +
testMixed(inout boolean, inout char, inout octet, inout short, inout +unsigned short, inout long, inout unsigned long, inout long long, inout +unsigned long long, inout float, inout double, inout string, in unsigned +long, [array, size_is(count)] inout long); +
testObject(inout iX2JINOUTServerTestComponent); +
+

+4. Tests for X2JRET xpcom component.

+Client part of the X2JRET component is written in C++. +
Server part of the X2JRET component is written in Java. +
How it works: Client part is loaded by Mozilla browser and loads +server part of component. After that, client part gets different parameters +invoking methods from the server part, using retval. +
Expected result: Parameters, which were set in server part, +are transferred to the client part correctly. +
List of test methods: +
short testShort(); +
long testInt(); +
long long testLong(); +
octet testByte(); +
unsigned short testUShort(); +
unsigned long testUInt(); +
unsigned long long testULong(); +
float testFloat(); +
double testDouble(); +
boolean testBoolean(); +
char testChar(); +
wchar testWChar(); +
string testString(); +
wstring testWString(); +
void testStringArray(in unsigned long count, [retval, array, size_is(count)] +out string stringArray); +
void testIntArray(in unsigned long count, [retval, array, size_is(count)] +out long intArray); +
void testCharArray(in unsigned long count,[retval, array, size_is(count)] +out char charArray); +
iX2JRETServerTestComponent testObject(); +
+

+5. Tests for J2XIN xpcom component.

+Client part of the J2XIN component is written in Java. +
Server part of the J2XIN component is written in C++. +
How it works: Client part is loaded by Mozilla browser and loads +server part of component. After that, client part sets different parameters +and tries to invoke methods with these parameters from the server part. +
Expected result: Parameters, which were set in client part, +are transferred to the server part correctly. +
List of test methods: +
testShort(in short); +
testInt(in long); +
testLong(in long long); +
testByte(in octet); +
testUShort(in unsigned short); +
testUInt(in unsigned long); +
testULong(in unsigned long long); +
testFloat(in float); +
testDouble(in double); +
testBoolean(in boolean); +
testChar(in char); +
testWChar(in wchar); +
testString(in string); +
testWString(in wstring); +
testStringArray(in unsigned long,[array, size_is(count)] in string); +
testIntArray(in unsigned long, [array, size_is(count)] in long); +
testCharArray(in unsigned long,[array, size_is(count)] in char); +
testMixed(in boolean, in char, in octet, in short, in unsigned short, +in long, in unsigned long, in long long, in unsigned long long, in float, +in double, in string, in unsigned long, [array, size_is(count)] in long); +
testObject(in iJ2XINServerTestComponent); +
+

+6. Tests for J2XOUT xpcom component.

+Client part of the J2XOUT component is written in Java. +
Server part of the J2XOUT component is written in C++. +
How it works: Client part is loaded by Mozilla browser and loads +server part of component. After that, client part gets different parameters +invoking methods from the server part. +
Expected result: Parameters, which were set in server part, +are transferred to the client part correctly. +
List of test methods: +
testShort(out short); +
testInt(out long); +
testLong(out long long); +
testByte(out octet); +
testUShort(out unsigned short); +
testUInt(out unsigned long); +
testULong(out unsigned long long); +
testFloat(out float); +
testDouble(out double); +
testBoolean(out boolean); +
testChar(out char); +
testWChar(out wchar); +
testString(out string); +
testWString(out wstring); +
testStringArray(in unsigned long,[array, size_is(count)] out string); +
testIntArray(in unsigned long, [array, size_is(count)] out long); +
testCharArray(in unsigned long,[array, size_is(count)] out char); +
testMixed(out boolean, out char, out octet, out short, out unsigned +short, out long, out unsigned long, out long long, out unsigned long long, +out float, out double, out string, in unsigned long, [array, size_is(count)] +out long); +
testObject(out iJ2XOUTServerTestComponent); +
+

+7. Tests for J2XINOUT xpcom component.

+Client part of the J2XINOUT component is written in Java. +
Server part of the J2XINOUT component is written in C++. +
How it works: Client part is loaded by Mozilla browser and loads +server part of component. After that, client part sets different parameters +and transfers them to the server part. The server part transfers these +parameters back to the client part. +
Expected result: Parameters, which were set in the client part, +are transferred to the server part and back to the client part correctly. +
List of test methods: +
testShort(inout short); +
testInt(inout long); +
testLong(inout long long); +
testByte(inout octet); +
testUShort(inout unsigned short); +
testUInt(inout unsigned long); +
testULong(inout unsigned long long); +
testFloat(inout float); +
testDouble(inout double); +
testBoolean(inout boolean); +
testChar(inout char); +
testWChar(inout wchar); +
testString(inout string); +
testWString(inout wstring); +
testStringArray(in unsigned long,[array, size_is(count)] inout string); +
testIntArray(in unsigned long, [array, size_is(count)] inout long); +
testCharArray(in unsigned long,[array, size_is(count)] inout char); +
testMixed(inout boolean, inout char, inout octet, inout short, inout +unsigned short, inout long, inout unsigned long, inout long long, inout +unsigned long long, inout float, inout double, inout string, in unsigned +long, [array, size_is(count)] inout long); +
testObject(inout iJ2XINOUTServerTestComponent); +
+

+8. Tests for J2XRET xpcom component.

+Client part of the J2XRET component is written in Java. +
Server part of the J2XRET component is written in C++. +
How it works: Client part is loaded by Mozilla browser and loads +server part of component. After that, client part gets different parameters +invoking methods from the server part, using retval. +
Expected result: Parameters, which were set in server part, +are transferred to the client part correctly. +
List of test methods: +
short testShort(); +
long testInt(); +
long long testLong(); +
octet testByte(); +
unsigned short testUShort(); +
unsigned long testUInt(); +
unsigned long long testULong(); +
float testFloat(); +
double testDouble(); +
boolean testBoolean(); +
char testChar(); +
wchar testWChar(); +
string testString(); +
wstring testWString(); +
void testStringArray(in unsigned long count, [retval, array, size_is(count)] +out string stringArray); +
void testIntArray(in unsigned long count, [retval, array, size_is(count)] +out long intArray); +
void testCharArray(in unsigned long count,[retval, array, size_is(count)] +out char charArray); +
iJ2XRETServerTestComponent testObject(); + + diff --git a/mozilla/java/xpcom/test/basic/params/resGen.pl b/mozilla/java/xpcom/test/basic/params/resGen.pl new file mode 100755 index 00000000000..e2fff14eb63 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/params/resGen.pl @@ -0,0 +1,290 @@ +#!/usr/loacl/bin/perl +%types=("x2j.in",1,"x2j.out",2,"x2j.inout",3,"x2j.ret",4, + "j2x.in",5,"j2x.out",6,"j2x.inout",7,"j2x.ret",8); + +sub usage { + print("##################################################\n"); + print("Usage: resGen.pl \n"); + print(" Where type is one of following: ".join(" ",keys(%types)). "\n"); + print(" or \"all\"\n"); + print(" log_dir is directory with BlackConnect test logs\n"); + print(" output_file is output HTML file name\n"); + print("##################################################\n"); + exit(-1); +} + +#Main +unless ($#ARGV == 2 ) { + usage(); +} +$type=$ARGV[0]; +$log_dir=$ARGV[1]; +$output_file=$ARGV[2]; +(-d $log_dir) || die ("ERROR: $log_dir doesn't exist !\n"); +if($types{$type}) { + $output = "\n"; + if($type =~ /.*inout/) { + $output .= DoInout(); + } else { + $output .= DoUsual(); + } + $output.="\n"; + save($output); +} elsif($type eq "all") { + $common_output = "\n"; + foreach $type (sort(keys(%types))) { + if($type =~ /.*inout/) { + $common_output .= DoInout(); + } else { + $common_output .= DoUsual(); + } + } + $common_output.="\n"; + save($common_output); +} else { + print "Unknown type $type\n\n"; + usage(); +} +sub save { + my $output = shift(@_); + open(OUT,">$output_file") || die "Can't open output file $!\n"; + print OUT $output; + close(OUT); +} +sub DoUsual { + my @server_files=<$log_dir/$type."server"*>; + my @client_files=<$log_dir/$type."client"*>; + my %s_files=split(/=/,join("=1=",@server_files)."=1"); + my %c_files=split(/=/,join("=1=",@client_files)."=1"); + my $all_log="

Results for $type tests


"; + + if ($type eq "x2j.in") { + $all_log.="Client part of the X2JIN component is written in C++.
"; + $all_log.="Server part of the X2JIN component is written in Java.
"; + $all_log.="How it works: Client part is loaded by Mozilla browser and loads server part of component. After that, client part sets different parameters and tries to invoke methods with these parameters from the server part.
"; + $all_log.="Expected result: Parameters, which were set in client part, are transferred to the server part correctly.

"; + } + + if ($type eq "x2j.out") { + $all_log.="Client part of the X2JOUT component is written in C++.
"; + $all_log.="Server part of the X2JOUT component is written in Java.
"; + $all_log.="How it works: Client part is loaded by Mozilla browser and loads server part of component. After that, client part gets different parameters invoking methods from the server part.
"; + $all_log.="Expected result: Parameters, which were set in server part, are transferred to the client part correctly.

"; + } + + if ($type eq "x2j.ret") { + $all_log.="Client part of the X2JRET component is written in C++.
"; + $all_log.="Server part of the X2JRET component is written in Java.
"; + $all_log.="How it works: Client part is loaded by Mozilla browser and loads server part of component. After that, client part gets different parameters invoking methods from the server part, using retval.
"; + $all_log.="Expected result: Parameters, which were set in server part, are transferred to the client part correctly.

"; + } + + if ($type eq "j2x.in") { + $all_log.="Client part of the J2XIN component is written in Java.
"; + $all_log.="Server part of the J2XIN component is written in C++.
"; + $all_log.="How it works: Client part is loaded by Mozilla browser and loads server part of component. After that, client part sets different parameters and tries to invoke methods with these parameters from the server part.
"; + $all_log.="Expected result: Parameters, which were set in client part, are transferred to the server part correctly.

"; + } + + if ($type eq "j2x.out") { + $all_log.="Client part of the J2XOUT component is written in Java.
"; + $all_log.="Server part of the J2XOUT component is written in C++.
"; + $all_log.="How it works: Client part is loaded by Mozilla browser and loads server part of component. After that, client part gets different parameters invoking methods from the server part.
"; + $all_log.="Expected result: Parameters, which were set in server part, are transferred to the client part correctly.

"; + } + + if ($type eq "j2x.ret") { + $all_log.="Client part of the J2XRET component is written in Java.
"; + $all_log.="Server part of the J2XRET component is written in C++.
"; + $all_log.="How it works: Client part is loaded by Mozilla browser and loads server part of component. After that, client part gets different parameters invoking methods from the server part, using retval.
"; + $all_log.="Expected result: Parameters, which were set in server part, are transferred to the client part correctly.

"; + } + + if($#client_files == -1) { + return ""; + } + if($#server_files != $#client_files) { + print "Warning!!!. Different amount of server and client files\n"; + } + + $all_log.=""; + foreach $c_file (sort(keys(%c_files))) { + @CF=(); + @SF=(); + $result="UNDEF"; + $c_file =~ /.*(\..*$)/; + $ID=$1; + open(C,$c_file); + @CF=; + close(C); + unless($s_files{$log_dir."/".$type.".server".$ID}) { + print "Warning!!!. Server result for $log_dir\/$type.server$ID doesn't exist\n"; + $result = "FAILED"; + }else { + open(S,$log_dir."/".$type.".server".$ID)||die "Error opening server file\n"; + $i=0; + $result="FAILED"; + while($line=) { + $line =~ s/\r|\n|^\s*|\s*$//g; + $CF[$i]=~ s/\r|\n|^\s*|\s*$//g; + $SF[$i]=$line; + if (($ID eq ".float")||($ID eq ".double")) { + if (substr($SF[$i],0,3) eq substr($CF[$i],0,3)) + {$result="PASSED";} + } else { + if($line eq $CF[$i]) { + $result="PASSED"; + } + } + $i++; + } + close(S); + } + $all_log.=""; + if($result=~/FAILED/) { + $all_log.=""; + } else { + $all_log.=""; + } + + if ($ID eq ".boolean"){ $all_log.="";} + if ($ID eq ".char"){ $all_log.="";} + if ($ID eq ".wchar"){ $all_log.="";} + if ($ID eq ".charArray"){ $all_log.="";} + if ($ID eq ".string"){ $all_log.="";} + if ($ID eq ".wstring"){ $all_log.="";} + if ($ID eq ".float"){ $all_log.="";} + if ($ID eq ".double"){ $all_log.="";} + if ($ID eq ".octet"){ $all_log.="";} + if ($ID eq ".short"){ $all_log.="";} + if ($ID eq ".ushort"){ $all_log.="";} + if ($ID eq ".long"){ $all_log.="";} + if ($ID eq ".ulong"){ $all_log.="";} + if ($ID eq ".longlong"){$all_log.="";} + if ($ID eq ".ulonglong"){ $all_log.="";} + if ($ID eq ".stringArray"){ $all_log.="";} + if ($ID eq ".longArray"){ $all_log.="";} + if ($ID eq ".mixed"){ $all_log.="";} + if ($ID eq ".object"){ $all_log.="";} + if ($ID eq ".iid"){ $all_log.="";} + if ($ID eq ".cid"){ $all_log.="";} + + $all_log.="\n"; + } +$all_log.="
IDClient dataServer dataResultComments
$type$ID".join("
",@CF)."
".join("
",@SF)."
".$result."".$result."Test for PRBoolTest for charTest for PRUnicharTest for char arrayTest for char*Test for PRUnichar*Test for floatTest for doubleTest for PRUint8Test for PRInt16Test for PRUint16Test for PRInt32Test for PRUint32Test for PRInt64Test for PRUint64Test for char* arrayTest for PRInt32 arrayTest for misc valuesTest for interface*Test for const nsIID&Test for const nsCID&
\n"; +return $all_log; +} + + +sub DoInout { + my @server_files=<$log_dir/$type."server"*>; + my @client_files=<$log_dir/$type."client"*>; + my @xclient_files=<$log_dir/$type."xclient"*>; + my %s_files=split(/=/,join("=1=",@server_files)."=1"); + my %c_files=split(/=/,join("=1=",@client_files)."=1"); + my %xc_files=split(/=/,join("=1=",@xclient_files)."=1"); + my $all_log="

Results for $type tests

\n"; + if($#server_files != $#client_files) { + print "Warning!!!. Different amount of server and client files\n"; + } + + $all_log.=""; + + if ($type eq "x2j.inout") { + $all_log.="Client part of the X2JINOUT component is written in C++.
"; + $all_log.="Server part of the X2JINOUT component is written in Java.
"; + $all_log.="How it works: Client part is loaded by Mozilla browser and loads server part of component. After that, client part sets different parameters and transfers them to the server part. The server part transfers these parameters back to the client part.
"; + $all_log.="Expected result: Parameters, which were set in the client part, are transferred to the server part and back to the client part correctly.

"; + } + + if ($type eq "j2x.inout") { + $all_log.="Client part of the J2XINOUT component is written in Java.
"; + $all_log.="Server part of the J2XINOUT component is written in C++.
"; + $all_log.="How it works: Client part is loaded by Mozilla browser and loads server part of component. After that, client part sets different parameters and transfers them to the server part. The server part transfers these parameters back to the client part.
"; + $all_log.="Expected result: Parameters, which were set in the client part, are transferred to the server part and back to the client part correctly.

"; + } + + foreach $c_file (sort(keys(%c_files))) { + @CF=(); + @XCF=(); + @SF=(); +@TMP=(); + $result="UNDEF"; + $c_file =~ /.*(\..*$)/; + $ID=$1; + open(C,$c_file); + @CF=; + close(C); + unless($s_files{$log_dir."/".$type.".server".$ID}) { + print "Warning!!!. Server result for $log_dir\/$type.server$ID doesn't exist\n"; + $result = "FAILED"; + }else { + open(S,$log_dir."/".$type.".server".$ID)||die "Error opening server file\n"; + @SF=; + close(S); + } + unless($xc_files{$log_dir."/".$type.".xclient".$ID}) { + print "Warning!!!. Second client result for $log_dir\/$type.xclient$ID doesn't exist\n"; + $result = "FAILED"; + }else { + open(XC,$log_dir."/".$type.".xclient".$ID)||die "Error opening second client file\n"; + @XCF=; + close(XC); + } + $result="FAILED"; + if (($ID eq ".float")||($ID eq ".double")) { + + for($i=0;$i<=$#CF;$i++) { + $XCF[$i] =~ s/\r|\n|^\s*|\s*$//g; + $CF[$i] =~ s/\r|\n|^\s*|\s*$//g; + $SF[$i] =~ s/\r|\n|^\s*|\s*$//g; + + if ((substr($SF[$i],0,3) eq substr($CF[$i],0,3)) + &&(substr($XCF[$i],0,3) eq substr($CF[$i],0,3))) { + $result="PASSED"; + } + } + } else { + for($i=0;$i<=$#CF;$i++) { + $XCF[$i] =~ s/\r|\n|^\s*|\s*$//g; + $CF[$i] =~ s/\r|\n|^\s*|\s*$//g; + $SF[$i] =~ s/\r|\n|^\s*|\s*$//g; + if(($CF[$i] eq $XCF[$i])&&($CF[$i] eq $SF[$i])) { + $result="PASSED"; + } + } + } + $all_log.=""; + if($result=~/FAILED/) { + $all_log.=""; + } else { + $all_log.=""; + } + + if ($ID eq ".boolean"){ $all_log.="";} + if ($ID eq ".char"){ $all_log.="";} + if ($ID eq ".wchar"){ $all_log.="";} + if ($ID eq ".charArray"){ $all_log.="";} + if ($ID eq ".string"){ $all_log.="";} + if ($ID eq ".wstring"){ $all_log.="";} + if ($ID eq ".float"){ $all_log.="";} + if ($ID eq ".double"){ $all_log.="";} + if ($ID eq ".octet"){ $all_log.="";} + if ($ID eq ".short"){ $all_log.="";} + if ($ID eq ".ushort"){ $all_log.="";} + if ($ID eq ".long"){ $all_log.="";} + if ($ID eq ".ulong"){ $all_log.="";} + if ($ID eq ".longlong"){$all_log.="";} + if ($ID eq ".ulonglong"){ $all_log.="";} + if ($ID eq ".stringArray"){ $all_log.="";} + if ($ID eq ".longArray"){ $all_log.="";} + if ($ID eq ".mixed"){ $all_log.="";} + if ($ID eq ".object"){ $all_log.="";} + if ($ID eq ".iid"){ $all_log.="";} + if ($ID eq ".cid"){ $all_log.="";} + + $all_log.="\n"; + } +$all_log.="
IDClient dataServer dataXClient dataResultComments
$type$ID".join("
",@CF)."
".join("
",@SF)."
".join("
",@XCF)."
".$result."".$result."Test for PRBoolTest for charTest for PRUnicharTest for char arrayTest for char*Test for PRUnichar*Test for floatTest for doubleTest for PRUint8Test for PRInt16Test for PRUint16Test for PRInt32Test for PRUint32Test for PRInt64Test for PRUint64Test for char* arrayTest for PRInt32 arrayTest for misc valuesTest for interface*Test for const nsIID&Test for const nsCID&
\n"; +return $all_log; +} diff --git a/mozilla/java/xpcom/test/basic/stress/1/Makefile.in b/mozilla/java/xpcom/test/basic/stress/1/Makefile.in new file mode 100644 index 00000000000..7bd1ac730a3 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/Makefile.in @@ -0,0 +1,34 @@ +#!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= \ + cpp \ + java \ + $(NULL) + +include $(DEPTH)/config/rules.mk + diff --git a/mozilla/java/xpcom/test/basic/stress/1/cpp/Makefile.in b/mozilla/java/xpcom/test/basic/stress/1/cpp/Makefile.in new file mode 100644 index 00000000000..e0560fc1808 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/cpp/Makefile.in @@ -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 = StressComponent2 +LIBRARY_NAME = $(MODULE) +XPIDL_MODULE = $(MODULE) +IS_COMPONENT = 1 + +CPPSRCS = \ + StressComponent2.cpp \ + StressComponent2Factory.cpp \ + $(NULL) +XPIDLSRCS = iStressComponent2.idl + +JAVAI_SRC = iStressComponent2.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) + diff --git a/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2.cpp b/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2.cpp new file mode 100644 index 00000000000..5f4a2666924 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2.cpp @@ -0,0 +1,77 @@ +/* -*- 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 "StressComponent2.h" +#include "iStressComponent1.h" +#include "nsMemory.h" +#include "prthread.h" +#include +#include +#include "nsID.h" + +#define MAX_COUNT 500 +int count = 0; + +StressComponent2Impl::StressComponent2Impl() +{ + NS_INIT_REFCNT(); + printf("StressComponent2Impl::StressComponent2Imp\n"); + Increase(); + printf("PASSED:Stress test 1 passed. Corrtly return from 500 recursive invokations\n"); +} + +StressComponent2Impl::~StressComponent2Impl() +{ +} + +NS_IMPL_ISUPPORTS1(StressComponent2Impl, iStressComponent2); + + +NS_IMETHODIMP StressComponent2Impl::Increase(){ + count++; + if(count >MAX_COUNT) return; + printf("####StressComponent2Impl::Increase %d\n",count); + iStressComponent1* st1; + nsresult rv = nsComponentManager::CreateInstance(STRESSCOMPONENT1_PROGID, + nsnull, + NS_GET_IID(iStressComponent1), + (void**)&st1); + if(NS_FAILED(rv)) { + printf("StressComponent2Impl:Create instance failed from %s!!!",STRESSCOMPONENT1_PROGID); + return rv; + } + rv = st1->ReCall(this); + NS_RELEASE(st1); + return rv; +} + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2.h b/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2.h new file mode 100644 index 00000000000..ad626c0cbbf --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2.h @@ -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 "iStressComponent2.h" + +class StressComponent2Impl : public iStressComponent2 +{ +public: + StressComponent2Impl(); + virtual ~StressComponent2Impl(); + + NS_DECL_ISUPPORTS + + NS_DECL_ISTRESSCOMPONENT2 +}; + + + + diff --git a/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2Factory.cpp b/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2Factory.cpp new file mode 100644 index 00000000000..f189906c5a7 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/cpp/StressComponent2Factory.cpp @@ -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 "StressComponent2.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(StressComponent2Impl) + +static nsModuleComponentInfo components[] = +{ + { "Stress Test Component 2", STRESSCOMPONENT2_CID, STRESSCOMPONENT2_PROGID, StressComponent2ImplConstructor, + NULL /* NULL if you dont need one */, + NULL /* NULL if you dont need one */ + } +}; + +NS_IMPL_NSGETMODULE("StressComponent2Factory", components) + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/stress/1/cpp/iStressComponent2.idl b/mozilla/java/xpcom/test/basic/stress/1/cpp/iStressComponent2.idl new file mode 100644 index 00000000000..9554aaeef7a --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/cpp/iStressComponent2.idl @@ -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(59b94c87-b32d-4881-9b86-f29649af576e)] +interface iStressComponent2 : nsISupports +{ + void increase(); +}; + + +%{ C++ +#define STRESSCOMPONENT2_CID \ +{ /* 59b94c87-b32d-4881-9b86-f29649af576e */ \ + 0x59b94c87, \ + 0xb32d, \ + 0x4881, \ + {0x9b, 0x86, 0xf2, 0x96, 0x49, 0xaf, 0x57, 0x6e} \ +} + +#define STRESSCOMPONENT2_PROGID "@mozilla/blackwood/blackconnect/test/stress/StressComponent2;1" + +%} + + diff --git a/mozilla/java/xpcom/test/basic/stress/1/cpp/iStressComponent2.java b/mozilla/java/xpcom/test/basic/stress/1/cpp/iStressComponent2.java new file mode 100644 index 00000000000..2ea799230d5 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/cpp/iStressComponent2.java @@ -0,0 +1,30 @@ +/* + * ************* DO NOT EDIT THIS FILE *********** + * + * This file was automatically generated from iStressComponent2.idl. + */ + + +package org.mozilla.xpcom; + + +/** + * Interface iStressComponent2 + * + * IID: 0x59b94c87-b32d-4881-9b86-f29649af576e + */ + +public interface iStressComponent2 extends nsISupports +{ + public static final IID IID = + new IID("59b94c87-b32d-4881-9b86-f29649af576e"); + + + /* void increase (); */ + public void increase(); + +} + +/* + * end + */ diff --git a/mozilla/java/xpcom/test/basic/stress/1/java/Makefile.in b/mozilla/java/xpcom/test/basic/stress/1/java/Makefile.in new file mode 100644 index 00000000000..e443ae05437 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/java/Makefile.in @@ -0,0 +1,59 @@ +#!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 + + + +XPIDL_MODULE = StressComponent1 +XPIDLSRCS = iStressComponent1.idl + +JAVA_SRC = \ + StressComponent1.java + +JAVAI_SRC = \ + iStressComponent1.java + +include $(topsrcdir)/config/rules.mk + +export:: + $(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes -d $(DEPTH)/dist/classes $(JAVAI_SRC) + +StressComponent1.jar.comp: manifest StressComponent1.class + $(JDKHOME)/bin/jar cvfm StressComponent1.jar.comp manifest *.class + +StressComponent1.class: + $(JDKHOME)/bin/javac -classpath $(DEPTH)/dist/classes $(JAVA_SRC) + +install-component: StressComponent1.jar.comp StressComponent1.jar.info + cp -f StressComponent1.jar* $(DIST)/bin/components +clobber:: + rm -f *.class *.jar.comp + rm -f $(DIST)/bin/components/StressComponent1.jar.* +clobber_all:: clobber +install:: install-component diff --git a/mozilla/java/xpcom/test/basic/stress/1/java/StressComponent1.jar.info b/mozilla/java/xpcom/test/basic/stress/1/java/StressComponent1.jar.info new file mode 100644 index 00000000000..e48a19b6200 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/java/StressComponent1.jar.info @@ -0,0 +1,2 @@ +a8a301e6-7747-40b2-ab97-bacc083ebbea +@mozilla/blackwood/blackconnect/test/stress/StressComponent1;1 diff --git a/mozilla/java/xpcom/test/basic/stress/1/java/StressComponent1.java b/mozilla/java/xpcom/test/basic/stress/1/java/StressComponent1.java new file mode 100644 index 00000000000..44230634b07 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/java/StressComponent1.java @@ -0,0 +1,68 @@ +/* -*- 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.*; + + +public class StressComponent1 implements iStressComponent1 { + + public StressComponent1() { + System.out.println("DEbug:avm:StressComponent1 constructor"); + } + + public void reCall(iStressComponent2 st2) { + System.out.println("DEbug:avm:StressComponent1 reCall"); + st2.increase(); + } + + public Object queryInterface(IID iid) { + System.out.println("DEbug:avm:StressComponent1::queryInterface iid="+iid); + if ( iid.equals(nsISupports.IID) + || iid.equals(iStressComponent1.IID)) { + return this; + } else { + return null; + } + } + + static { + try { + Class iStressComponent2Class = + Class.forName("org.mozilla.xpcom.iStressComponent2"); + InterfaceRegistry.register(iStressComponent2Class); + } catch (Exception e) { + e.printStackTrace(); + } catch (Error e) { + e.printStackTrace(); + } + } +} + + + + + + + + diff --git a/mozilla/java/xpcom/test/basic/stress/1/java/iStressComponent1.idl b/mozilla/java/xpcom/test/basic/stress/1/java/iStressComponent1.idl new file mode 100644 index 00000000000..113163c3537 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/java/iStressComponent1.idl @@ -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" +#include "iStressComponent2.idl" + + +[scriptable, uuid(dd0ac815-c529-4700-8b51-e1e86a8c95e3)] +interface iStressComponent1 : nsISupports +{ + void reCall(in iStressComponent2 st2); +}; + + +%{ C++ +#define STRESSCOMPONENT1_CID \ +{ /* a8a301e6-7747-40b2-ab97-bacc083ebbea */ \ + 0xa8a301e6, \ + 0x7747, \ + 0x40b2, \ + {0xab, 0x97, 0xba, 0xcc, 0x08, 0x3e, 0xbb, 0xea} \ +} + +#define STRESSCOMPONENT1_PROGID "@mozilla/blackwood/blackconnect/test/stress/StressComponent1;1" + +%} + + diff --git a/mozilla/java/xpcom/test/basic/stress/1/java/iStressComponent1.java b/mozilla/java/xpcom/test/basic/stress/1/java/iStressComponent1.java new file mode 100644 index 00000000000..ab2efe637ce --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/java/iStressComponent1.java @@ -0,0 +1,30 @@ +/* + * ************* DO NOT EDIT THIS FILE *********** + * + * This file was automatically generated from iStressComponent1.idl. + */ + + +package org.mozilla.xpcom; + + +/** + * Interface iStressComponent1 + * + * IID: 0xdd0ac815-c529-4700-8b51-e1e86a8c95e3 + */ + +public interface iStressComponent1 extends nsISupports +{ + public static final IID IID = + new IID("dd0ac815-c529-4700-8b51-e1e86a8c95e3"); + + + /* void reCall (in iStressComponent2 st2); */ + public void reCall(iStressComponent2 st2); + +} + +/* + * end + */ diff --git a/mozilla/java/xpcom/test/basic/stress/1/java/manifest b/mozilla/java/xpcom/test/basic/stress/1/java/manifest new file mode 100644 index 00000000000..01c181bd884 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/java/manifest @@ -0,0 +1 @@ +Component-Class: StressComponent1 diff --git a/mozilla/java/xpcom/test/basic/stress/1/start.html b/mozilla/java/xpcom/test/basic/stress/1/start.html new file mode 100644 index 00000000000..ec26af23d97 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/1/start.html @@ -0,0 +1,10 @@ + + + + + +This file can be used to start BlackConnect stress tests. + diff --git a/mozilla/java/xpcom/test/basic/stress/Makefile.in b/mozilla/java/xpcom/test/basic/stress/Makefile.in new file mode 100644 index 00000000000..f3c1f936166 --- /dev/null +++ b/mozilla/java/xpcom/test/basic/stress/Makefile.in @@ -0,0 +1,33 @@ +#!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= \ + 1 \ + $(NULL) + +include $(DEPTH)/config/rules.mk + diff --git a/mozilla/java/xpcom/test/makefile.win b/mozilla/java/xpcom/test/makefile.win new file mode 100644 index 00000000000..8e279d3de5e --- /dev/null +++ b/mozilla/java/xpcom/test/makefile.win @@ -0,0 +1,32 @@ +#!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= \ + basic \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> + +