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); }
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."); }
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 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); } }
public void TestForwardExceptionHandlerForwardsTheException() { IDomainFactory factory = DomainFactoryProvider.GetDomainFactoryInstance(Version, NullString, new ExampleDomainConnector(), new ForwardDefaultExceptionHandler()); factory.CreateDomainService(DomainName); }