Пример #1
0
 private static IPort Create_qualified_port(string flowname, string portFullname)
 {
     var port = new Port(portFullname);
     if (Is_root_flowname(flowname)) return port;
     return port.IsRooted ? Port.Uproot(port)
                             : Port.Build(flowname, port.OperationName, port.InstanceNumber, port.Name);
 }
 public static IPort RemotePortnameToInputPort(this string portname, string path, string standInOperationName)
 {
     var remotePort = new Port(portname);
     return new Port(string.Format("{0}{1}#{2}{3}", path == "" ? "" : path + "/",
                                                    standInOperationName,
                                                    remotePort.OperationName,
                                                    remotePort.Name == "" ? "" : "."+remotePort.Name));
 }
Пример #3
0
        public void Check_for_operation_port()
        {
            var sut = new Port("opname.portname");
            Assert.IsTrue(sut.HasOperation);

            sut = new Port(".portname");
            Assert.IsFalse(sut.HasOperation);
        }
Пример #4
0
            void ProcessOnHost(HostInput input, Action<HostOutput> sendOutput)
            {
                Assert.AreEqual("localhost:1234", input.StandInEndpointAddress);

                var inputPort = new Port(input.Portname); // remoteOp.inputPort
                var outputPortname = string.Format(inputPort.OperationName + "." + inputPort.Name + "-out"); // remoteOp.outputPort
                var output = new HostOutput { CorrelationId = input.CorrelationId, Data = ("<" + input.Data.Deserialize() + ">").Serialize(), Portname = outputPortname};
                sendOutput(output);
            }
Пример #5
0
        public void All_properties()
        {
            var sut = new Port("a/b/o#42.p");
            Assert.AreEqual("a/b/o#42.p", sut.Fullname);
            Assert.AreEqual("o#42", sut.InstanceName);
            Assert.AreEqual("42", sut.InstanceNumber);
            Assert.AreEqual("o", sut.OperationName);
            Assert.AreEqual("p", sut.Name);
            Assert.AreEqual("a/b", sut.Path);

            sut = new Port("a/b/o.p");
            Assert.AreEqual("o", sut.InstanceName);
            Assert.AreEqual("", sut.InstanceNumber);
            Assert.AreEqual("o", sut.OperationName);
        }
 // stand-in portname: remoteOp.someport
 // input portname: .someport@remoteOp
 public static string StandInPortnameToInputPortname(this string standInPortname)
 {
     var port = new Port(standInPortname);
     return string.Format(".{0}@{1}", port.Name, port.OperationName);
 }
Пример #7
0
 public void Backslash_gets_replaced_with_fwdslash()
 {
     var sut = new Port("a\\b\\o.p");
     Assert.AreEqual("a/b/o.p", sut.Fullname);
 }