Package modTransf.model

Examples of modTransf.model.ModelHelper


    property.setVarName( VARNAME );
    property.setParent( createDomain("java", null, 0));
    String value = new String("aValue");

    // Create a modelHelper, register it in a Transformation and in the context.
    ModelHelper model = setUpJavaModel("java");
    // Create an object from the model.
    MockBean parent = (MockBean)model.createInstance( MockBean.class.getName());
    parent.setName(value);

    // Try to get the value
    Object res = property.getPropertyValue( parent, context);
    assertEquals( "property value", value, res );
View Full Code Here


    property.setVarName( VARNAME );
    property.setType( MockBean.class.getName() );
    domain.addSubPropertyDescriptor(property);

    // Create a modelHelper, register it in a Transformation and in the context.
    ModelHelper model = setUpJavaModel("java");
    // Try to create the sub property
    Object res = property.create( context);
    assertTrue( "object type", res instanceof MockBean );
    assertEquals( "Created object stored in local context", res, context.getAttribute(VARNAME)) ;
View Full Code Here

  {

    String VARNAME = "aVarName";
    String PROPVARNAME = "p1";
    // Create a modelHelper, register it in a Transformation and in the context.
    ModelHelper model = setUpJavaModel("java");

    Domain domain = new Domain();
    domain.setModelName("java");

    ConceptDescriptor parent = createProperty("next", VARNAME , MockBean.class.getName() );
View Full Code Here

    try
    {
      Class contextClass = Class.forName(mmAdaptorClassname);
      // Try to get the constructor with an extent parameter.
      // Use the default constructor if not found.
      ModelHelper context;

      // Try use the constructor with one arg of the Object type
      context = (ModelHelper) instanciate(contextClass, Object.class, extent);
      if(context != null)
      {
View Full Code Here

   * @param modelName String
   */
  public ModelHelper setUpJavaModel(String modelName)
  {
    // Add a model 'java'
    ModelHelper javaModel = new JavaObjectModelHelper();

    setUpTransformation();
    transformationImpl.getModels().registerModel(modelName, javaModel);
    return javaModel;
  }
View Full Code Here

    String VARNAME = "aVarName";
    Domain domain = createDomain("java", 0, VARNAME, MockBean.class.getName());

    // Create a modelHelper, register it in a Transformation and in the context.
    ModelHelper model = setUpJavaModel("java");
    // Try to create the sub property
    Object res = domain.create(context);
    assertTrue("object type", res instanceof MockBean);
    assertEquals("Created object stored in local context", res, context.getAttribute(VARNAME));
View Full Code Here

  {

    String VARNAME = "aVarName";
    String PROPVARNAME = "p1";
    // Create a modelHelper, register it in a Transformation and in the context.
    ModelHelper model = setUpJavaModel("java");

    Domain domain = createDomain("java", 0, VARNAME, MockBean.class.getName());
    ConceptDescriptor property = createProperty("next", PROPVARNAME, MockBean.class.getName());
    domain.addSubPropertyDescriptor(property);
View Full Code Here

TOP

Related Classes of modTransf.model.ModelHelper

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.