Examples of JvmParameterizedTypeReference


Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetExceptionClass(JvmParameterizedTypeReference newExceptionClass, NotificationChain msgs)
  {
    JvmParameterizedTypeReference oldExceptionClass = exceptionClass;
    exceptionClass = newExceptionClass;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JexTestPackage.TRANSITION_EXCEPTION_EFFECT__EXCEPTION_CLASS, oldExceptionClass, newExceptionClass);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetType(JvmParameterizedTypeReference newType, NotificationChain msgs)
  {
    JvmParameterizedTypeReference oldType = type;
    type = newType;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JexTestPackage.STATE_FUNCTION__TYPE, oldType, newType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetTestedClass(JvmParameterizedTypeReference newTestedClass, NotificationChain msgs)
  {
    JvmParameterizedTypeReference oldTestedClass = testedClass;
    testedClass = newTestedClass;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JexTestPackage.JEX_TEST_CASE__TESTED_CLASS, oldTestedClass, newTestedClass);
      if (msgs == null) msgs = notification; else msgs.add(notification);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

    boolean _isEmpty = _instances.isEmpty();
    return _isEmpty;
  }
 
  public JvmParameterizedTypeReference defaultInstanceType(final EObject eObject) {
    JvmParameterizedTypeReference _xblockexpression = null;
    {
      final JexTestCase testCase = this.<JexTestCase>ancestor(eObject, JexTestCase.class);
      JvmParameterizedTypeReference _testedClass = null;
      if (testCase!=null) {
        _testedClass=testCase.getTestedClass();
      }
      _xblockexpression = (_testedClass);
    }
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

    return _xblockexpression;
  }
 
  public String defaultInstanceName(final EObject eObject) {
    JexTestCase _ancestor = this.<JexTestCase>ancestor(eObject, JexTestCase.class);
    JvmParameterizedTypeReference _testedClass = _ancestor.getTestedClass();
    String _simpleName = _testedClass.getSimpleName();
    String _firstLower = StringExtensions.toFirstLower(_simpleName);
    return _firstLower;
  }
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

    JvmTypeReference _elvis = null;
    JvmTypeReference _type = instance.getType();
    if (_type != null) {
      _elvis = _type;
    } else {
      JvmParameterizedTypeReference _defaultInstanceType = this.defaultInstanceType(instance);
      _elvis = ObjectExtensions.<JvmTypeReference>operator_elvis(_type, _defaultInstanceType);
    }
    return _elvis;
  }
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

    JvmTypeReference _xblockexpression = null;
    {
      final PropertiesTestOwner propertiesTestOwner = this.<PropertiesTestOwner>ancestor(eObject, PropertiesTestOwner.class);
      if ((propertiesTestOwner instanceof StateFunction)) {
        final StateFunction stateFunction = ((StateFunction) propertiesTestOwner);
        JvmParameterizedTypeReference _elvis = null;
        JvmParameterizedTypeReference _type = stateFunction.getType();
        if (_type != null) {
          _elvis = _type;
        } else {
          JvmParameterizedTypeReference _defaultInstanceType = this.defaultInstanceType(eObject);
          _elvis = ObjectExtensions.<JvmParameterizedTypeReference>operator_elvis(_type, _defaultInstanceType);
        }
        return _elvis;
      } else {
        if ((propertiesTestOwner instanceof ObjectTest)) {
          final Instance instance = ((ObjectTest) propertiesTestOwner).getInstance();
          boolean _notEquals = (!Objects.equal(instance, null));
          if (_notEquals) {
            return this.jvmType(instance);
          }
        }
      }
      JexTestCase _ancestor = this.<JexTestCase>ancestor(eObject, JexTestCase.class);
      final EList<Instance> instances = _ancestor.getInstances();
      JvmTypeReference _xifexpression = null;
      boolean _isEmpty = instances.isEmpty();
      if (_isEmpty) {
        JvmParameterizedTypeReference _defaultInstanceType_1 = this.defaultInstanceType(eObject);
        _xifexpression = _defaultInstanceType_1;
      } else {
        JvmTypeReference _xifexpression_1 = null;
        int _size = instances.size();
        boolean _equals = (_size == 1);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

      final StringBuilder descriptionBuffer = _stringBuilder;
      String _description = testCase.getDescription();
      this.addDescription(descriptionBuffer, _description, "h3");
      StringConcatenation _builder = new StringConcatenation();
      _builder.append("Tests ");
      JvmParameterizedTypeReference _testedClass = testCase.getTestedClass();
      String _identifier = _testedClass.getIdentifier();
      _builder.append(_identifier, "");
      descriptionBuffer.append(_builder);
      String _url = testCase.getUrl();
      boolean _notEquals = (!Objects.equal(_url, null));
      if (_notEquals) {
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

    boolean _xblockexpression = false;
    {
      StringBuilder _stringBuilder = new StringBuilder();
      final StringBuilder testsBuffer = _stringBuilder;
      final JexTestCase testCase = this._util.<JexTestCase>ancestor(sequence, JexTestCase.class);
      JvmParameterizedTypeReference _testedClass = testCase.getTestedClass();
      final JvmType testedClass = _testedClass.getType();
      final ArrayList<JvmExecutable> testedMembers = CollectionLiterals.<JvmExecutable>newArrayList();
      EList<Instance> _instances = testCase.getInstances();
      boolean _isEmpty = _instances.isEmpty();
      if (_isEmpty) {
        this.addDefaultConstructor(testedClass, testedMembers);
View Full Code Here

Examples of org.eclipse.xtext.common.types.JvmParameterizedTypeReference

    String _elvis = null;
    String _testClassName = testCase.getTestClassName();
    if (_testClassName != null) {
      _elvis = _testClassName;
    } else {
      JvmParameterizedTypeReference _testedClass = testCase.getTestedClass();
      String _qualifiedName = _testedClass.getQualifiedName();
      String _plus = (_qualifiedName + "Test");
      _elvis = ObjectExtensions.<String>operator_elvis(_testClassName, _plus);
    }
    final String className = _elvis;
    final JvmGenericType jvmClass = this._jvmTypesBuilder.toClass(testCase, className);
    EList<JvmTypeReference> _superTypes = jvmClass.getSuperTypes();
    JvmTypeReference _newTypeRef = this._jvmTypesBuilder.newTypeRef(testCase, "junit.framework.TestCase");
    this._jvmTypesBuilder.<JvmTypeReference>operator_add(_superTypes, _newTypeRef);
    IPostIndexingInitializing<JvmGenericType> _accept = acceptor.<JvmGenericType>accept(jvmClass);
    final Procedure1<JvmGenericType> _function = new Procedure1<JvmGenericType>() {
      public void apply(final JvmGenericType it) {
        final JvmAnnotationReference jexerciseTestCaseAnnotation = JexTestJvmModelInferrer.this._jvmTypesBuilder.toAnnotation(testCase, "no.hal.jex.runtime.JExercise");
        JexTestJvmModelInferrer.this._testAnnotationsSupport.generateTestClassAnntations(testCase, jexerciseTestCaseAnnotation);
        EList<JvmAnnotationReference> _annotations = it.getAnnotations();
        JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, jexerciseTestCaseAnnotation);
        boolean _isDefaultInstanceTest = JexTestJvmModelInferrer.this._util.isDefaultInstanceTest(testCase);
        if (_isDefaultInstanceTest) {
          EList<JvmMember> _members = jvmClass.getMembers();
          String _defaultInstanceName = JexTestJvmModelInferrer.this._util.defaultInstanceName(testCase);
          JvmParameterizedTypeReference _testedClass = testCase.getTestedClass();
          final Procedure1<JvmField> _function = new Procedure1<JvmField>() {
            public void apply(final JvmField it) {
              it.setVisibility(JvmVisibility.PRIVATE);
            }
          };
          JvmField _field = JexTestJvmModelInferrer.this._jvmTypesBuilder.toField(testCase, _defaultInstanceName, _testedClass, _function);
          JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmField>operator_add(_members, _field);
        } else {
          EList<Instance> _instances = testCase.getInstances();
          for (final Instance instance : _instances) {
            {
              final JvmTypeReference type = JexTestJvmModelInferrer.this._util.jvmType(instance);
              EList<JvmMember> _members_1 = jvmClass.getMembers();
              String _name = instance.getName();
              final Procedure1<JvmField> _function_1 = new Procedure1<JvmField>() {
                public void apply(final JvmField it) {
                  it.setVisibility(JvmVisibility.PRIVATE);
                }
              };
              JvmField _field_1 = JexTestJvmModelInferrer.this._jvmTypesBuilder.toField(instance, _name, type, _function_1);
              JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmField>operator_add(_members_1, _field_1);
              EList<JvmMember> _members_2 = it.getMembers();
              String _name_1 = instance.getName();
              String _plus = ("_init_" + _name_1);
              JvmOperation _inferTestInstanceInitMethod = JexTestJvmModelInferrer.this.inferTestInstanceInitMethod(_plus, instance);
              JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members_2, _inferTestInstanceInitMethod);
            }
          }
        }
        EList<JvmMember> _members_1 = jvmClass.getMembers();
        JvmTypeReference _newTypeRef = JexTestJvmModelInferrer.this._jvmTypesBuilder.newTypeRef(testCase, void.class);
        final Procedure1<JvmOperation> _function_1 = new Procedure1<JvmOperation>() {
          public void apply(final JvmOperation it) {
            it.setVisibility(JvmVisibility.PROTECTED);
            EList<JvmAnnotationReference> _annotations = it.getAnnotations();
            JvmAnnotationReference _annotation = JexTestJvmModelInferrer.this._jvmTypesBuilder.toAnnotation(testCase, Override.class);
            JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmAnnotationReference>operator_add(_annotations, _annotation);
            final Procedure1<ITreeAppendable> _function = new Procedure1<ITreeAppendable>() {
              public void apply(final ITreeAppendable it) {
                JexTestJvmModelInferrer.this.generateSetUpMethodBody(testCase, it);
              }
            };
            JexTestJvmModelInferrer.this._jvmTypesBuilder.setBody(it, _function);
          }
        };
        JvmOperation _method = JexTestJvmModelInferrer.this._jvmTypesBuilder.toMethod(testCase, "setUp", _newTypeRef, _function_1);
        JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members_1, _method);
        EList<Method> _methods = testCase.getMethods();
        for (final Method method : _methods) {
          {
            String _elvis = null;
            String _name = method.getName();
            QualifiedName _create = QualifiedName.create(_name);
            QualifiedName _methodName = JexTestJvmModelInferrer.this._operatorMapping.getMethodName(_create);
            String _string = null;
            if (_methodName!=null) {
              _string=_methodName.toString();
            }
            if (_string != null) {
              _elvis = _string;
            } else {
              String _name_1 = method.getName();
              _elvis = ObjectExtensions.<String>operator_elvis(_string, _name_1);
            }
            final String methodName = _elvis;
            boolean _notEquals = (!Objects.equal(methodName, null));
            if (_notEquals) {
              EList<JvmMember> _members_2 = it.getMembers();
              JvmTypeReference _returnType = method.getReturnType();
              final Procedure1<JvmOperation> _function_2 = new Procedure1<JvmOperation>() {
                public void apply(final JvmOperation it) {
                  it.setVisibility(JvmVisibility.PRIVATE);
                  boolean _isStatic = method.isStatic();
                  it.setStatic(_isStatic);
                  EList<Parameter> _parameters = method.getParameters();
                  JexTestJvmModelInferrer.this.initParameters(it, _parameters);
                  XExpression _body = method.getBody();
                  JexTestJvmModelInferrer.this._jvmTypesBuilder.setBody(it, _body);
                }
              };
              JvmOperation _method_1 = JexTestJvmModelInferrer.this._jvmTypesBuilder.toMethod(method, methodName, _returnType, _function_2);
              JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmOperation>operator_add(_members_2, _method_1);
            }
          }
        }
        EList<StateFunction> _stateFunctions = testCase.getStateFunctions();
        for (final StateFunction stateFunction : _stateFunctions) {
          String _name = stateFunction.getName();
          boolean _notEquals = (!Objects.equal(_name, null));
          if (_notEquals) {
            String _name_1 = stateFunction.getName();
            JvmTypeReference _newTypeRef_1 = JexTestJvmModelInferrer.this._jvmTypesBuilder.newTypeRef(stateFunction, void.class);
            final Procedure1<JvmOperation> _function_2 = new Procedure1<JvmOperation>() {
              public void apply(final JvmOperation it) {
                it.setVisibility(JvmVisibility.PRIVATE);
                EList<JvmFormalParameter> _parameters = it.getParameters();
                String _string = XbaseScopeProvider.IT.toString();
                JvmParameterizedTypeReference _elvis = null;
                JvmParameterizedTypeReference _type = stateFunction.getType();
                if (_type != null) {
                  _elvis = _type;
                } else {
                  JvmParameterizedTypeReference _testedClass = testCase.getTestedClass();
                  _elvis = ObjectExtensions.<JvmParameterizedTypeReference>operator_elvis(_type, _testedClass);
                }
                JvmFormalParameter _parameter = JexTestJvmModelInferrer.this._jvmTypesBuilder.toParameter(stateFunction, _string, _elvis);
                JexTestJvmModelInferrer.this._jvmTypesBuilder.<JvmFormalParameter>operator_add(_parameters, _parameter);
                EList<Parameter> _parameters_1 = stateFunction.getParameters();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.