Package org.eclipse.rmf.reqif10

Examples of org.eclipse.rmf.reqif10.AttributeValue


  }

  private ReqIF buildTestReqif() throws IOException {
    ReqIF10Factory rf = ReqIF10Factory.eINSTANCE;
    ConfigurationFactory cf = ConfigurationFactory.eINSTANCE;
    ReqIF reqif = rf.createReqIF();
    ReqIFContent content = rf.createReqIFContent();
    reqif.setCoreContent(content);
   
    // Build the Datatypes
    DatatypeDefinitionString t_string = rf.createDatatypeDefinitionString();
    content.getDatatypes().add(t_string);
   
View Full Code Here


  /**
   * The external element (to be traced from/to) must be persisted.  For simplicity, we use
   * a ReqIF model.
   */
  private EObject buildTestExternal() throws IOException {
    ReqIF reqif  = ReqIF10Factory.eINSTANCE.createReqIF();
    ReqIFHeader header= ReqIF10Factory.eINSTANCE.createReqIFHeader();
    header.setTitle("HeaderTitle");
    reqif.setTheHeader(header);
    external = header;
   
    File file = File.createTempFile("tracing-test-", ".reqif");
    file.deleteOnExit();
    URI uri = URI.createFileURI(file.getAbsolutePath());
View Full Code Here

   * Tries to find the proxy with the given URI.  Returns null if not found.
   */
  SpecObject findProxyFor(EObject element) {
    TracingConfiguration config = getTracingConfig();
    String uri = EcoreUtil.getURI(element).toString();
    ReqIF reqif = ReqIF10Util.getReqIF(config);
    AttributeDefinitionString ad = config.getProxyAttribute();

    // Iterate SpecObjects and search for existing proxy element
    for (SpecObject specObject : reqif.getCoreContent().getSpecObjects()) {
      AttributeValue value = ReqIF10Util
          .getAttributeValue(specObject, ad);
      if (value instanceof AttributeValueString) {
        String tmpUrl = TracingConfigurationItemProvider
            .getProxyUrlFromValue(((AttributeValueString) value)
View Full Code Here

    }
   
  }

  private ReqIF buildTestReqif() throws IOException {
    ReqIF10Factory rf = ReqIF10Factory.eINSTANCE;
    ConfigurationFactory cf = ConfigurationFactory.eINSTANCE;
    ReqIF reqif = rf.createReqIF();
    ReqIFContent content = rf.createReqIFContent();
    reqif.setCoreContent(content);
   
    // Build the Datatypes
    DatatypeDefinitionString t_string = rf.createDatatypeDefinitionString();
    content.getDatatypes().add(t_string);
   
    // Build SpecObject Type for requirements.
    SpecObjectType requirementType = rf.createSpecObjectType();
    AttributeDefinitionString ad_requirement = rf.createAttributeDefinitionString();
    ad_requirement.setType(t_string);
    requirementType.getSpecAttributes().add(ad_requirement);
    content.getSpecTypes().add(requirementType);
   
    // Build SpecObject Type for proxy.
    SpecObjectType proxyType = rf.createSpecObjectType();
    AttributeDefinitionString ad_proxy = rf.createAttributeDefinitionString();
    ad_proxy.setType(t_string);
    proxyType.getSpecAttributes().add(ad_proxy);
    content.getSpecTypes().add(proxyType);
   
    // Build SpecRelationType for linking
    SpecRelationType linkType = rf.createSpecRelationType();
    content.getSpecTypes().add(linkType);

    // Add the Config Element
    ProrToolExtension toolExtension = cf.createProrToolExtension();
    ReqIFToolExtensionUtil.addToolExtension(reqif, toolExtension);
    ProrPresentationConfigurations presentationConfigs = cf.createProrPresentationConfigurations();
    toolExtension.setPresentationConfigurations(presentationConfigs);
    config = TracingFactory.eINSTANCE.createTracingConfiguration();
   
    // Configure the Config Element
    presentationConfigs.getPresentationConfigurations().add(config);
    config.setDatatype(t_string);
    config.setLinkType(linkType);
    config.setProxyAttribute(ad_proxy);
    config.setProxyType(proxyType);
   
    requirement = rf.createSpecObject();
    requirement.setType(requirementType);
    content.getSpecObjects().add(requirement);
    return reqif;
  }
View Full Code Here

    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Obtain other dependent packages
    ConfigurationPackage theConfigurationPackage = (ConfigurationPackage)EPackage.Registry.INSTANCE.getEPackage(ConfigurationPackage.eNS_URI);
    ReqIF10Package theReqIF10Package = (ReqIF10Package)EPackage.Registry.INSTANCE.getEPackage(ReqIF10Package.eNS_URI);
    XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    tracingConfigurationEClass.getESuperTypes().add(theConfigurationPackage.getProrPresentationConfiguration());

    // Initialize classes and features; add operations and parameters
    initEClass(tracingConfigurationEClass, TracingConfiguration.class, "TracingConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getTracingConfiguration_ProxyType(), theReqIF10Package.getSpecObjectType(), null, "proxyType", null, 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getTracingConfiguration_ProxyAttribute(), theReqIF10Package.getAttributeDefinitionString(), null, "proxyAttribute", null, 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTracingConfiguration_AttributeNames(), theXMLTypePackage.getString(), "attributeNames", null, 0, -1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTracingConfiguration_LinkFromTarget(), ecorePackage.getEBoolean(), "linkFromTarget", "true", 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEReference(getTracingConfiguration_LinkType(), theReqIF10Package.getSpecRelationType(), null, "linkType", null, 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
    initEAttribute(getTracingConfiguration_PackagePrefix(), theXMLTypePackage.getString(), "packagePrefix", "org.eclipse.uml", 0, 1, TracingConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

    // Create resource
    createResource(eNS_URI);
  }
View Full Code Here

  private ReqIF buildTestReqif() throws IOException {
    ReqIF10Factory rf = ReqIF10Factory.eINSTANCE;
    ConfigurationFactory cf = ConfigurationFactory.eINSTANCE;
    ReqIF reqif = rf.createReqIF();
    ReqIFContent content = rf.createReqIFContent();
    reqif.setCoreContent(content);
   
    // Build the Datatypes
    DatatypeDefinitionString t_string = rf.createDatatypeDefinitionString();
    content.getDatatypes().add(t_string);
   
    // Build SpecObject Type for requirements.
    SpecObjectType requirementType = rf.createSpecObjectType();
    AttributeDefinitionString ad_requirement = rf.createAttributeDefinitionString();
    ad_requirement.setType(t_string);
    requirementType.getSpecAttributes().add(ad_requirement);
    content.getSpecTypes().add(requirementType);
   
    // Build SpecObject Type for proxy.
    SpecObjectType proxyType = rf.createSpecObjectType();
    AttributeDefinitionString ad_proxy = rf.createAttributeDefinitionString();
    ad_proxy.setType(t_string);
    proxyType.getSpecAttributes().add(ad_proxy);
    content.getSpecTypes().add(proxyType);
   
    // Build SpecRelationType for linking
    SpecRelationType linkType = rf.createSpecRelationType();
    content.getSpecTypes().add(linkType);

    // Add the Config Element
    ProrToolExtension toolExtension = cf.createProrToolExtension();
    ReqIFToolExtensionUtil.addToolExtension(reqif, toolExtension);
    ProrPresentationConfigurations presentationConfigs = cf.createProrPresentationConfigurations();
    toolExtension.setPresentationConfigurations(presentationConfigs);
    config = TracingFactory.eINSTANCE.createTracingConfiguration();
   
    // Configure the Config Element
    presentationConfigs.getPresentationConfigurations().add(config);
    config.setDatatype(t_string);
    config.setLinkType(linkType);
    config.setProxyAttribute(ad_proxy);
    config.setProxyType(proxyType);
   
    requirement = rf.createSpecObject();
    requirement.setType(requirementType);
    content.getSpecObjects().add(requirement);
    return reqif;
  }
View Full Code Here

   * The external element (to be traced from/to) must be persisted.  For simplicity, we use
   * a ReqIF model.
   */
  private EObject buildTestExternal() throws IOException {
    ReqIF reqif  = ReqIF10Factory.eINSTANCE.createReqIF();
    ReqIFHeader header= ReqIF10Factory.eINSTANCE.createReqIFHeader();
    header.setTitle("HeaderTitle");
    reqif.setTheHeader(header);
    external = header;
   
    File file = File.createTempFile("tracing-test-", ".reqif");
    file.deleteOnExit();
View Full Code Here

   */
  @Test
  public void testFindProxyElementSucceeds() {
    CreateTraceCommand cmd = createCommand();
    editingDomain.getCommandStack().execute(cmd);
    SpecObject proxy = cmd.findProxyFor(external);
    assertNotNull(proxy);
   
    // Ensure that the URLs match
    String expectedUri = EcoreUtil.getURI(external).toString();
    String value = ((AttributeValueString)proxy.getValues().get(0)).getTheValue();
    StringTokenizer st = new StringTokenizer(value, "\n");
    String actualUri = st.nextToken();
    assertEquals(expectedUri, actualUri);
  }
View Full Code Here

 
  @Test
  public void testUpdateProxyIfNecessaryNoUpdate() throws Exception {
    CreateTraceCommand cmd = createCommand();
    editingDomain.getCommandStack().execute(cmd);
    SpecObject proxy = cmd.findProxyFor(external);
    TracingConfigurationItemProvider ip = (TracingConfigurationItemProvider) ProrUtil
        .getItemProvider(adapterFactory, config);

   
    AttributeValueString value = ((AttributeValueString)proxy.getValues().get(0));
    ip.updateProxyIfNecessary(value, external, editingDomain);
    // No Cmd should be triggered from this
    assertEquals(cmd, editingDomain.getCommandStack().getMostRecentCommand());
  }
View Full Code Here

 
  @Test
  public void testUpdateProxyIfNecessaryValueChanged() throws Exception {
    CreateTraceCommand cmd = createCommand();
    editingDomain.getCommandStack().execute(cmd);
    SpecObject proxy = cmd.findProxyFor(external);
   
    TracingConfigurationItemProvider ip = (TracingConfigurationItemProvider) ProrUtil
        .getItemProvider(adapterFactory, config);
    AttributeValueString value = ((AttributeValueString)proxy.getValues().get(0));
    value.setTheValue(value.getTheValue() + "x");
    ip.updateProxyIfNecessary(value, external, editingDomain);
   
    // Ensure the values match
    assertEquals(value.getTheValue(), ip.buildProxyContent(external));
View Full Code Here

TOP

Related Classes of org.eclipse.rmf.reqif10.AttributeValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.