summaryrefslogtreecommitdiff
path: root/matlab/test/Ice/operations/Client.m
blob: 4d898e22ef2a478b2d8faa6f1e96b4750f52195c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
%{
**********************************************************************

Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.

This copy of Ice is licensed to you under the terms described in the
ICE_LICENSE file included in this distribution.

**********************************************************************
%}

classdef Client < Application
    methods
        function r = run(obj, args)
            myClass = AllTests.allTests(obj);

            fprintf('testing server shutdown... ');
            myClass.shutdown();
            try
                myClass.ice_timeout(100).ice_ping(); % Use timeout to speed up testing on Windows
                throw(MException());
            catch ex
                if isa(ex, 'Ice.LocalException')
                    fprintf('ok\n');
                else
                    rethrow(ex);
                end
            end

            r = 0;
        end
    end
    methods(Access=protected)
        function [r, remArgs] = getInitData(obj, args)
            [initData, remArgs] = getInitData@Application(obj, args);
            initData.properties_.setProperty('Ice.Package.Test', 'test.Ice.operations');
            initData.properties_.setProperty('Ice.ThreadPool.Client.Size', '2');
            initData.properties_.setProperty('Ice.ThreadPool.Client.SizeWarn', '0');
            initData.properties_.setProperty('Ice.BatchAutoFlushSize', '100');
            r = initData;
        end
    end
    methods(Static)
        function start(args)
            addpath('generated');
            if ~libisloaded('icematlab')
                loadlibrary('icematlab')
            end
            c = Client();
            status = c.main('Client', args);
        end
    end
end