예제 #1
0
        public void TestCreateMoreConnectorAndStopAllWorksCorrectly()
        {
            String[] uuids = new String[10];
            for (int i = 0; i < uuids.Length; i++)
            {
                uuid     = factory.CreateDomainService(DomainName);
                uuids[i] = uuid;
                factory.RegisterConnector(uuid, DomainName);
                factory.UnRegisterConnector(uuid);
                factory.DeleteDomainService(uuid);
            }

            factory.StopAllConnections();
            foreach (String tmpuuid in uuids)
            {
                // Test if there is an connector that exists;
                try
                {
                    factory.GetDomainTypConnectorId(tmpuuid);
                    Assert.Fail();
                }
                catch (BridgeException ex)
                {
                    Assert.AreEqual <String>("There is no connector with the connectorId " + tmpuuid, ex.Message);
                }
            }
        }
        public void TestCreateRegisterEventHandlerUnregisterDeleteWorksCorrectlyWithUsernameAndPassword()
        {
            uuid = factory.RegisterConnector(NullString, DomainName);

            IExampleDomainEventsSoapBinding exampleDomain = factory.GetEventhandler <IExampleDomainEventsSoapBinding>(uuid);

            factory.UnRegisterConnector(uuid);
            factory.DeleteDomainService(uuid);
        }
예제 #3
0
        public void TestCreateRegisterCloseRegisterWorksCorrectly()
        {
            ExampleDomainConnector exampleDomain = new ExampleDomainConnector();
            IDomainFactory         factory       = DomainFactoryProvider.GetDomainFactoryInstance(Version, Destination, exampleDomain, exceptionHandler);
            String tmpuuid = null;

            uuid = factory.CreateDomainService(DomainName);
            factory.RegisterConnector(uuid, DomainName);
            factory.StopConnection(uuid);
            tmpuuid = uuid;
            factory.RegisterConnector(uuid, DomainName);
            factory.StopConnection(uuid);
            Assert.AreEqual <String>(tmpuuid, uuid);
        }
 public void TestRegisterConnectorWithoutCreateAndWithWrongUsernameAndPassword()
 {
     try
     {
         uuid = factory.RegisterConnector(uuid, DomainName);
         Assert.Fail();
     }
     catch (BridgeException)
     {
     }
 }
 /// <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.");
 }