public void buildTest1() { ComponentId componetId = new ComponentId("Test1", 1, 0, 0, ".Net FrameWork 3.5"); ComponentContext expected = new DefaultComponentContext(componetId); String name = "IComponent_1"; String interfaceName = "IDL:scs/core/IComponent:1.0"; MarshalByRefObject servant = new IComponentServant(expected); expected.AddFacet(name, interfaceName, servant); name = "IComponent_2"; interfaceName = "IDL:scs/core/IComponent:1.0"; servant = new IComponentServant(expected); expected.AddFacet(name, interfaceName, servant); name = "IMetaInterface_3"; interfaceName = "IDL:scs/core/IMetaInterface:1.0"; servant = new IMetaInterfaceServant(expected); expected.AddFacet(name, interfaceName, servant); String componentModel = Resources.Component1; TextReader file = new StringReader(componentModel); XmlTextReader componentInformation = new XmlTextReader(file); XmlComponentBuilder target = new XmlComponentBuilder(componentInformation); ComponentContext actual = target.build(); Assert.IsTrue(expected.Equals(actual)); }
public void getFacetByNameTest3() { IComponentServant target = new IComponentServant(context); MarshalByRefObject actual = target.getFacetByName("InvalidFacetName"); Assert.IsNull(actual); }
public void AddFacetTestInvalid1() { string interfaceName = Repository.GetRepositoryID(typeof(IComponent)); MarshalByRefObject servant = new IComponentServant(context); context.AddFacet(String.Empty, interfaceName, servant); }
public void FacetConstructorTest5() { ComponentId componentId = new ComponentId("Component1", 1, 0, 0, "none"); ComponentContext context = new DefaultComponentContext(componentId); string interfaceName = typeof(IMetaInterface).Name; MarshalByRefObject servant = new IComponentServant(context); Facet target = new Facet(facetName, interfaceName, servant); }
public void getComponentIdTest() { ComponentId expected = new ComponentId("Name", 10, 10, 10, "none"); ComponentContext context = new DefaultComponentContext(expected); IComponentServant target = new IComponentServant(context); ComponentId actual = target.getComponentId(); Assert.AreEqual(expected.name, actual.name); }
public void getFacetByNameTest1() { IComponentServant target = new IComponentServant(context); string facetName = typeof(IReceptacles).Name; Facet facet = context.GetFacetByName(facetName); MarshalByRefObject expected = facet.Reference; MarshalByRefObject actual = target.getFacetByName(facetName); Assert.AreEqual(expected, actual); }
public void connectTest3() { IReceptaclesServant target = new IReceptaclesServant(context); string name = "SimpleReceptacle"; string interfaceName = Repository.GetRepositoryID(typeof(IMetaInterface)); context.AddReceptacle(name, interfaceName, false); MarshalByRefObject servant = new IComponentServant(context); target.connect(name, servant); }
public void GetFacetByNameTest1() { string name = typeof(IComponent).Name; string interfaceName = Repository.GetRepositoryID(typeof(IComponent)); MarshalByRefObject servant = new IComponentServant(context); Facet expected = new Facet(name, interfaceName, servant); context.UpdateFacet(name, servant); Facet actual = context.GetFacetByName(name); Assert.AreEqual(expected, actual); }
public static void BeforeClass(TestContext testContext) { name = "Faceta"; interfaceName = Repository.GetRepositoryID(typeof(IComponent)); isMultiple = false; ComponentId componentId = new ComponentId("Component1", 1, 0, 0, "none"); ComponentContext context = new DefaultComponentContext(componentId); connections = new List <MarshalByRefObject>(); for (int i = 0; i < 5; i++) { MarshalByRefObject connection = new IComponentServant(context); connections.Add(connection); } }
/// <summary> /// Adiciona as facetas básicas à lista de Facetas criadas pelo usuário. /// </summary> private void AddBasicFacets() { Type icomponentType = typeof(IComponent); string icomponentName = icomponentType.Name; string icomponentInterfaceName = IiopNetUtil.GetRepositoryId(icomponentType); if (!facets.ContainsKey(icomponentName)) { IComponent icomponent = new IComponentServant(this); MarshalByRefObject icomponentServant = icomponent as MarshalByRefObject; AddFacet(icomponentName, icomponentInterfaceName, icomponentServant); logger.DebugFormat("Faceta '{0}' adicionada com sucesso", icomponentName); } Type ireceptacleType = typeof(IReceptacles); string ireceptacleName = ireceptacleType.Name; string ireceptacleInterfaceName = IiopNetUtil.GetRepositoryId(ireceptacleType); if (!facets.ContainsKey(ireceptacleName)) { IReceptacles receptacle = new IReceptaclesServant(this); MarshalByRefObject receptacleServant = receptacle as MarshalByRefObject; AddFacet(ireceptacleName, ireceptacleInterfaceName, receptacleServant); logger.DebugFormat("Faceta '{0}' adicionada com sucesso", ireceptacleName); } Type imetaInterfaceType = typeof(IMetaInterface); string imetaInterfaceName = imetaInterfaceType.Name; string imetaInterfaceInterfaceName = IiopNetUtil.GetRepositoryId(imetaInterfaceType); if (!facets.ContainsKey(imetaInterfaceName)) { IMetaInterface metaInterface = new IMetaInterfaceServant(this); MarshalByRefObject metaInterfaceServant = metaInterface as MarshalByRefObject; AddFacet(imetaInterfaceName, imetaInterfaceInterfaceName, metaInterfaceServant); logger.DebugFormat("Faceta '{0}' adicionada com sucesso", imetaInterfaceName); } }
public void IComponentServantConstructorTest1() { IComponentServant target = new IComponentServant(context); Assert.IsNotNull(target); }
public void AddFacetTestInvalid3() { MarshalByRefObject servant = new IComponentServant(context); context.AddFacet("facetName", "InvalidName", servant); }
public void AddFacetTestInvalid2() { MarshalByRefObject servant = new IComponentServant(context); context.AddFacet("facetName", String.Empty, servant); }
public void UpdateFacetNull1() { MarshalByRefObject servant = new IComponentServant(context); context.UpdateFacet(null, servant); }
public void getFacetTest2() { IComponentServant target = new IComponentServant(context); MarshalByRefObject actual = target.getFacet("IDL:invalid/interface:1.0"); }
public void UpdateFacetInvalid1() { MarshalByRefObject servant = new IComponentServant(context); context.UpdateFacet(String.Empty, servant); }
public void AddFacetTestNull2() { MarshalByRefObject servant = new IComponentServant(context); context.AddFacet("facetName", null, servant); }
public void IComponentServantConstructorTest2() { IComponentServant target = new IComponentServant(null); }