Ejemplo n.º 1
0
 public void TestConnectToXlinkWithAConnectorThatIsNotregisteredConnectorAndAnalyseTheException()
 {
     uuid = factory.CreateDomainService("example");
     try
     {
         factory.ConnectToXLink(uuid, "localhost", "example", null);
     }
     catch (BridgeException ex)
     {
         Assert.AreEqual <String>(ex.Message, "The connecotr with id " + uuid + " has no instance");
     }
     finally
     {
         factory.DeleteDomainService(uuid);
     }
 }
 /// <summary>
 /// Creates/Registers the connector at the OpenEngSB and registers the connector to XLink
 /// </summary>
 public void connectToOpenEngSbWithXLink()
 {
     outputLine("Trying to connect to OpenEngSB and XLink...");
     ooSourceConnector = new OOSourceCodeConnector();
     factory           = DomainFactoryProvider.GetDomainFactoryInstance("3.0.0", xlinkServerURL, ooSourceConnector, new ForwardDefaultExceptionHandler());
     connectorUUID     = factory.CreateDomainService(domainId);
     factory.RegisterConnector(connectorUUID, domainId);
     blueprint = factory.ConnectToXLink(connectorUUID, hostIp, programname, initModelViewRelation());
     setCurrentlyInstalledTools(blueprint.registeredTools);
     connected = true;
     outputLine("Connecting done.");
 }
        public void TestCreateRegisterConnecttoxlinkDisconnectfromXlinkUnregisterDeleteWithoutCreateMethodConnectorWorksCorrectly()
        {
            uuid = factory.RegisterConnector(null, DomainName);

            Assert.IsTrue(factory.Registered(uuid));
            Assert.IsFalse(factory.Registered("WRONG ID"));
            Assert.IsTrue(factory.GetDomainTypConnectorId(uuid).Equals(DomainName + "+external-connector-proxy+" + uuid));

            XLinkUrlBlueprint template = factory.ConnectToXLink(uuid, "localhost", DomainName, InitModelViewRelation());

            factory.DisconnectFromXLink(uuid, "localhost");
            factory.UnRegisterConnector(uuid);

            Assert.IsFalse(factory.Registered(uuid));

            factory.DeleteDomainService(uuid);

            Assert.IsFalse(factory.Registered(uuid));
        }
 /// <summary>
 /// Creates/Registers the connector at the OpenEngSB and registers the connector to XLink
 /// </summary>
 public void connectToOpenEngSbWithXLink()
 {
     outputLine("Trying to connect to OpenEngSB and XLink...");
     ooSourceConnector = new OOSourceCodeConnector();
     factory = DomainFactoryProvider.GetDomainFactoryInstance("3.0.0", xlinkServerURL, ooSourceConnector, new ForwardDefaultExceptionHandler());
     connectorUUID = factory.CreateDomainService(domainId);
     factory.RegisterConnector(connectorUUID, domainId);
     blueprint = factory.ConnectToXLink(connectorUUID, hostIp, programname, initModelViewRelation());
     setCurrentlyInstalledTools(blueprint.registeredTools);
     connected = true;
     outputLine("Connecting done.");
 }