예제 #1
0
    public static int Main(string[] args)
    {
        int status = 0;

        try
        {
            Console.Out.Write("testing preloading assemblies... ");
            Console.Out.Flush();
            User.UserInfo          info = new User.UserInfo();
            Ice.InitializationData id   = new Ice.InitializationData();
            id.properties = Ice.Util.createProperties();
            id.properties.setProperty("Ice.PreloadAssemblies", "0");
            Ice.Communicator ic = Ice.Util.initialize(id);
            test(AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(
                     (e) => e.CodeBase.EndsWith("msbuild/client/Core.DLL")) == null);
            ic.destroy();
            id.properties.setProperty("Ice.PreloadAssemblies", "1");
            ic = Ice.Util.initialize(id);
            test(AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((e) =>
                                                                        e.CodeBase.EndsWith("msbuild/client/Core.DLL")) != null);
            Console.Out.WriteLine("ok");
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }
        return(status);
    }
예제 #2
0
파일: Client.cs 프로젝트: nail-lian/ice
    public override void Run(string[] args)
    {
        Console.Out.Write("testing preloading assemblies... ");
        Console.Out.Flush();
        var info = new User.UserInfo();

        Dictionary <string, string> properties = CreateTestProperties(ref args);

        properties["Ice.PreloadAssemblies"] = "0";

        string assembly =
            $"{Path.GetFileName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase))}/core.dll";

        using (Communicator communicator = Initialize(properties))
        {
            Assert(AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(
                       e => e.CodeBase !.EndsWith(assembly, StringComparison.InvariantCultureIgnoreCase)) == null);
        }
        properties["Ice.PreloadAssemblies"] = "1";
        using (Communicator communicator = Initialize(properties))
        {
            Assert(AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(
                       e => e.CodeBase !.EndsWith(assembly, StringComparison.InvariantCultureIgnoreCase)) != null);
        }

        Console.Out.WriteLine("ok");
    }
예제 #3
0
파일: Client.cs 프로젝트: xingx001/ice
    public override void run(string[] args)
    {
        Console.Out.Write("testing preloading assemblies... ");
        Console.Out.Flush();
        User.UserInfo info = new User.UserInfo();

        Ice.Properties properties = createTestProperties(ref args);
        properties.setProperty("Ice.PreloadAssemblies", "0");

        string assembly =
            String.Format("{0}/core.dll",
                          Path.GetFileName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)));

        using (var communicator = initialize(properties))
        {
            test(AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((e) =>
            {
                return(e.CodeBase.EndsWith(assembly, StringComparison.InvariantCultureIgnoreCase));
            }) == null);
        }
        properties.setProperty("Ice.PreloadAssemblies", "1");
        using (var communicator = initialize(properties))
        {
            test(AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((e) =>
            {
                return(e.CodeBase.EndsWith(assembly, StringComparison.InvariantCultureIgnoreCase));
            }) != null);
        }

        Console.Out.WriteLine("ok");
    }
예제 #4
0
파일: Client.cs 프로젝트: zhj149/ice
    public static int Main(string[] args)
    {
        int status = 0;

        try
        {
            Console.Out.Write("testing preloading assemblies... ");
            Console.Out.Flush();
            User.UserInfo          info = new User.UserInfo();
            Ice.InitializationData id   = new Ice.InitializationData();
            id.properties = Ice.Util.createProperties();
            id.properties.setProperty("Ice.PreloadAssemblies", "0");

            string assembly =
                String.Format("{0}/core.dll",
                              Path.GetFileName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)));
            Ice.Communicator ic = Ice.Util.initialize(id);
            test(AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((e) =>
            {
                return(e.CodeBase.EndsWith(assembly, StringComparison.InvariantCultureIgnoreCase));
            }) == null);
            ic.destroy();
            id.properties.setProperty("Ice.PreloadAssemblies", "1");
            ic = Ice.Util.initialize(id);
            test(AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((e) =>
            {
                return(e.CodeBase.EndsWith(assembly, StringComparison.InvariantCultureIgnoreCase));
            }) != null);
            Console.Out.WriteLine("ok");
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }
        return(status);
    }