Exemple #1
0
        /** <inheritdoc /> */
        public void Start(IPluginContext <TestIgnitePluginConfiguration> context)
        {
            context.RegisterExceptionMapping("org.apache.ignite.platform.plugin.PlatformTestPluginException",
                                             (className, message, inner, ignite) =>
                                             new TestIgnitePluginException(className, message, ignite, inner));

            context.RegisterCallback(1, (input, output) =>
            {
                CallbackResult = input.ReadString();
                output.WriteString(CallbackResult.ToUpper());

                return(CallbackResult.Length);
            });

            var ex = Assert.Throws <IgniteException>(() => context.RegisterCallback(1, (input, output) => 0));

            Assert.AreEqual("Plugin callback with id 1 is already registered", ex.Message);

            Context = context;

            EnsureIgniteWorks(false);
        }