⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_db.sh

📁 发布/订阅系统中间件
💻 SH
📖 第 1 页 / 共 2 页
字号:
#!/bin/sh##  This file is part of Siena, a wide-area event notification system.#  See http://www.cs.colorado.edu/serl/dot/siena.html##  Author: Antonio Carzaniga <carzanig@cs.colorado.edu>#  See the file AUTHORS for full details. ##  Copyright (C) 1998-1999 University of Colorado##  This program is free software; you can redistribute it and/or#  modify it under the terms of the GNU General Public License#  as published by the Free Software Foundation; either version 2#  of the License, or (at your option) any later version.##  This program is distributed in the hope that it will be useful,#  but WITHOUT ANY WARRANTY; without even the implied warranty of#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the#  GNU General Public License for more details.##  You should have received a copy of the GNU General Public License#  along with this program; if not, write to the Free Software#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,#  USA, or send email to serl@cs.colorado.edu.### $Id: test_db.sh,v 1.1 2002/06/10 20:19:15 carzanig Exp $#. ./config. $srcdir/base.sh#pause=1#cat<<EOFFeature:		-nets- multiple overlapping subscriptionsTopology:		3 servers, multiple objects, multiple partiesInterface functions:	subscribe, unsubscribe, publishNotification classes:	multiple attributesAttribute types:	string, integerFilter classes:		multiple attribute, multiple constraintFilter operators:	> = anyEOF## server topology setup#opentest 3 $*## -------------------- TEST BEGINS HERE --------------------## @0 1 <-- {x any}#increfsend <<EOFsenp{ to="$siena0" method="SUB" ref=$ref subscriber="$client/1"}filter{x any}EOF## @0 2 <-- {y any}# increfsend <<EOFsenp{ to="$siena0" method="SUB" ref=$ref subscriber="$client/2"}filter{y any}EOF## @1 3 <-- {z any}#increfsend <<EOFsenp{ to="$siena1" method="SUB" ref=$ref subscriber="$client/3"}filter{z any}EOF## @1 {x = 1 y = 1} --> 1, 2, 3#increfsend <<EOFsenp{ to="$siena1" method="PUB" ref=$ref}event{ x=1 y=1}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ x=1 y=1 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ x=1 y=1 }EOF## @2 {x = 1 z = 3} --> 1, 3#increfsend <<EOFsenp{ to="$siena2" method="PUB" ref=$ref}event{x = 1 z = 3}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ x=1 z=3 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/3" }event{ x=1 z=3 }EOF### @0 4 <-- {x > 0 y > 0}#increfsend <<EOFsenp{ to="$siena0" method="SUB" ref=$ref subscriber="$client/4"}filter{x > 0 y > 0}EOF## @0 5 <-- {y > 0 z > 0}#increfsend <<EOFsenp{ to="$siena0" method="SUB" ref=$ref subscriber="$client/5"}filter{y > 0 z > 0}EOF## @2 6 <-- {x > 0 z > 0}#increfsend <<EOFsenp{ to="$siena2" method="SUB" ref=$ref subscriber="$client/6"}filter{x > 0 z > 0}EOF## @1 {x = 1 y = 2} --> 1, 2, 4#increfsend <<EOFsenp{ to="$siena1" method="PUB" ref=$ref}event{x = 1 y = 2}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ x=1 y=2 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ x=1 y=2 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/4" }event{ x=1 y=2 }EOF## @2 {x = 1 y = 3} --> 1, 2, 4#increfsend <<EOFsenp{ to="$siena2" method="PUB" ref=$ref}event{x = 1 y = 3}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ x=1 y=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ x=1 y=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/4" }event{ x=1 y=3 }EOF##increfsend <<EOFsenp{ to="$siena0" method="PUB" ref=$ref}event{z = 3}EOFexpect <<EOFsenp{ from="$siena1" method="PUB" ref=$ref to="$client/3" }event{ z=3 }EOF## @1 7 <-- {x > 0 y > 0 z > 0}#increfsend <<EOFsenp{ to="$siena1" method="SUB" ref=$ref subscriber="$client/7"}filter{x > 0 y > 0 z > 0}EOF## @2 {x = 1 y = 2 z = 3} --> 1, 2, 3, 4, 5, 6, 7#increfsend <<EOFsenp{ to="$siena2" method="PUB" ref=$ref}event{x = 1 y = 2 z = 3}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ x=1 y=2 z=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ x=1 y=2 z=3 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/3" }event{ x=1 y=2 z=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/4" }event{ x=1 y=2 z=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/5" }event{ x=1 y=2 z=3 }senp{ from="$siena2" method="PUB" ref=$ref to="$client/6" }event{ x=1 y=2 z=3 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/7" }event{ x=1 y=2 z=3 }EOF## @0 5 -X- {z > 0} (in fact {y > 0 z > 0}) #increfsend <<EOFsenp{ to="$siena0" method="UNS" ref=$ref subscriber="$client/5"}filter{z > 0}EOF####sleep 4shutdownservers forcesleep 10$TESTHOME/topology3.sh. $topology_infosleep 5###### @1 {y = 2 z = 3} --> 2, 3#increfsend <<EOFsenp{ to="$siena1" method="PUB" ref=$ref}event{y = 2 z = 3}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ y=2 z=3 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/3" }event{ y=2 z=3 }EOF## @0 8 <-- {y > 0 z > 0}#increfsend <<EOFsenp{ to="$siena0" method="SUB" ref=$ref subscriber="$client/8"}filter{y>0 z>0}EOF## @0 {y = 2 z = 3} --> 2, 3, 8#increfsend <<EOFsenp{ to="$siena0" method="PUB" ref=$ref}event{y = 2 z = 3}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ y=2 z=3 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/3" }event{ y=2 z=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/8" }event{ y=2 z=3 }EOF### @0 9 <-- {x > 0 y > 0}#increfsend <<EOFsenp{ to="$siena0" method="SUB" ref=$ref subscriber="$client/9"}filter{y>0 x>0}EOF## @2 {y = 2 z = 3} --> 1, 2, 4, 9#increfsend <<EOFsenp{ to="$siena2" method="PUB" ref=$ref}event{x = 2 y = 3}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ x=2 y=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ x=2 y=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/4" }event{ x=2 y=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/9" }event{ x=2 y=3 }EOF## 4 -X- {x any y any} (in fact x>0 y>0)#increfsend <<EOFsenp{ to="$siena0" method="UNS" ref=$ref subscriber="$client/4"}filter{y any x any}EOFsleep 2## @1 {x = 2 y = 3} --> 1, 2, 9#increfsend <<EOFsenp{ to="$siena1" method="PUB" ref=$ref}event{x = 2 y = 3}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ x=2 y=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ x=2 y=3 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/9" }event{ x=2 y=3 }EOF## @0 10 <-- {x>0 y>0 z>0 a="A"}#increfsend <<EOFsenp{ to="$siena0" method="SUB" ref=$ref subscriber="$client/10"}filter{x>0 y>0 z>0 a="A"}EOF## @0 11 <-- {x>0 y>0 z>0 a="B"}#increfsend <<EOFsenp{ to="$siena0" method="SUB" ref=$ref subscriber="$client/11"}filter{x>0 y>0 z>0 a="B"}EOF## @0 {x=2 y=3 z=4 a="A"} --> 1, 2, 3, 6, 7, 8, 9, 10#increfsend <<EOFsenp{ to="$siena0" method="PUB" ref=$ref}event{x=2 y=3 z=4 a="A"}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/10" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/3" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena2" method="PUB" ref=$ref to="$client/6" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/7" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/8" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/9" }event{ a="A" x=2 y=3 z=4 }EOF## @2 {x=2 y=3 z=4 a="B"} --> 1, 2, 3, 6, 7, 8, 9, 11#increfsend <<EOFsenp{ to="$siena2" method="PUB" ref=$ref}event{x=2 y=3 z=4 a="B"}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ a="B" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/11" }event{ a="B" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ a="B" x=2 y=3 z=4 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/3" }event{ a="B" x=2 y=3 z=4 }senp{ from="$siena2" method="PUB" ref=$ref to="$client/6" }event{ a="B" x=2 y=3 z=4 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/7" }event{ a="B" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/8" }event{ a="B" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/9" }event{ a="B" x=2 y=3 z=4 }EOF## @1 7 -X- {x>0 y>0 z>0} (in fact exactly x>0 y>0 z>0)#increfsend <<EOFsenp{ to="$siena1" method="UNS" ref=$ref subscriber="$client/7"}filter{x>0 y>0 z>0}EOF####sleep 5shutdownservers forcesleep 10$TESTHOME/topology3.sh. $topology_infosleep 5###### @2 {x=2 y=3 z=4 a="A"} --> 1, 2, 3, 6, 8, 9, 10#increfsend <<EOFsenp{ to="$siena2" method="PUB" ref=$ref}event{x=2 y=3 z=4 a="A"}EOFexpect <<EOFsenp{ from="$siena0" method="PUB" ref=$ref to="$client/1" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/10" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/2" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena1" method="PUB" ref=$ref to="$client/3" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena2" method="PUB" ref=$ref to="$client/6" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/8" }event{ a="A" x=2 y=3 z=4 }senp{ from="$siena0" method="PUB" ref=$ref to="$client/9" }event{ a="A" x=2 y=3 z=4 }EOF## @1 {x=2 y=3 z=4} --> 1, 2, 3, 6, 8, 9, 10#increfsend <<EOFsenp{ to="$siena1" method="PUB" ref=$ref}event{x=2 y=3 z=4}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -