コード例 #1
0
        public void TestCreateDeleteConnectorAndNoRegistrationWorksCorrectlyWithUsernameAndPassword()
        {
            uuid = factory.CreateDomainService(DomainName);

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

            factory.DeleteDomainService(uuid);
        }
コード例 #2
0
        public void TestRetryExceptionHandlerRetiesTheMethod()
        {
            IDomainFactory factory = DomainFactoryProvider.GetDomainFactoryInstance(Version, "FooBar", new ExampleDomainConnector(), new RetryDefaultExceptionHandler());

            // Visual Studio unit tests does not work, when a threads are used.
            factory.StopAllConnections();
            factory.CreateDomainService(DomainName);
        }
 public void TestCreateConnectorWithWrongUsernameAndPassword()
 {
     try
     {
         uuid = factory.CreateDomainService(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.");
 }
コード例 #5
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);
        }
コード例 #6
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.");
 }
コード例 #8
0
        public void TestForwardExceptionHandlerForwardsTheException()
        {
            IDomainFactory factory = DomainFactoryProvider.GetDomainFactoryInstance(Version, NullString, new ExampleDomainConnector(), new ForwardDefaultExceptionHandler());

            factory.CreateDomainService(DomainName);
        }