From 75efec9660f7fbaa6d9d44e2e605e0c601ed0b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Galland?= Date: Sat, 29 Apr 2017 14:20:21 +0200 Subject: [PATCH] [lang] Mark generated elements with @SarlElementType. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Galland --- .../sarl/lang/annotation/SarlElementType.java | 56 +++++++++ .../lang/jvmmodel/SARLJvmModelInferrer.java | 91 ++++++++++++++- .../sarl/lang/tests/bugs/to00399/Bug23.java | 3 + .../sarl/lang/tests/bugs/to00399/Bug294.java | 5 + .../sarl/lang/tests/bugs/to00399/Bug312.java | 3 + .../sarl/lang/tests/bugs/to00399/Bug381.java | 13 +++ .../sarl/lang/tests/bugs/to00399/Bug383.java | 3 + .../sarl/lang/tests/bugs/to00399/Bug92.java | 19 +++ .../sarl/lang/tests/bugs/to00699/Bug459.java | 15 +++ .../sarl/lang/tests/bugs/to00699/Bug505.java | 11 ++ .../sarl/lang/tests/bugs/to00699/Bug553.java | 3 + .../sarl/lang/tests/bugs/to00699/Bug590.java | 12 ++ .../sarl/lang/tests/bugs/to00699/Bug593.java | 36 ++++++ .../sarl/lang/tests/bugs/to00699/Bug599.java | 4 + .../sarl/lang/tests/bugs/to00699/Bug600.java | 32 +++++ .../sarl/lang/tests/bugs/to00699/Bug623.java | 7 ++ .../sarl/lang/tests/bugs/to00699/Bug631.java | 3 + .../sarl/lang/tests/bugs/to00699/Bug633.java | 3 + .../sarl/lang/tests/bugs/to00699/Bug643.java | 3 + .../sarl/lang/tests/bugs/to00699/Bug646.java | 3 + .../sarl/lang/tests/bugs/to00699/Bug655.java | 3 + .../compilation/aop/AgentCompilerTest.java | 105 +++++++++++++++++ .../compilation/aop/BehaviorCompilerTest.java | 69 +++++++++++ .../compilation/aop/CapacityCompilerTest.java | 15 +++ .../compilation/aop/EventCompilerTest.java | 33 ++++++ .../compilation/aop/SkillCompilerTest.java | 109 ++++++++++++++++++ .../general/ArgDefaultValueCompilerTest.java | 87 ++++++++++++++ .../compilation/general/BreakKeywordTest.java | 24 ++++ .../general/CloneFunctionTest.java | 18 +++ .../general/EqualsFunctionTest.java | 32 +++++ .../general/GeneralSyntaxTest.java | 5 + .../general/InlineFunctionTest.java | 31 +++++ .../compilation/general/PureFunctionTest.java | 33 ++++++ .../SARLMapExtensionsCompilerTest.java | 21 ++++ .../SARLTimeExtensionsCompilerTest.java | 13 +++ .../general/VarArgsCompilerTest.java | 31 +++++ .../general/VarDeclarationCompilerTest.java | 19 +++ .../oop/AnnotationTypeCompilerTest.java | 29 +++++ .../compilation/oop/ClassCompilerTest.java | 85 ++++++++++++++ .../compilation/oop/EnumCompilerTest.java | 9 ++ .../oop/InterfaceCompilerTest.java | 85 ++++++++++++++ .../batch/AbstractBatchCompilerTest.java | 3 + 42 files changed, 1181 insertions(+), 3 deletions(-) create mode 100644 main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/annotation/SarlElementType.java diff --git a/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/annotation/SarlElementType.java b/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/annotation/SarlElementType.java new file mode 100644 index 0000000000..35a8fe06e8 --- /dev/null +++ b/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/annotation/SarlElementType.java @@ -0,0 +1,56 @@ +/* + * $Id$ + * + * SARL is an general-purpose agent programming language. + * More details on http://www.sarl.io + * + * Copyright (C) 2014-2017 the original authors or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.sarl.lang.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** Annotation for marking a JvmElement with the specific type of SARL element. + * + *

This annotation is attached to the JvmElements that represent SARL specific + * type declarations, e.g. agent, behavior, etc. + * + *

This annotation is usually used for simulating quickly the "A instanceof B", + * wheree A is a JvmElement (not an Xbase element), and B is a Xbase type. + * + * @author $Author: sgalland$ + * @version $FullVersion$ + * @mavengroupid $GroupId$ + * @mavenartifactid $ArtifactId$ + * @since 0.6 + */ +@Target({ ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +public @interface SarlElementType { + + /** Replies the SARL type. + * + *

The replies value is the ID of the ECore type, e.g. + * {@code SarlPackage::SARL_AGENT} and {@code SarlPackage::SARL_BEHAVIOR}. + * + * @return the SARL element type + */ + int value(); + +} diff --git a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java index 59b8d27724..7b5ae642db 100644 --- a/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java +++ b/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLJvmModelInferrer.java @@ -89,6 +89,7 @@ import org.eclipse.xtext.common.types.JvmFormalParameter; import org.eclipse.xtext.common.types.JvmGenericType; import org.eclipse.xtext.common.types.JvmIdentifiableElement; +import org.eclipse.xtext.common.types.JvmIntAnnotationValue; import org.eclipse.xtext.common.types.JvmOperation; import org.eclipse.xtext.common.types.JvmParameterizedTypeReference; import org.eclipse.xtext.common.types.JvmType; @@ -141,6 +142,7 @@ import io.sarl.lang.annotation.FiredEvent; import io.sarl.lang.annotation.ImportedCapacityFeature; import io.sarl.lang.annotation.PerceptGuardEvaluator; +import io.sarl.lang.annotation.SarlElementType; import io.sarl.lang.annotation.SarlSourceCode; import io.sarl.lang.annotation.SarlSpecification; import io.sarl.lang.annotation.SyntheticMember; @@ -379,6 +381,41 @@ private JvmAnnotationReference addAnnotationSafe(JvmAnnotationTarget target, Cla return null; } + /** Add annotation safely. + * + *

This function creates an annotation reference. If the type for the annotation is not found; + * no annotation is added. + * + * @param target the receiver of the annotation. + * @param annotationType the type of the annotation. + * @param value the annotations value. + * @return the annotation reference or null if the annotation cannot be added. + */ + private JvmAnnotationReference addAnnotationSafe(JvmAnnotationTarget target, Class annotationType, int value) { + assert target != null; + assert annotationType != null; + try { + final JvmAnnotationReference result = this.typesFactory.createJvmAnnotationReference(); + final JvmType jvmType = this.typeReferences.findDeclaredType(annotationType, target); + if (jvmType == null) { + return null; + } + if (!(jvmType instanceof JvmAnnotationType)) { + return null; + } + result.setAnnotation((JvmAnnotationType) jvmType); + final JvmIntAnnotationValue annotationValue = this.typesFactory.createJvmIntAnnotationValue(); + annotationValue.getValues().add(value); + result.getExplicitValues().add(annotationValue); + if (target.getAnnotations().add(result)) { + return result; + } + } catch (IllegalArgumentException exception) { + // Ignore + } + return null; + } + /** Create an annotation with classes as values. * * @param type - the type of the annotation. @@ -851,6 +888,9 @@ protected void initialize(XtendClass source, JvmGenericType inferredJvmType) { // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); } finally { closeContext(context); } @@ -881,17 +921,24 @@ protected void initialize(XtendInterface source, JvmGenericType inferredJvmType) context.getInheritedOperationsToImplement(), null, this.sarlSignatureProvider); + // Standard OOP generation super.initialize(source, inferredJvmType); + // Add SARL synthetic functions appendSyntheticDefaultValuedParameterMethods( source, inferredJvmType, context); + // Add the @FunctionalInterface appendFunctionalInterfaceAnnotation(inferredJvmType); + // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); } finally { closeContext(context); } @@ -922,15 +969,21 @@ protected void initialize(XtendAnnotationType source, JvmAnnotationType inferred context.getInheritedOperationsToImplement(), null, this.sarlSignatureProvider); + // Standard OOP generation super.initialize(source, inferredJvmType); + // Add SARL synthetic functions appendSyntheticDefaultValuedParameterMethods( source, inferredJvmType, context); + // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); } finally { closeContext(context); } @@ -961,15 +1014,21 @@ protected void initialize(XtendEnum source, JvmEnumerationType inferredJvmType) context.getInheritedOperationsToImplement(), null, this.sarlSignatureProvider); + // Standard OOP generation super.initialize(source, inferredJvmType); + // Add SARL synthetic functions appendSyntheticDefaultValuedParameterMethods( source, inferredJvmType, context); + // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); } finally { closeContext(context); } @@ -1033,6 +1092,9 @@ protected void initialize(SarlAgent source, JvmGenericType inferredJvmType) { // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); + // Resolving any name conflict with the generated JVM type this.nameClashResolver.resolveNameClashes(inferredJvmType); } finally { @@ -1098,6 +1160,9 @@ protected void initialize(SarlBehavior source, JvmGenericType inferredJvmType) { // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); + // Resolving any name conflict with the generated JVM type this.nameClashResolver.resolveNameClashes(inferredJvmType); } finally { @@ -1166,6 +1231,9 @@ protected void initialize(SarlEvent source, JvmGenericType inferredJvmType) { // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); + // Resolving any name conflict with the generated JVM type this.nameClashResolver.resolveNameClashes(inferredJvmType); } finally { @@ -1232,6 +1300,9 @@ protected void initialize(SarlSkill source, JvmGenericType inferredJvmType) { // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); + // Resolving any name conflict with the generated JVM type this.nameClashResolver.resolveNameClashes(inferredJvmType); } finally { @@ -1287,6 +1358,9 @@ protected void initialize(SarlCapacity source, JvmGenericType inferredJvmType) { // Add the specification version of SARL appendSARLSpecificationVersion(context, source, inferredJvmType); + // Add the type of SARL Element + appendSARLElementType(source, inferredJvmType); + // Resolving any name conflict with the generated JVM type this.nameClashResolver.resolveNameClashes(inferredJvmType); } finally { @@ -2786,11 +2860,10 @@ protected void appendCloneFunctionIfCloneable(GenerationContext context, XtendTy } } - /** Append the SARL specification version as a private field of the given container. + /** Append the SARL specification version as an annotation to the given container. * - *

The added field may be used by any underground platform for determining what is + *

The added annotation may be used by any underground platform for determining what is * the version of the SARL specification that was used for generating the container. - * The principle is inspired from the serialVersionUID from Java. * * @param context the current generation context. * @param source the source object. @@ -2801,6 +2874,18 @@ protected void appendSARLSpecificationVersion(GenerationContext context, XtendTy addAnnotationSafe(target, SarlSpecification.class, SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING); } + /** Append the SARL element type as an annotation to the given container. + * + *

The added annotation may be used by any underground platform for determining what is + * the type of the SARL element without invoking the costly "instanceof" operations. + * + * @param source the source object. + * @param target the inferred JVM object. + */ + protected void appendSARLElementType(XtendTypeDeclaration source, JvmDeclaredType target) { + addAnnotationSafe(target, SarlElementType.class, source.eClass().getClassifierID()); + } + /** Remove the type parameters from the given type. * * @param type the type. diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug23.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug23.java index 16112819fc..32585b06a3 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug23.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug23.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -61,6 +62,7 @@ public void bug23() throws Exception { @Test public void myAgentSpawnedCompile() throws Exception { final String expectedMyAgentSpawned = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", @@ -69,6 +71,7 @@ public void myAgentSpawnedCompile() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class MyAgentSpawned extends AgentSpawned {", " public UUID titi;", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug294.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug294.java index adf234531c..e62f316738 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug294.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug294.java @@ -31,6 +31,7 @@ import io.sarl.lang.SARLVersion; import io.sarl.lang.actionprototype.ActionPrototype; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -86,6 +87,7 @@ public void testCompiler() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -93,6 +95,7 @@ public void testCompiler() throws Exception { "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface PhysicEnvironment extends Capacity {", " @DefaultValueSource", @@ -247,6 +250,7 @@ public void testCompiler() throws Exception { final String expectedStandardPhysicEnvironment = multilineString( "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -254,6 +258,7 @@ public void testCompiler() throws Exception { "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class StandardPhysicEnvironment extends Skill implements PhysicEnvironment {", " @DefaultValueSource", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug312.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug312.java index e469d7f505..3056f975f0 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug312.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug312.java @@ -23,6 +23,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -65,6 +66,7 @@ public void testCompiler() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -72,6 +74,7 @@ public void testCompiler() throws Exception { "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " @DefaultValueSource", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug381.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug381.java index 2312476ab1..1553b24d20 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug381.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug381.java @@ -27,6 +27,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -147,6 +148,7 @@ public static class CompilerTest extends AbstractSarlTest { public void withSarlSyntaxWithLocalType() throws Exception { final String expected = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -160,6 +162,7 @@ public void withSarlSyntaxWithLocalType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @Extension", @@ -198,6 +201,7 @@ public void withSarlSyntaxWithLocalType() throws Exception { public void withJavaSyntaxWithLocalType() throws Exception { final String expected = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -211,6 +215,7 @@ public void withJavaSyntaxWithLocalType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @Extension", @@ -249,6 +254,7 @@ public void withJavaSyntaxWithLocalType() throws Exception { public void withSarlSyntaxWithJREType() throws Exception { final String expected = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -262,6 +268,7 @@ public void withSarlSyntaxWithJREType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @Extension", @@ -304,6 +311,7 @@ public void accept(Result r) { public void withJavaSyntaxWithJREType() throws Exception { final String expected = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -317,6 +325,7 @@ public void withJavaSyntaxWithJREType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @Extension", @@ -355,6 +364,7 @@ public void withJavaSyntaxWithJREType() throws Exception { public void withSarlSyntaxWithoutType() throws Exception { final String expected = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -368,6 +378,7 @@ public void withSarlSyntaxWithoutType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @Extension", @@ -410,6 +421,7 @@ public void accept(Result r) { public void withJavaSyntaxWithoutType() throws Exception { final String expected = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -423,6 +435,7 @@ public void withJavaSyntaxWithoutType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @Extension", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug383.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug383.java index b57943f490..1af0a5d720 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug383.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug383.java @@ -25,6 +25,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -75,6 +76,7 @@ public void compilation() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -86,6 +88,7 @@ public void compilation() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " /**", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug92.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug92.java index 8da31a632f..ff8b45f856 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug92.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00399/Bug92.java @@ -32,6 +32,7 @@ import io.sarl.lang.SARLVersion; import io.sarl.lang.sarl.SarlAgent; import io.sarl.lang.sarl.SarlField; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -146,6 +147,7 @@ public void attributeDeclarationCompiler_inferredDouble() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -155,6 +157,7 @@ public void attributeDeclarationCompiler_inferredDouble() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private double myDouble = 0d;", @@ -208,6 +211,7 @@ public void attributeDeclarationCompiler_Double() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -217,6 +221,7 @@ public void attributeDeclarationCompiler_Double() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Double myDouble = Double.valueOf(0d);", @@ -270,6 +275,7 @@ public void attributeDeclarationCompiler_double() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -279,6 +285,7 @@ public void attributeDeclarationCompiler_double() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private double myDouble = 0d;", @@ -340,11 +347,13 @@ public void originialCode_withDoubleType() throws Exception { "}", ""); final String expected1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface ComputeEnergyCapacity extends Capacity {", " public abstract Double getEnergy(final Double currentTime, final Double deltaTime, final Double wantedEnergy);", @@ -378,6 +387,7 @@ public void originialCode_withDoubleType() throws Exception { ""); final String expected2 = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.BuiltinCapacitiesProvider;", @@ -390,6 +400,7 @@ public void originialCode_withDoubleType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class DeviceAgent extends EntityAgent {", " private Double busTime = Double.valueOf(0d);", @@ -453,6 +464,7 @@ public void originialCode_withDoubleType() throws Exception { "}", ""); final String expected3 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -461,6 +473,7 @@ public void originialCode_withDoubleType() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class EntityAgent extends Agent {", " @SyntheticMember", @@ -500,11 +513,13 @@ public void originialCode_withoutDoubleType() throws Exception { "}" ); final String expected1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface ComputeEnergyCapacity extends Capacity {", " public abstract Double getEnergy(final Double currentTime, final Double deltaTime, final Double wantedEnergy);", @@ -538,6 +553,7 @@ public void originialCode_withoutDoubleType() throws Exception { ""); final String expected2 = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.BuiltinCapacitiesProvider;", @@ -550,6 +566,7 @@ public void originialCode_withoutDoubleType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class DeviceAgent extends EntityAgent {", " private double busTime = 0d;", @@ -613,6 +630,7 @@ public void originialCode_withoutDoubleType() throws Exception { "}", ""); final String expected3 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -621,6 +639,7 @@ public void originialCode_withoutDoubleType() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class EntityAgent extends Agent {", " @SyntheticMember", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug459.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug459.java index 6ebe28428c..1b6bb69e67 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug459.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug459.java @@ -24,6 +24,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -91,11 +92,13 @@ public void withoutFunction() throws Exception { multilineString( "package io.sarl.lang.bug459;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -116,6 +119,7 @@ public void withFunction() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -123,6 +127,7 @@ public void withFunction() throws Exception { "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " @DefaultValueSource", @@ -175,11 +180,13 @@ public void singleInheritanceWithoutFunction() throws Exception { assertEquals(multilineString( "package io.sarl.lang.bug459;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.bug459.C1;", "import io.sarl.lang.core.AgentTrait;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C2 extends C1 {", " public static class ContextAwareCapacityWrapper extends C1.ContextAwareCapacityWrapper implements C2 {", @@ -202,6 +209,7 @@ public void singleInheritanceWithFunction() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -209,6 +217,7 @@ public void singleInheritanceWithFunction() throws Exception { "import io.sarl.lang.core.AgentTrait;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C2 extends C1 {", " @DefaultValueSource", @@ -262,12 +271,14 @@ public void multiInheritanceWithoutFunction() throws Exception { assertEquals(multilineString( "package io.sarl.lang.bug459;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.bug459.C1;", "import io.sarl.lang.bug459.C2;", "import io.sarl.lang.core.AgentTrait;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C3 extends C1, C2 {", " public static class ContextAwareCapacityWrapper extends C1.ContextAwareCapacityWrapper implements C3 {", @@ -299,6 +310,7 @@ public void multiInheritanceWithFunction() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -307,6 +319,7 @@ public void multiInheritanceWithFunction() throws Exception { "import io.sarl.lang.core.AgentTrait;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C3 extends C1, C2 {", " @DefaultValueSource", @@ -368,12 +381,14 @@ public void withVarArg() throws Exception { multilineString( "package io.sarl.lang.bug459;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract char myfct(final int a, final String... b);", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug505.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug505.java index 26edf01111..8ce018d51b 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug505.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug505.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -99,12 +100,14 @@ public void snipset1() throws Exception { @Test public void snipset1Compilation() throws Exception { final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.util.Objects;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class TestClass {", " private String testString;", @@ -158,10 +161,12 @@ public void snipset2() throws Exception { @Test public void snipset2Compilation() throws Exception { final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class TestClass {", " public void testMethod1() {", @@ -189,10 +194,12 @@ public void snipset3() throws Exception { @Test public void snipset3Compilation() throws Exception { final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class TestClass {", " public void testMethod1() {", @@ -220,12 +227,14 @@ public void snipset4() throws Exception { @Test public void snipset4Compilation() throws Exception { final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.util.Objects;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class TestClass {", " private String testString;", @@ -279,6 +288,7 @@ public void snipset5() throws Exception { @Test public void snipset5Compilation() throws Exception { final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -289,6 +299,7 @@ public void snipset5Compilation() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public abstract class TestAgent extends Agent {", " private String testString;", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug553.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug553.java index 2c5834bd0a..149aa4ff32 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug553.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug553.java @@ -21,6 +21,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -46,6 +47,7 @@ public class Bug553 extends AbstractSarlTest { "package io.sarl.lang.tests.bug553;", "", "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -56,6 +58,7 @@ public class Bug553 extends AbstractSarlTest { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class TestAgent extends Agent {", " @SyntheticMember", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug590.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug590.java index 60bf81e452..b5d84c5281 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug590.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug590.java @@ -108,6 +108,7 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug590;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.text.MessageFormat;", @@ -115,6 +116,7 @@ public void compiling_01() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class LocaleMessageFormat extends MessageFormat {", " @Override", @@ -162,6 +164,7 @@ public void compiling_02() throws Exception { assertEquals(multilineString( "package io.sarl.lang.tests.bug590;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.text.MessageFormat;", @@ -169,6 +172,7 @@ public void compiling_02() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class LocaleMessageFormat extends MessageFormat {", " @Override", @@ -205,6 +209,7 @@ public void compiling_02() throws Exception { assertEquals(multilineString( "package io.sarl.lang.tests.bug590;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.tests.bug590.LocaleMessageFormat;", @@ -212,6 +217,7 @@ public void compiling_02() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class LocaleMessageFormat2 extends LocaleMessageFormat {", " @Override", @@ -256,6 +262,7 @@ public void compiling_03() throws Exception { assertEquals(multilineString( "package io.sarl.lang.tests.bug590;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.text.MessageFormat;", @@ -263,6 +270,7 @@ public void compiling_03() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class LocaleMessageFormat extends MessageFormat {", " @Override", @@ -299,6 +307,7 @@ public void compiling_03() throws Exception { assertEquals(multilineString( "package io.sarl.lang.tests.bug590;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.tests.bug590.LocaleMessageFormat;", @@ -306,6 +315,7 @@ public void compiling_03() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class LocaleMessageFormat2 extends LocaleMessageFormat {", " @Override", @@ -359,12 +369,14 @@ public void compiling_05() throws Exception { this.compiler.assertCompilesTo(SNIPSET5, multilineString( "package io.sarl.lang.tests.bug590;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.text.MessageFormat;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class LocaleMessageFormat extends MessageFormat {", " @Override", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug593.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug593.java index f4fba39e7e..579dbf22c7 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug593.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug593.java @@ -91,11 +91,13 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.io.Serializable;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class Tuple2f implements Serializable {", " @SyntheticMember", @@ -121,12 +123,14 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.io.Serializable;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class Tuple2f implements Serializable, Cloneable {", " @Override", @@ -163,12 +167,14 @@ public void compiling_03() throws Exception { this.compiler.assertCompilesTo(SNIPSET3, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.io.Serializable;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class Tuple2f implements Serializable, Cloneable, Comparable {", " @Override", @@ -205,12 +211,14 @@ public void compiling_04() throws Exception { this.compiler.assertCompilesTo(SNIPSET4, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.io.Serializable;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class Tuple2f> implements Serializable, Cloneable, Comparable {", " @Override", @@ -271,10 +279,12 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class Tuple2f {", " @SyntheticMember", @@ -297,6 +307,7 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.util.ArrayList;", @@ -304,6 +315,7 @@ public void compiling_02() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class Tuple2f extends ArrayList {", " @Override", @@ -350,6 +362,7 @@ public void compiling_03() throws Exception { this.compiler.assertCompilesTo(SNIPSET3, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.util.ArrayList;", @@ -357,6 +370,7 @@ public void compiling_03() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class Tuple2f> extends ArrayList {", " @Override", @@ -436,11 +450,13 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.io.Serializable;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Tuple2f implements Serializable {", " @SyntheticMember", @@ -466,12 +482,14 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.io.Serializable;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Tuple2f implements Serializable, Cloneable {", " @Override", @@ -508,6 +526,7 @@ public void compiling_03() throws Exception { this.compiler.assertCompilesTo(SNIPSET3, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.io.Serializable;", @@ -515,6 +534,7 @@ public void compiling_03() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Tuple2f implements Serializable, Cloneable, Comparable {", " @Inline(value = \"0\", constantExpression = true)", @@ -556,6 +576,7 @@ public void compiling_04() throws Exception { this.compiler.assertCompilesTo(SNIPSET4, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.io.Serializable;", @@ -563,6 +584,7 @@ public void compiling_04() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Tuple2f> implements Serializable, Cloneable, Comparable {", " @Inline(value = \"0\", constantExpression = true)", @@ -634,12 +656,14 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Tuple2f {", " public T myvar;", @@ -684,6 +708,7 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.util.ArrayList;", @@ -692,6 +717,7 @@ public void compiling_02() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Tuple2f extends ArrayList {", " public T myvar;", @@ -760,6 +786,7 @@ public void compiling_03() throws Exception { this.compiler.assertCompilesTo(SNIPSET3, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.util.ArrayList;", @@ -768,6 +795,7 @@ public void compiling_03() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Tuple2f> extends ArrayList {", " public T myvar;", @@ -871,11 +899,13 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.io.Serializable;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface Tuple2f extends Serializable {", " public abstract T fct();", @@ -895,11 +925,13 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.io.Serializable;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface Tuple2f extends Serializable, Cloneable {", " public abstract T fct();", @@ -919,10 +951,12 @@ public void compiling_03() throws Exception { this.compiler.assertCompilesTo(SNIPSET3, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.io.Serializable;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface Tuple2f extends Serializable, Cloneable, Comparable {", " public abstract T fct();", @@ -942,10 +976,12 @@ public void compiling_04() throws Exception { this.compiler.assertCompilesTo(SNIPSET4, multilineString( "package io.sarl.lang.tests.bug593;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.io.Serializable;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface Tuple2f> extends Serializable, Cloneable, Comparable {", " public abstract T fct();", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug599.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug599.java index ad13e4a44a..11f7b569f6 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug599.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug599.java @@ -87,11 +87,13 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug599;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public XXX() {", @@ -121,11 +123,13 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug599;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.WindowAdapter;", "import java.awt.event.WindowEvent;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public XXX() {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug600.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug600.java index 8f1d5b21b6..30ef481d87 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug600.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug600.java @@ -210,11 +210,13 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public XXX() {", @@ -249,11 +251,13 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public XXX() {", @@ -288,11 +292,13 @@ public void compiling_03() throws Exception { this.compiler.assertCompilesTo(SNIPSET3, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public XXX() {", @@ -327,11 +333,13 @@ public void compiling_04() throws Exception { this.compiler.assertCompilesTo(SNIPSET4, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public XXX() {", @@ -366,11 +374,13 @@ public void compiling_05() throws Exception { this.compiler.assertCompilesTo(SNIPSET5, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " protected void setMouseTargetOnScreen(final Object obj) {", @@ -405,11 +415,13 @@ public void compiling_06() throws Exception { this.compiler.assertCompilesTo(SNIPSET6, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " protected void setMouseTargetOnScreen(final Object obj) {", @@ -444,11 +456,13 @@ public void compiling_07() throws Exception { this.compiler.assertCompilesTo(SNIPSET7, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " protected void setMouseTargetOnScreen(final Object obj) {", @@ -483,11 +497,13 @@ public void compiling_08() throws Exception { this.compiler.assertCompilesTo(SNIPSET8, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " protected void setMouseTargetOnScreen(final Object obj) {", @@ -673,12 +689,14 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public Object originalFunction() {", @@ -718,12 +736,14 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public Object originalFunction() {", @@ -763,12 +783,14 @@ public void compiling_03() throws Exception { this.compiler.assertCompilesTo(SNIPSET3, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public Object originalFunction() {", @@ -808,12 +830,14 @@ public void compiling_04() throws Exception { this.compiler.assertCompilesTo(SNIPSET4, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public Object originalFunction() {", @@ -853,12 +877,14 @@ public void compiling_05() throws Exception { this.compiler.assertCompilesTo(SNIPSET5, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " protected void setMouseTargetOnScreen(final Object obj) {", @@ -898,12 +924,14 @@ public void compiling_06() throws Exception { this.compiler.assertCompilesTo(SNIPSET6, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " protected void setMouseTargetOnScreen(final Object obj) {", @@ -943,12 +971,14 @@ public void compiling_07() throws Exception { this.compiler.assertCompilesTo(SNIPSET7, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " protected void setMouseTargetOnScreen(final Object obj) {", @@ -988,12 +1018,14 @@ public void compiling_08() throws Exception { this.compiler.assertCompilesTo(SNIPSET8, multilineString( "package io.sarl.lang.tests.bug600;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.awt.event.MouseEvent;", "import java.awt.event.MouseMotionListener;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " protected void setMouseTargetOnScreen(final Object obj) {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug623.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug623.java index 47f283f7cc..be897831ad 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug623.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug623.java @@ -22,6 +22,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -87,11 +88,13 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug623;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Functions.Function1;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public void fct() {", @@ -124,11 +127,13 @@ public void compiling_02() throws Exception { this.compiler.assertCompilesTo(SNIPSET2, multilineString( "package io.sarl.lang.tests.bug623;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Functions.Function1;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public void fct() {", @@ -162,11 +167,13 @@ public void compiling_03() throws Exception { this.compiler.assertCompilesTo(SNIPSET3, multilineString( "package io.sarl.lang.tests.bug623;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Functions.Function1;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public int fct() {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug631.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug631.java index a8287f353a..20e79bfa22 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug631.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug631.java @@ -22,6 +22,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -63,11 +64,13 @@ public void compiling_01() throws Exception { this.compiler.assertCompilesTo(SNIPSET1, multilineString( "package io.sarl.lang.tests.bug631;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " @Inline(value = \"0.0f\", constantExpression = true)", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug633.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug633.java index 5c7469496c..b28c5419e4 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug633.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug633.java @@ -22,6 +22,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -65,11 +66,13 @@ public void compiling_01() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class XXX {", " public static void f1() {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug643.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug643.java index c730906a06..215e0a5a22 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug643.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug643.java @@ -27,6 +27,7 @@ import io.sarl.lang.annotation.SarlSourceCode; import io.sarl.lang.annotation.SarlSpecification; import io.sarl.lang.annotation.SyntheticMember; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -62,6 +63,7 @@ public class Bug643 extends AbstractSarlTest { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -69,6 +71,7 @@ public class Bug643 extends AbstractSarlTest { "import io.sarl.lang.tests.bug643.ShapedObject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class TreeNode {", " @DefaultValueSource", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug646.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug646.java index 10c8455612..b087d6d262 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug646.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug646.java @@ -22,6 +22,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -89,6 +90,7 @@ public class Bug646 extends AbstractSarlTest { private final String EXPECTED = multilineString( "package io.sarl.lang.tests.bug646;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.tests.bug646.Shape2f;", @@ -99,6 +101,7 @@ public class Bug646 extends AbstractSarlTest { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class FrustumNodeIterator {", " private Shape2f geometricFrustum;", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug655.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug655.java index 947ecaa140..8c8a2c3590 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug655.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/bugs/to00699/Bug655.java @@ -22,6 +22,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.lang.sarl.SarlScript; import io.sarl.tests.api.AbstractSarlTest; @@ -62,6 +63,7 @@ public class Bug655 extends AbstractSarlTest { "package io.sarl.lang.tests.bug655;", "", "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -79,6 +81,7 @@ public class Bug655 extends AbstractSarlTest { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class X extends Agent {", " private final Timer timer = new Timer();", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/AgentCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/AgentCompilerTest.java index 10551be3e5..b313c5cafc 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/AgentCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/AgentCompilerTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -39,6 +40,7 @@ public class AgentCompilerTest extends AbstractSarlTest { public void basicAgentCompile() throws Exception { String source = "agent A1 { }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -47,6 +49,7 @@ public void basicAgentCompile() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @SyntheticMember", @@ -68,12 +71,14 @@ public void basicAgentCompile() throws Exception { @Test public void trueGuardBehaviorUnit() throws Exception { final String expectedE1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " @SyntheticMember", @@ -93,6 +98,7 @@ public void trueGuardBehaviorUnit() throws Exception { ); final String expectedA1 = multilineString( "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -102,6 +108,7 @@ public void trueGuardBehaviorUnit() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @SyntheticMember", @@ -147,12 +154,14 @@ public void trueGuardBehaviorUnit() throws Exception { @Test public void falseGuardBehaviorUnit() throws Exception { final String expectedE1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " @SyntheticMember", @@ -171,6 +180,7 @@ public void falseGuardBehaviorUnit() throws Exception { "" ); final String expectedA1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -179,6 +189,7 @@ public void falseGuardBehaviorUnit() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @SyntheticMember", @@ -211,6 +222,7 @@ public void falseGuardBehaviorUnit() throws Exception { @Test public void generalGuardBehaviorUnit() throws Exception { final String expectedE1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", @@ -218,6 +230,7 @@ public void generalGuardBehaviorUnit() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public int i;", @@ -276,6 +289,7 @@ public void generalGuardBehaviorUnit() throws Exception { ); final String expectedA1 = multilineString( "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -286,6 +300,7 @@ public void generalGuardBehaviorUnit() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @SyntheticMember", @@ -345,6 +360,7 @@ public void valueVisibility_0() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -354,6 +370,7 @@ public void valueVisibility_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private final int myval = 1;", @@ -408,6 +425,7 @@ public void variableVisibility_0() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -417,6 +435,7 @@ public void variableVisibility_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private int myval = 1;", @@ -471,6 +490,7 @@ public void actionVisibility_0() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -479,6 +499,7 @@ public void actionVisibility_0() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void myfct() {", @@ -508,6 +529,7 @@ public void valueVisibility_1() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -517,6 +539,7 @@ public void valueVisibility_1() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private final int myval = 1;", @@ -571,6 +594,7 @@ public void variableVisibility_1() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -580,6 +604,7 @@ public void variableVisibility_1() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private int myval = 1;", @@ -634,6 +659,7 @@ public void actionVisibility_1() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -642,6 +668,7 @@ public void actionVisibility_1() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private void myfct() {", @@ -669,6 +696,7 @@ public void agentmodifier_none() throws Exception { "agent A1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -677,6 +705,7 @@ public void agentmodifier_none() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @SyntheticMember", @@ -701,6 +730,7 @@ public void agentmodifier_public() throws Exception { "public agent A1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -709,6 +739,7 @@ public void agentmodifier_public() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @SyntheticMember", @@ -733,6 +764,7 @@ public void agentmodifier_package() throws Exception { "package agent A1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -741,6 +773,7 @@ public void agentmodifier_package() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "class A1 extends Agent {", " @SyntheticMember", @@ -765,6 +798,7 @@ public void agentmodifier_abstract() throws Exception { "abstract agent A1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -773,6 +807,7 @@ public void agentmodifier_abstract() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public abstract class A1 extends Agent {", " @SyntheticMember", @@ -799,6 +834,7 @@ public void agentmodifier_abstract_member() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -807,6 +843,7 @@ public void agentmodifier_abstract_member() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public abstract class A1 extends Agent {", " protected abstract void fct();", @@ -833,6 +870,7 @@ public void agentmodifier_final() throws Exception { "final agent A1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -841,6 +879,7 @@ public void agentmodifier_final() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public final class A1 extends Agent {", " @SyntheticMember", @@ -867,6 +906,7 @@ public void fieldmodifier_none() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -876,6 +916,7 @@ public void fieldmodifier_none() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private int field;", @@ -930,6 +971,7 @@ public void fieldmodifier_package() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -939,6 +981,7 @@ public void fieldmodifier_package() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " int field;", @@ -993,6 +1036,7 @@ public void fieldmodifier_protected() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1002,6 +1046,7 @@ public void fieldmodifier_protected() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected int field;", @@ -1056,6 +1101,7 @@ public void fieldmodifier_private() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1065,6 +1111,7 @@ public void fieldmodifier_private() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private int field;", @@ -1121,6 +1168,7 @@ public void actionmodifier_override() throws Exception { "}" ); final String expectedA1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1129,6 +1177,7 @@ public void actionmodifier_override() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public abstract class A1 extends Agent {", " protected abstract void name();", @@ -1147,6 +1196,7 @@ public void actionmodifier_override() throws Exception { "" ); final String expectedA2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.BuiltinCapacitiesProvider;", @@ -1154,6 +1204,7 @@ public void actionmodifier_override() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A2 extends A1 {", " @Override", @@ -1188,6 +1239,7 @@ public void actionmodifier_none() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1196,6 +1248,7 @@ public void actionmodifier_none() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void name() {", @@ -1225,6 +1278,7 @@ public void actionmodifier_private() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1233,6 +1287,7 @@ public void actionmodifier_private() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private void name() {", @@ -1262,6 +1317,7 @@ public void actionmodifier_package() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1270,6 +1326,7 @@ public void actionmodifier_package() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " void name() {", @@ -1299,6 +1356,7 @@ public void actionmodifier_protected() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1307,6 +1365,7 @@ public void actionmodifier_protected() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void name() {", @@ -1336,6 +1395,7 @@ public void actionmodifier_abstract() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1344,6 +1404,7 @@ public void actionmodifier_abstract() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public abstract class A1 extends Agent {", " protected abstract void name();", @@ -1372,6 +1433,7 @@ public void actionmodifier_static() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1380,6 +1442,7 @@ public void actionmodifier_static() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected static void name() {", @@ -1409,6 +1472,7 @@ public void actionmodifier_dispatch() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1417,6 +1481,7 @@ public void actionmodifier_dispatch() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void _name(final Integer a) {", @@ -1451,6 +1516,7 @@ public void actionmodifier_dispatch_final() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1459,6 +1525,7 @@ public void actionmodifier_dispatch_final() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected final void _name(final Integer a) {", @@ -1493,6 +1560,7 @@ public void actionmodifier_final() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1501,6 +1569,7 @@ public void actionmodifier_final() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected final void name() {", @@ -1530,6 +1599,7 @@ public void actionmodifier_synchronized() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1538,6 +1608,7 @@ public void actionmodifier_synchronized() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected synchronized void name() {", @@ -1562,12 +1633,14 @@ public void actionmodifier_synchronized() throws Exception { public void inlinedCapacityFunctionCall_nativeParameter() throws Exception { String source = "capacity C1 { def myfunction(v : double) } agent A1 { uses C1 def caller { myfunction(5) } }"; final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void myfunction(final double v);", @@ -1591,6 +1664,7 @@ public void inlinedCapacityFunctionCall_nativeParameter() throws Exception { ); final String expectedA1 = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1604,6 +1678,7 @@ public void inlinedCapacityFunctionCall_nativeParameter() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void caller() {", @@ -1649,12 +1724,14 @@ public void inlinedCapacityFunctionCall_nativeParameter() throws Exception { public void inlinedCapacityFunctionCall_classParameter_baseName() throws Exception { String source = "capacity C1 { def myfunction(v : Class) } agent A1 { uses C1 def caller { myfunction(Integer) } }"; final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void myfunction(final Class v);", @@ -1678,6 +1755,7 @@ public void inlinedCapacityFunctionCall_classParameter_baseName() throws Excepti ); final String expectedA1 = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1691,6 +1769,7 @@ public void inlinedCapacityFunctionCall_classParameter_baseName() throws Excepti "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void caller() {", @@ -1736,12 +1815,14 @@ public void inlinedCapacityFunctionCall_classParameter_baseName() throws Excepti public void inlinedCapacityFunctionCall_classParameter_typeof() throws Exception { String source = "capacity C1 { def myfunction(v : Class) } agent A1 { uses C1 def caller { myfunction(typeof(Integer)) } }"; final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void myfunction(final Class v);", @@ -1765,6 +1846,7 @@ public void inlinedCapacityFunctionCall_classParameter_typeof() throws Exception ); final String expectedA1 = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1778,6 +1860,7 @@ public void inlinedCapacityFunctionCall_classParameter_typeof() throws Exception "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void caller() {", @@ -1828,12 +1911,14 @@ public void inlinedCapacityFunctionCall_variadicParameter01() throws Exception { + "myfunction(typeof(String), #[])" + " } }"; final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void myfunction(final Class v1, final int... v2);", @@ -1857,6 +1942,7 @@ public void inlinedCapacityFunctionCall_variadicParameter01() throws Exception { ); final String expectedA1 = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1870,6 +1956,7 @@ public void inlinedCapacityFunctionCall_variadicParameter01() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void caller() {", @@ -1926,12 +2013,14 @@ public void inlinedCapacityFunctionCall_variadicParameter02() throws Exception { + "myfunction(#[]);" + " } }"; final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void myfunction(final int... v2);", @@ -1955,6 +2044,7 @@ public void inlinedCapacityFunctionCall_variadicParameter02() throws Exception { ); final String expectedA1 = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1968,6 +2058,7 @@ public void inlinedCapacityFunctionCall_variadicParameter02() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void caller() {", @@ -2032,6 +2123,7 @@ public void duplicateEventHandler() throws Exception { "}"); final String expectedMyAgent = multilineString( "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2043,6 +2135,7 @@ public void duplicateEventHandler() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class MyAgent extends Agent {", " @SyntheticMember", @@ -2118,6 +2211,7 @@ public void multipleEventsWithoutUses() throws Exception { "import foo.test.Destroy;", "import foo.test.Initialize;", "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2127,6 +2221,7 @@ public void multipleEventsWithoutUses() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class MyAgent extends Agent {", " @SyntheticMember", @@ -2191,6 +2286,7 @@ public void multipleEventsWithoutUses_sameEventMultipleTimes() throws Exception "import foo.test.Destroy;", "import foo.test.Initialize;", "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2201,6 +2297,7 @@ public void multipleEventsWithoutUses_sameEventMultipleTimes() throws Exception "import org.eclipse.xtext.xbase.lib.InputOutput;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class MyAgent extends Agent {", " @SyntheticMember", @@ -2273,6 +2370,7 @@ public void multipleEventsWithoutUses_sameEventMultipleTimesWithGuards01() throw "import foo.test.Destroy;", "import foo.test.Initialize;", "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2284,6 +2382,7 @@ public void multipleEventsWithoutUses_sameEventMultipleTimesWithGuards01() throw "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class MyAgent extends Agent {", " private int xxx;", @@ -2404,6 +2503,7 @@ public void multipleEventsWithoutUses_sameEventMultipleTimesWithGuards02() throw "import foo.test.Destroy;", "import foo.test.Initialize;", "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2415,6 +2515,7 @@ public void multipleEventsWithoutUses_sameEventMultipleTimesWithGuards02() throw "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class MyAgent extends Agent {", " private int xxx;", @@ -2539,6 +2640,7 @@ public void usePureCapacityFunction() throws Exception { "", "import foo.test.C1;", "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2552,6 +2654,7 @@ public void usePureCapacityFunction() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class MyAgent extends Agent {", " protected void testFct() {", @@ -2606,6 +2709,7 @@ public void useNotPureCapacityFunction() throws Exception { "", "import foo.test.C1;", "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2619,6 +2723,7 @@ public void useNotPureCapacityFunction() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class MyAgent extends Agent {", " protected void testFct() {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/BehaviorCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/BehaviorCompilerTest.java index b482fec762..236772017e 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/BehaviorCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/BehaviorCompilerTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -38,12 +39,14 @@ public class BehaviorCompilerTest extends AbstractSarlTest { public void basicBehaviorCompile() throws Exception { String source = "behavior B1 { }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @SyntheticMember", @@ -59,12 +62,14 @@ public void basicBehaviorCompile() throws Exception { @Test public void trueGuardBehaviorUnit() throws Exception { final String expectedE1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " @SyntheticMember", @@ -84,6 +89,7 @@ public void trueGuardBehaviorUnit() throws Exception { ); final String expectedB1 = multilineString( "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -91,6 +97,7 @@ public void trueGuardBehaviorUnit() throws Exception { "import java.util.Collection;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @SyntheticMember", @@ -130,12 +137,14 @@ public void trueGuardBehaviorUnit() throws Exception { @Test public void falseGuardBehaviorUnit() throws Exception { final String expectedE1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " @SyntheticMember", @@ -154,12 +163,14 @@ public void falseGuardBehaviorUnit() throws Exception { "" ); final String expectedB1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @SyntheticMember", @@ -186,6 +197,7 @@ public void falseGuardBehaviorUnit() throws Exception { @Test public void generalGuardBehaviorUnit() throws Exception { final String expectedE1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", @@ -193,6 +205,7 @@ public void generalGuardBehaviorUnit() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public int i;", @@ -251,6 +264,7 @@ public void generalGuardBehaviorUnit() throws Exception { ); final String expectedB1 = multilineString( "import io.sarl.lang.annotation.PerceptGuardEvaluator;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -259,6 +273,7 @@ public void generalGuardBehaviorUnit() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @SyntheticMember", @@ -312,6 +327,7 @@ public void valueVisibility_0() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -319,6 +335,7 @@ public void valueVisibility_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " private final int myval = 1;", @@ -367,6 +384,7 @@ public void variableVisibility_0() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -374,6 +392,7 @@ public void variableVisibility_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " private int myval = 1;", @@ -422,12 +441,14 @@ public void actionVisibility_0() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public void myfct() {", @@ -451,6 +472,7 @@ public void valueVisibility_1() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -458,6 +480,7 @@ public void valueVisibility_1() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " private final int myval = 1;", @@ -506,6 +529,7 @@ public void variableVisibility_1() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -513,6 +537,7 @@ public void variableVisibility_1() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " private int myval = 1;", @@ -561,12 +586,14 @@ public void actionVisibility_1() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " private void myfct() {", @@ -588,12 +615,14 @@ public void behaviormodifier_none() throws Exception { "behavior B1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @SyntheticMember", @@ -612,12 +641,14 @@ public void behaviormodifier_public() throws Exception { "public behavior B1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @SyntheticMember", @@ -636,12 +667,14 @@ public void behaviormodifier_package() throws Exception { "package behavior B1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "class B1 extends Behavior {", " @SyntheticMember", @@ -660,12 +693,14 @@ public void behaviormodifier_abstract() throws Exception { "abstract behavior B1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public abstract class B1 extends Behavior {", " @SyntheticMember", @@ -686,12 +721,14 @@ public void behaviormodifier_abstract_member() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public abstract class B1 extends Behavior {", " public abstract void fct();", @@ -712,12 +749,14 @@ public void behaviormodifier_final() throws Exception { "final behavior B1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public final class B1 extends Behavior {", " @SyntheticMember", @@ -738,6 +777,7 @@ public void fieldmodifier_none() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -745,6 +785,7 @@ public void fieldmodifier_none() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " private int field;", @@ -793,6 +834,7 @@ public void fieldmodifier_package() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -800,6 +842,7 @@ public void fieldmodifier_package() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " int field;", @@ -848,6 +891,7 @@ public void fieldmodifier_protected() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -855,6 +899,7 @@ public void fieldmodifier_protected() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " protected int field;", @@ -903,6 +948,7 @@ public void fieldmodifier_private() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -910,6 +956,7 @@ public void fieldmodifier_private() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " private int field;", @@ -960,12 +1007,14 @@ public void actionmodifier_override() throws Exception { "}" ); final String expectedB1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public abstract class B1 extends Behavior {", " public abstract void name();", @@ -978,11 +1027,13 @@ public void actionmodifier_override() throws Exception { "" ); final String expectedB2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B2 extends B1 {", " @Override", @@ -1011,12 +1062,14 @@ public void actionmodifier_none() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public void name() {", @@ -1040,12 +1093,14 @@ public void actionmodifier_private() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " private void name() {", @@ -1069,12 +1124,14 @@ public void actionmodifier_package() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " void name() {", @@ -1098,12 +1155,14 @@ public void actionmodifier_protected() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " protected void name() {", @@ -1127,12 +1186,14 @@ public void actionmodifier_abstract() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public abstract class B1 extends Behavior {", " public abstract void name();", @@ -1155,12 +1216,14 @@ public void actionmodifier_static() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public static void name() {", @@ -1184,12 +1247,14 @@ public void actionmodifier_dispatch() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public void _name(final Integer a) {", @@ -1218,12 +1283,14 @@ public void actionmodifier_final() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public final void name() {", @@ -1247,12 +1314,14 @@ public void actionmodifier_synchronized() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public synchronized void name() {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/CapacityCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/CapacityCompilerTest.java index ad95b60d03..1b2a2c697d 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/CapacityCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/CapacityCompilerTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -39,11 +40,13 @@ public class CapacityCompilerTest extends AbstractSarlTest { public void basicCapacityCompile() throws Exception { String source = "capacity C1 { }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -64,11 +67,13 @@ public void capacitymodifier_none() throws Exception { "capacity C1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -88,11 +93,13 @@ public void capacitymodifier_public() throws Exception { "public capacity C1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -112,11 +119,13 @@ public void capacitymodifier_private() throws Exception { "private capacity C1 { }" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -140,12 +149,14 @@ public void actionmodifier_override() throws Exception { "}" ); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void name();", @@ -169,11 +180,13 @@ public void actionmodifier_override() throws Exception { ); final String expectedC2 = multilineString( "import C1;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C2 extends C1 {", " @Override", @@ -211,12 +224,14 @@ public void actionmodifier_none() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void name();", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/EventCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/EventCompilerTest.java index 77d07c307f..f3c61f9a05 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/EventCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/EventCompilerTest.java @@ -21,6 +21,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -39,12 +40,14 @@ public class EventCompilerTest extends AbstractSarlTest { public void basicCompile_withBlock() throws Exception { String source = "event E1 { }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " @SyntheticMember", @@ -69,12 +72,14 @@ public void basicCompile_withBlock() throws Exception { public void basicCompile_withoutBlock() throws Exception { String source = "event E1"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " @SyntheticMember", @@ -103,6 +108,7 @@ public void withVarAttributesCompile() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", @@ -111,6 +117,7 @@ public void withVarAttributesCompile() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public String name;", @@ -182,11 +189,13 @@ public void inheritanceCompile() throws Exception { "}" ); final String expectedE2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E2 extends E1 {", " @SyntheticMember", @@ -219,12 +228,14 @@ public void noStaticField() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Event;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public final int titi = 4;", @@ -291,12 +302,14 @@ public void eventmodifier_none() throws Exception { "event E1" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " @SyntheticMember", @@ -322,12 +335,14 @@ public void eventmodifier_public() throws Exception { "public event E1" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " @SyntheticMember", @@ -353,12 +368,14 @@ public void eventmodifier_package() throws Exception { "package event E1" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "class E1 extends Event {", " @SyntheticMember", @@ -384,12 +401,14 @@ public void eventmodifier_final() throws Exception { "final event E1" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public final class E1 extends Event {", " @SyntheticMember", @@ -417,6 +436,7 @@ public void fieldmodifier_none() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", @@ -424,6 +444,7 @@ public void fieldmodifier_none() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public int field;", @@ -490,6 +511,7 @@ public void fieldmodifier_public() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Address;", @@ -497,6 +519,7 @@ public void fieldmodifier_public() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public int field;", @@ -563,11 +586,13 @@ public void constructormodifier_none() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public E1() {", @@ -589,11 +614,13 @@ public void constructormodifier_public() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public E1() {", @@ -615,11 +642,13 @@ public void constructormodifier_private() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " private E1() {", @@ -641,11 +670,13 @@ public void constructormodifier_package() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " E1() {", @@ -667,11 +698,13 @@ public void constructormodifier_protected() throws Exception { "}" ), multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " protected E1() {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/SkillCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/SkillCompilerTest.java index 8fc13f229c..43b393ade7 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/SkillCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/aop/SkillCompilerTest.java @@ -25,6 +25,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -58,6 +59,7 @@ public void fieldmodifier_none() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -65,6 +67,7 @@ public void fieldmodifier_none() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " private int field;", @@ -119,6 +122,7 @@ public void fieldmodifier_package() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -126,6 +130,7 @@ public void fieldmodifier_package() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " int field;", @@ -185,6 +190,7 @@ public void fieldmodifier_protected() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -192,6 +198,7 @@ public void fieldmodifier_protected() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " protected int field;", @@ -251,6 +258,7 @@ public void fieldmodifier_private() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -258,6 +266,7 @@ public void fieldmodifier_private() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " private int field;", @@ -317,6 +326,7 @@ public void fieldmodifier_public() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -324,6 +334,7 @@ public void fieldmodifier_public() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public int field;", @@ -383,6 +394,7 @@ public void fieldmodifier_final() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -390,6 +402,7 @@ public void fieldmodifier_final() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " private final int field = 5;", @@ -444,12 +457,14 @@ public void fieldmodifier_static() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " private static int field;", @@ -483,6 +498,7 @@ public void fieldmodifier_transient() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -490,6 +506,7 @@ public void fieldmodifier_transient() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " private transient int field;", @@ -549,6 +566,7 @@ public void fieldmodifier_volatile() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -556,6 +574,7 @@ public void fieldmodifier_volatile() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " private volatile int field;", @@ -609,11 +628,13 @@ public void accept(Result r) { @Test public void completeFinalFieldInitialization() throws Exception { final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -625,6 +646,7 @@ public void completeFinalFieldInitialization() throws Exception { "" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -633,6 +655,7 @@ public void completeFinalFieldInitialization() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " private final int field1 = 5;", @@ -713,12 +736,14 @@ public void actionmodifier_override() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public abstract class S1 extends Skill implements C1 {", " public abstract void name();", @@ -736,12 +761,14 @@ public void actionmodifier_override() throws Exception { "" ); final String expectedS2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S2 extends S1 implements Capacity {", " @Override", @@ -775,12 +802,14 @@ public void actionmodifier_none() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public void name() {", @@ -810,12 +839,14 @@ public void actionmodifier_public() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public void name() {", @@ -850,12 +881,14 @@ public void actionmodifier_protected() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " protected void name() {", @@ -890,12 +923,14 @@ public void actionmodifier_package() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " void name() {", @@ -930,12 +965,14 @@ public void actionmodifier_private() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " private void name() {", @@ -970,12 +1007,14 @@ public void actionmodifier_abstract_explicit() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public abstract class S1 extends Skill implements C1 {", " public abstract void name();", @@ -1004,12 +1043,14 @@ public void actionmodifier_abstract_implicit() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public abstract class S1 extends Skill implements C1 {", " public abstract void name();", @@ -1043,12 +1084,14 @@ public void actionmodifier_dispatch() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public void _name(final Integer a) {", @@ -1088,12 +1131,14 @@ public void actionmodifier_dispatch_final() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public final void _name(final Integer a) {", @@ -1133,12 +1178,14 @@ public void actionmodifier_final() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public final void name() {", @@ -1173,12 +1220,14 @@ public void actionmodifier_static() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public static void name() {", @@ -1213,12 +1262,14 @@ public void actionmodifier_synchronized() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public synchronized void name() {", @@ -1247,12 +1298,14 @@ public void accept(Result r) { @Test public void missedActionImplementation_0() throws Exception { final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void myaction1(final int a);", @@ -1275,12 +1328,14 @@ public void missedActionImplementation_0() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C2 extends Capacity {", " public abstract void myaction2(final float b, final boolean c);", @@ -1303,12 +1358,14 @@ public void missedActionImplementation_0() throws Exception { "" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1, C2 {", " public void myaction1(final int x) {", @@ -1361,11 +1418,13 @@ public static class ReturnTypeTest extends AbstractSarlTest { @Test public void compatibleReturnType_0() throws Exception { final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -1377,11 +1436,13 @@ public void compatibleReturnType_0() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C2 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C2 {", @@ -1393,6 +1454,7 @@ public void compatibleReturnType_0() throws Exception { "" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1400,6 +1462,7 @@ public void compatibleReturnType_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " @Inline(value = \"0.0\", constantExpression = true)", @@ -1420,12 +1483,14 @@ public void compatibleReturnType_0() throws Exception { "" ); final String expectedS2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S2 extends S1 implements C2 {", " @Inline(value = \"0.0\", constantExpression = true)", @@ -1473,11 +1538,13 @@ public void accept(Result r) { @Test public void compatibleReturnType_1() throws Exception { final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -1489,11 +1556,13 @@ public void compatibleReturnType_1() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C2 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C2 {", @@ -1505,6 +1574,7 @@ public void compatibleReturnType_1() throws Exception { "" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1512,6 +1582,7 @@ public void compatibleReturnType_1() throws Exception { "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " @Inline(value = \"0.0f\", constantExpression = true)", @@ -1532,12 +1603,14 @@ public void compatibleReturnType_1() throws Exception { "" ); final String expectedS2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S2 extends S1 implements C2 {", " @Inline(value = \"0.0f\", constantExpression = true)", @@ -1585,11 +1658,13 @@ public void accept(Result r) { @Test public void compatibleReturnType_2() throws Exception { final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -1601,6 +1676,7 @@ public void compatibleReturnType_2() throws Exception { "" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1608,6 +1684,7 @@ public void compatibleReturnType_2() throws Exception { "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " @Inline(value = \"0.0f\", constantExpression = true)", @@ -1647,12 +1724,14 @@ public void accept(Result r) { @Test public void compatibleReturnType_3() throws Exception { final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract float myaction(final int a);", @@ -1675,6 +1754,7 @@ public void compatibleReturnType_3() throws Exception { "" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1682,6 +1762,7 @@ public void compatibleReturnType_3() throws Exception { "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " @Inline(value = \"0.0f\", constantExpression = true)", @@ -1734,12 +1815,14 @@ public void skillmodifier_none() throws Exception { "skill S1 implements C1 { }" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " @SyntheticMember", @@ -1769,12 +1852,14 @@ public void skillmodifier_public() throws Exception { "public skill S1 implements C1 { }" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " @SyntheticMember", @@ -1804,12 +1889,14 @@ public void skillmodifier_package() throws Exception { "package skill S1 implements C1 { }" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "class S1 extends Skill implements C1 {", " @SyntheticMember", @@ -1839,12 +1926,14 @@ public void skillmodifier_abstract() throws Exception { "abstract skill S1 implements C1 { }" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public abstract class S1 extends Skill implements C1 {", " @SyntheticMember", @@ -1876,12 +1965,14 @@ public void skillmodifier_abstract_member() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public abstract class S1 extends Skill implements C1 {", " public abstract void name();", @@ -1913,12 +2004,14 @@ public void skillmodifier_final() throws Exception { "final skill S1 implements C1 { }" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public final class S1 extends Skill implements C1 {", " @SyntheticMember", @@ -1944,11 +2037,13 @@ public void accept(Result r) { @Test public void capacityAccessors_inSkill() throws Exception { final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract float myaction(final int a);", @@ -1982,11 +2077,13 @@ public void capacityAccessors_inSkill() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C2 extends Capacity {", " public abstract float myaction3(final int a);", @@ -2021,6 +2118,7 @@ public void capacityAccessors_inSkill() throws Exception { ); final String expectedS1 = multilineString( "import io.sarl.lang.annotation.ImportedCapacityFeature;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2031,6 +2129,7 @@ public void capacityAccessors_inSkill() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public float myaction(final int a) {", @@ -2102,12 +2201,14 @@ public void accept(Result r) { @Test public void inheritance_00() throws Exception { final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface CapTest1 extends Capacity {", " public abstract int func1();", @@ -2131,10 +2232,12 @@ public void inheritance_00() throws Exception { ); final String expectedC2 = multilineString( "import CapTest1;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface CapTest2 extends CapTest1 {", " public abstract void func2(final int a);", @@ -2179,6 +2282,7 @@ public void inheritance_01() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -2186,6 +2290,7 @@ public void inheritance_01() throws Exception { "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface CapTest1 extends Capacity {", " @DefaultValueSource", @@ -2232,10 +2337,12 @@ public void inheritance_01() throws Exception { ); final String expectedC2 = multilineString( "import CapTest1;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface CapTest2 extends CapTest1 {", " public abstract void func2(final int a);", @@ -2260,6 +2367,7 @@ public void inheritance_01() throws Exception { final String expectedS1 = multilineString( "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -2267,6 +2375,7 @@ public void inheritance_01() throws Exception { "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class SkillTest extends Skill implements CapTest2 {", " public void func2(final int a) {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/ArgDefaultValueCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/ArgDefaultValueCompilerTest.java index e31ecbc82b..5014223b12 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/ArgDefaultValueCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/ArgDefaultValueCompilerTest.java @@ -23,6 +23,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -59,6 +60,7 @@ public void action_1p_int() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -68,6 +70,7 @@ public void action_1p_int() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -117,6 +120,7 @@ public void action_1p_float() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -126,6 +130,7 @@ public void action_1p_float() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -175,6 +180,7 @@ public void action_1p_boolean() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -184,6 +190,7 @@ public void action_1p_boolean() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -233,6 +240,7 @@ public void action_1p_double() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -242,6 +250,7 @@ public void action_1p_double() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -291,6 +300,7 @@ public void action_1p_long() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -300,6 +310,7 @@ public void action_1p_long() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -349,6 +360,7 @@ public void action_1p_String() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -358,6 +370,7 @@ public void action_1p_String() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -407,6 +420,7 @@ public void action_1p_char() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -416,6 +430,7 @@ public void action_1p_char() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -466,6 +481,7 @@ public void action_1p_returnValue() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -475,6 +491,7 @@ public void action_1p_returnValue() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -525,6 +542,7 @@ public void action_5p_0() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -534,6 +552,7 @@ public void action_5p_0() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -583,6 +602,7 @@ public void action_5p_1() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -592,6 +612,7 @@ public void action_5p_1() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -641,6 +662,7 @@ public void action_5p_2() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -650,6 +672,7 @@ public void action_5p_2() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -699,6 +722,7 @@ public void action_5p_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -708,6 +732,7 @@ public void action_5p_3() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -757,6 +782,7 @@ public void action_5p_4() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -766,6 +792,7 @@ public void action_5p_4() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -815,6 +842,7 @@ public void action_5p_0_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -824,6 +852,7 @@ public void action_5p_0_3() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -893,6 +922,7 @@ public void action_5p_returnValue() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -902,6 +932,7 @@ public void action_5p_returnValue() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -952,6 +983,7 @@ public void action_3p_vararg_1() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -961,6 +993,7 @@ public void action_3p_vararg_1() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -1010,6 +1043,7 @@ public void action_3p_vararg_0() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -1019,6 +1053,7 @@ public void action_3p_vararg_0() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -1068,6 +1103,7 @@ public void action_3p_vararg_0_1() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -1077,6 +1113,7 @@ public void action_3p_vararg_0_1() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -1140,6 +1177,7 @@ public void action_3p_vararg_returnValue() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -1149,6 +1187,7 @@ public void action_3p_vararg_returnValue() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -1199,6 +1238,7 @@ public void action_4p_0_1_2_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -1208,6 +1248,7 @@ public void action_4p_0_1_2_3() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " @DefaultValueSource", @@ -1304,12 +1345,14 @@ public void constructor_1p_int() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1350,12 +1393,14 @@ public void constructor_1p_float() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1396,12 +1441,14 @@ public void constructor_1p_boolean() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1442,12 +1489,14 @@ public void constructor_1p_double() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1488,12 +1537,14 @@ public void constructor_1p_long() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1534,12 +1585,14 @@ public void constructor_1p_String() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1580,12 +1633,14 @@ public void constructor_1p_char() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1626,12 +1681,14 @@ public void constructor_5p_0() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1672,12 +1729,14 @@ public void constructor_5p_1() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1718,12 +1777,14 @@ public void constructor_5p_2() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1764,12 +1825,14 @@ public void constructor_5p_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1810,12 +1873,14 @@ public void constructor_5p_4() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1856,12 +1921,14 @@ public void constructor_5p_0_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1921,12 +1988,14 @@ public void constructor_3p_vararg_1() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -1967,12 +2036,14 @@ public void constructor_3p_vararg_0() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -2013,12 +2084,14 @@ public void constructor_3p_vararg_0_1() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -2072,12 +2145,14 @@ public void constructor_4p_0_1_2_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " @DefaultValueSource", @@ -2161,6 +2236,7 @@ public void capacity() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -2168,6 +2244,7 @@ public void capacity() throws Exception { "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " @DefaultValueSource", @@ -2272,6 +2349,7 @@ public void overridingCapacitySkill() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -2279,6 +2357,7 @@ public void overridingCapacitySkill() throws Exception { "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " @DefaultValueSource", @@ -2348,12 +2427,14 @@ public void overridingCapacitySkill() throws Exception { final String expectedS1 = multilineString( "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public void capAction() {", @@ -2396,6 +2477,7 @@ public void missedActionImplementation() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -2403,6 +2485,7 @@ public void missedActionImplementation() throws Exception { "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " @DefaultValueSource", @@ -2451,6 +2534,7 @@ public void missedActionImplementation() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -2458,6 +2542,7 @@ public void missedActionImplementation() throws Exception { "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C2 extends Capacity {", " @DefaultValueSource", @@ -2505,12 +2590,14 @@ public void missedActionImplementation() throws Exception { final String expectedS1 = multilineString( "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1, C2 {", " @DefaultValueSource", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/BreakKeywordTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/BreakKeywordTest.java index 42c5bae527..bb632649dc 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/BreakKeywordTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/BreakKeywordTest.java @@ -59,6 +59,7 @@ public void insideFunction() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -67,6 +68,7 @@ public void insideFunction() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct() {", @@ -100,6 +102,7 @@ public void insideIfThen() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -108,6 +111,7 @@ public void insideIfThen() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -141,6 +145,7 @@ public void insideField() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -151,6 +156,7 @@ public void insideField() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Procedure1 field = ((Procedure1) (Object it) -> {", @@ -201,6 +207,7 @@ public void insideWhileWithoutBranch() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -209,6 +216,7 @@ public void insideWhileWithoutBranch() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -250,6 +258,7 @@ public void insideWhileWithBranch() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -258,6 +267,7 @@ public void insideWhileWithBranch() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -301,6 +311,7 @@ public void insideDoWhileWithoutBranch() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -309,6 +320,7 @@ public void insideDoWhileWithoutBranch() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -350,6 +362,7 @@ public void insideDoWhileWithBranch() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -358,6 +371,7 @@ public void insideDoWhileWithBranch() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -399,6 +413,7 @@ public void insideForWithoutBranch() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -408,6 +423,7 @@ public void insideForWithoutBranch() throws Exception { "import org.eclipse.xtext.xbase.lib.IntegerRange;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -444,6 +460,7 @@ public void insideForWithBranch() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -453,6 +470,7 @@ public void insideForWithBranch() throws Exception { "import org.eclipse.xtext.xbase.lib.IntegerRange;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -491,6 +509,7 @@ public void insideBasicForWithoutBranch() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -499,6 +518,7 @@ public void insideBasicForWithoutBranch() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -534,6 +554,7 @@ public void insideBasicForWithBranch() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -542,6 +563,7 @@ public void insideBasicForWithBranch() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", @@ -582,6 +604,7 @@ public void unreachableCode() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -592,6 +615,7 @@ public void unreachableCode() throws Exception { "import org.eclipse.xtext.xbase.lib.IntegerRange;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void fct(final int a) {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/CloneFunctionTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/CloneFunctionTest.java index b7fbd5d085..f5cafdbdc7 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/CloneFunctionTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/CloneFunctionTest.java @@ -56,11 +56,13 @@ public void noClone_noInheritance_noGeneric() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 implements Cloneable {", " @Override", @@ -91,11 +93,13 @@ public void clone_noInheritance_noGeneric() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 implements Cloneable {", " @Pure", @@ -122,11 +126,13 @@ public void noClone_inheritance_noGeneric() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @Override", @@ -162,11 +168,13 @@ public void clone_inheritance_noGeneric() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @Pure", @@ -192,11 +200,13 @@ public void noClone_noInheritance_generic() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 implements Cloneable {", " @Override", @@ -227,11 +237,13 @@ public void clone_noInheritance_generic() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 implements Cloneable {", " @Pure", @@ -258,11 +270,13 @@ public void noClone_inheritance_generic() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @Override", @@ -298,11 +312,13 @@ public void clone_inheritance_generic() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @Pure", @@ -331,10 +347,12 @@ public void finalInheritedClone() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @SyntheticMember", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/EqualsFunctionTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/EqualsFunctionTest.java index a600cf28f6..e7e61fb536 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/EqualsFunctionTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/EqualsFunctionTest.java @@ -56,10 +56,12 @@ public void noField_noFinalEquals_noFinalHashCode_noEquals_noHashCode() throws E "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @SyntheticMember", @@ -79,11 +81,13 @@ public void field_noFinalEquals_noFinalHashCode_noEquals_noHashCode() throws Exc "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private int field;", @@ -133,10 +137,12 @@ public void noField_finalEquals_noFinalHashCode_noEquals_noHashCode() throws Exc "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @SyntheticMember", @@ -161,10 +167,12 @@ public void field_finalEquals_noFinalHashCode_noEquals_noHashCode() throws Excep "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " private int field;", @@ -190,10 +198,12 @@ public void noField_noFinalEquals_finalHashCode_noEquals_noHashCode() throws Exc "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @SyntheticMember", @@ -218,10 +228,12 @@ public void field_noFinalEquals_finalHashCode_noEquals_noHashCode() throws Excep "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " private int field;", @@ -248,10 +260,12 @@ public void noField_finalEquals_finalHashCode_noEquals_noHashCode() throws Excep "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @SyntheticMember", @@ -277,10 +291,12 @@ public void field_finalEquals_finalHashCode_noEquals_noHashCode() throws Excepti "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " private int field;", @@ -306,11 +322,13 @@ public void noField_noFinalEquals_noFinalHashCode_equals_noHashCode() throws Exc "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Pure", @@ -338,11 +356,13 @@ public void field_noFinalEquals_noFinalHashCode_equals_noHashCode() throws Excep "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private int field;", @@ -384,11 +404,13 @@ public void noField_noFinalEquals_finalHashCode_equals_noHashCode() throws Excep "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @Pure", @@ -419,11 +441,13 @@ public void field_noFinalEquals_finalHashCode_equals_noHashCode() throws Excepti "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " private int field;", @@ -454,11 +478,13 @@ public void noField_noFinalEquals_noFinalHashCode_noEquals_hashCode() throws Exc "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Pure", @@ -486,11 +512,13 @@ public void field_noFinalEquals_noFinalHashCode_noEquals_hashCode() throws Excep "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private int field;", @@ -538,11 +566,13 @@ public void noField_finalEquals_noFinalHashCode_noEquals_hashCode() throws Excep "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " @Pure", @@ -573,11 +603,13 @@ public void field_finalEquals_noFinalHashCode_noEquals_hashCode() throws Excepti "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 extends C0 {", " private int field;", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/GeneralSyntaxTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/GeneralSyntaxTest.java index ed114805b9..cf6eb24f6c 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/GeneralSyntaxTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/GeneralSyntaxTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; @@ -44,10 +45,12 @@ public void noParamNoReturnActionInClass() throws Exception { "}", ""); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class Light {", " public abstract void turnOn();", @@ -73,9 +76,11 @@ public void noParamNoReturnActionInInterface() throws Exception { "}", ""); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface Light {", " public abstract void turnOn();", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/InlineFunctionTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/InlineFunctionTest.java index b5c6071d51..3f42c03346 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/InlineFunctionTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/InlineFunctionTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; @@ -51,10 +52,12 @@ public void noInlineWithStaticInheritedAnnotation() throws Exception { "}", ""); final String expectedC3 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C3 {", " public int fct2() {", @@ -90,10 +93,12 @@ public void inlineWithStaticDirectAnnotation() throws Exception { "}", ""); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C2 {", " public int fct2() {", @@ -132,10 +137,12 @@ public void noInlineWithInheritedAnnotation() throws Exception { "}", ""); final String expectedC3 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C3 {", " public int fct2() {", @@ -171,10 +178,12 @@ public void inlineWithDirectAnnotation() throws Exception { "}", ""); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C2 {", " public int fct2() {", @@ -203,11 +212,13 @@ public void booleanLiteral_true() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"true\", constantExpression = true)", @@ -235,11 +246,13 @@ public void booleanLiteral_false() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"false\", constantExpression = true)", @@ -267,11 +280,13 @@ public void nullLiteral() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"null\", constantExpression = true)", @@ -299,11 +314,13 @@ public void numberLiteral() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"123.456\", constantExpression = true)", @@ -331,11 +348,13 @@ public void numericExpression() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"140.45600000000002\", constantExpression = true)", @@ -363,11 +382,13 @@ public void stringLiteral() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"\\\"abc\\\"\", constantExpression = true)", @@ -395,11 +416,13 @@ public void stringExpression() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"\\\"abcxyz\\\"\", constantExpression = true)", @@ -427,11 +450,13 @@ public void typeLiteral() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"Integer.class\", constantExpression = true)", @@ -459,11 +484,13 @@ public void typeExpression() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"Integer.class\", constantExpression = true)", @@ -491,11 +518,13 @@ public void castOperator() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"(Integer)null\", constantExpression = true)", @@ -523,11 +552,13 @@ public void instanceofOperator() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"null instanceof Integer\", constantExpression = true)", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/PureFunctionTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/PureFunctionTest.java index beecb01b8d..814b1e82a7 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/PureFunctionTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/PureFunctionTest.java @@ -25,6 +25,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; @@ -59,10 +60,12 @@ public void noPureParent_noPureLocal() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public double fct() {", @@ -77,10 +80,12 @@ public void noPureParent_noPureLocal() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C2 extends C1 {", " @Override", @@ -112,10 +117,12 @@ public void noPureParent_pureLocal_tooComplexToBeDetected() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public double fct() {", @@ -130,11 +137,13 @@ public void noPureParent_pureLocal_tooComplexToBeDetected() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C2 extends C1 {", " @Override", @@ -170,10 +179,12 @@ public void pureParent_pureLocal_tooComplexToBeDetected() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void fct() {", @@ -187,10 +198,12 @@ public void pureParent_pureLocal_tooComplexToBeDetected() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C2 extends C1 {", " @Override", @@ -226,10 +239,12 @@ public void abstractParent_noPureLocal() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class C1 {", " public abstract double fct();", @@ -242,10 +257,12 @@ public void abstractParent_noPureLocal() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C2 extends C1 {", " @Override", @@ -277,10 +294,12 @@ public void abstractParent_pureLocal_tooComplexToBeDetected() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public abstract class C1 {", " public abstract double fct();", @@ -293,11 +312,13 @@ public void abstractParent_pureLocal_tooComplexToBeDetected() throws Exception { "" ); final String expectedC2 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C2 extends C1 {", " @Override", @@ -330,12 +351,14 @@ public void special_get() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Pure", @@ -362,12 +385,14 @@ public void special_is() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Pure", @@ -394,12 +419,14 @@ public void special_has() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Pure", @@ -426,12 +453,14 @@ public void special_toString() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Pure", @@ -458,12 +487,14 @@ public void special_hashCode() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Pure", @@ -490,12 +521,14 @@ public void special_equals() throws Exception { "}", ""); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Pure", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/SARLMapExtensionsCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/SARLMapExtensionsCompilerTest.java index 35c1e9e162..7d2ec55765 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/SARLMapExtensionsCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/SARLMapExtensionsCompilerTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -52,6 +53,7 @@ public void operator_addMapPair_0() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -64,6 +66,7 @@ public void operator_addMapPair_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map;", @@ -141,6 +144,7 @@ public void operator_addMapPair_1() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -153,6 +157,7 @@ public void operator_addMapPair_1() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map;", @@ -232,6 +237,7 @@ public void operator_addMapMap_0() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -242,6 +248,7 @@ public void operator_addMapMap_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map1;", @@ -301,6 +308,7 @@ public void operator_plusMapPair_0() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -313,6 +321,7 @@ public void operator_plusMapPair_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map;", @@ -394,6 +403,7 @@ public void operator_plusMapPair_1() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -406,6 +416,7 @@ public void operator_plusMapPair_1() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map;", @@ -489,6 +500,7 @@ public void operator_plusMapMap_0() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -499,6 +511,7 @@ public void operator_plusMapMap_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map1;", @@ -560,6 +573,7 @@ public void operator_plusMapMap_1() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -570,6 +584,7 @@ public void operator_plusMapMap_1() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map1;", @@ -631,6 +646,7 @@ public void operator_plusMapMap_2() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -641,6 +657,7 @@ public void operator_plusMapMap_2() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map1;", @@ -703,6 +720,7 @@ public void operator_removeMapK_0() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -714,6 +732,7 @@ public void operator_removeMapK_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map;", @@ -792,6 +811,7 @@ public void operator_minusMapK_0() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -804,6 +824,7 @@ public void operator_minusMapK_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private Map map;", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/SARLTimeExtensionsCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/SARLTimeExtensionsCompilerTest.java index aad33e1d71..6f62cc325b 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/SARLTimeExtensionsCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/SARLTimeExtensionsCompilerTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -48,6 +49,7 @@ public void milliseconds() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -56,6 +58,7 @@ public void milliseconds() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected Object myaction0() {", @@ -91,6 +94,7 @@ public void seconds() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -99,6 +103,7 @@ public void seconds() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected Object myaction0() {", @@ -134,6 +139,7 @@ public void minutes() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -142,6 +148,7 @@ public void minutes() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected Object myaction0() {", @@ -177,6 +184,7 @@ public void hours() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -185,6 +193,7 @@ public void hours() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected Object myaction0() {", @@ -220,6 +229,7 @@ public void days() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -228,6 +238,7 @@ public void days() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected Object myaction0() {", @@ -263,6 +274,7 @@ public void weeks() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.ste;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -271,6 +283,7 @@ public void weeks() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected Object myaction0() {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/VarArgsCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/VarArgsCompilerTest.java index b9b02c0bed..259414828b 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/VarArgsCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/VarArgsCompilerTest.java @@ -25,6 +25,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -59,6 +60,7 @@ public void action_singleParam() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -67,6 +69,7 @@ public void action_singleParam() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void myaction(final int... arg) {", @@ -99,6 +102,7 @@ public void action() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -107,6 +111,7 @@ public void action() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void myaction(final char arg1, final boolean arg2, final int... arg3) {", @@ -146,12 +151,14 @@ public void action_singleParam() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public void myaction(final int... arg) {", @@ -178,12 +185,14 @@ public void action() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public void myaction(final char arg1, final boolean arg2, final int... arg3) {", @@ -211,10 +220,12 @@ public void constructor_singleParam() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public B1(final int... arg) {", @@ -238,10 +249,12 @@ public void constructor() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.Behavior;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_BEHAVIOR + ")", "@SuppressWarnings(\"all\")", "public class B1 extends Behavior {", " public B1(final char arg1, final boolean arg2, final int... arg3) {", @@ -269,12 +282,14 @@ public void action_singleParam() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void myaction(final int... arg);", @@ -307,12 +322,14 @@ public void action() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public abstract void myaction(final char arg1, final boolean arg2, final int... arg3);", @@ -354,11 +371,13 @@ public void action_singleParam() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public E1(final int... arg) {", @@ -383,11 +402,13 @@ public void constructor() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Event;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_EVENT + ")", "@SuppressWarnings(\"all\")", "public class E1 extends Event {", " public E1(final char arg1, final boolean arg2, final int... arg3) {", @@ -420,11 +441,13 @@ public void action_singleParam() throws Exception { "}" ); final String expectedC1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.AgentTrait;", "import io.sarl.lang.core.Capacity;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CAPACITY + ")", "@SuppressWarnings(\"all\")", "public interface C1 extends Capacity {", " public static class ContextAwareCapacityWrapper extends Capacity.ContextAwareCapacityWrapper implements C1 {", @@ -436,12 +459,14 @@ public void action_singleParam() throws Exception { "" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public void myaction(final int... arg) {", @@ -477,12 +502,14 @@ public void action() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public void myaction(final char arg1, final boolean arg2, final int... arg3) {", @@ -520,10 +547,12 @@ public void inSkillConstructor_singleParam() throws Exception { "}" ); final String expectedS1 = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public S1(final int... arg) {", @@ -551,10 +580,12 @@ public void inSkillConstructor() throws Exception { "}" ); final String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.core.Skill;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_SKILL + ")", "@SuppressWarnings(\"all\")", "public class S1 extends Skill implements C1 {", " public S1(final char arg1, final boolean arg2, final int... arg3) {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/VarDeclarationCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/VarDeclarationCompilerTest.java index 0d84ee0e03..047989cbd3 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/VarDeclarationCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/general/VarDeclarationCompilerTest.java @@ -20,6 +20,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -45,6 +46,7 @@ public void variableDeclaration_attributeScope() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -55,6 +57,7 @@ public void variableDeclaration_attributeScope() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private List list;", @@ -124,6 +127,7 @@ public void variableDeclaration_localScope() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -133,6 +137,7 @@ public void variableDeclaration_localScope() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void myaction() {", @@ -171,6 +176,7 @@ public void valueDeclaration_attributeScope() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -181,6 +187,7 @@ public void valueDeclaration_attributeScope() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private final List list = null;", @@ -247,6 +254,7 @@ public void valueDeclaration_localScope() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -255,6 +263,7 @@ public void valueDeclaration_localScope() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void myaction() {", @@ -294,6 +303,7 @@ public void forLoop_inferredType() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -304,6 +314,7 @@ public void forLoop_inferredType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private List list;", @@ -359,6 +370,7 @@ public void forLoop_explicitType() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -369,6 +381,7 @@ public void forLoop_explicitType() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " private List list;", @@ -425,6 +438,7 @@ public void catch_oneType() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -434,6 +448,7 @@ public void catch_oneType() throws Exception { "import org.eclipse.xtext.xbase.lib.Exceptions;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void myaction() {", @@ -483,6 +498,7 @@ public void multicatch_oneType() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -492,6 +508,7 @@ public void multicatch_oneType() throws Exception { "import org.eclipse.xtext.xbase.lib.Exceptions;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected void myaction() {", @@ -541,6 +558,7 @@ public void closure_twoParams() throws Exception { "}" ); String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -550,6 +568,7 @@ public void closure_twoParams() throws Exception { "import org.eclipse.xtext.xbase.lib.Functions.Function2;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class A1 extends Agent {", " protected float mycall(final int a, final Function2 f) {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/AnnotationTypeCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/AnnotationTypeCompilerTest.java index 3b929a3aab..7a87480506 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/AnnotationTypeCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/AnnotationTypeCompilerTest.java @@ -23,6 +23,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -49,9 +50,11 @@ public static class TopLevelTest extends AbstractSarlTest { public void basic() throws Exception { String source = "annotation A1 { }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", "public @interface A1 {", "}", "" @@ -63,9 +66,11 @@ public void basic() throws Exception { public void variable_0() throws Exception { String source = "annotation A1 { var v = 45 }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", "public @interface A1 {", " public int v() default 45;", "}", @@ -78,9 +83,11 @@ public void variable_0() throws Exception { public void variable_1() throws Exception { String source = "annotation A1 { var v : int }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", "public @interface A1 {", " public int v();", "}", @@ -93,9 +100,11 @@ public void variable_1() throws Exception { public void value_0() throws Exception { String source = "annotation A1 { val v = 45 }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", "public @interface A1 {", " public int v() default 45;", "}", @@ -108,9 +117,11 @@ public void value_0() throws Exception { public void value_1() throws Exception { String source = "annotation A1 { val v : int }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", "public @interface A1 {", " public int v();", "}", @@ -130,13 +141,16 @@ public static class InClassTest extends AbstractSarlTest { public void basic() throws Exception { String source = "class Container { annotation A1 { } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", " public @interface A1 {", " }", " ", @@ -154,13 +168,16 @@ public void basic() throws Exception { public void variable() throws Exception { String source = "class Container { annotation A1 { var v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", " public @interface A1 {", " public int v() default 45;", " }", @@ -179,13 +196,16 @@ public void variable() throws Exception { public void value() throws Exception { String source = "class Container { annotation A1 { val v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", " public @interface A1 {", " public int v() default 45;", " }", @@ -211,6 +231,7 @@ public static class InAgentTest extends AbstractSarlTest { public void basic() throws Exception { String source = "agent Container { annotation A1 { } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -219,9 +240,11 @@ public void basic() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", " protected @interface A1 {", " }", " ", @@ -245,6 +268,7 @@ public void basic() throws Exception { public void variable() throws Exception { String source = "agent Container { annotation A1 { var v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -253,9 +277,11 @@ public void variable() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", " protected @interface A1 {", " public int v() default 45;", " }", @@ -280,6 +306,7 @@ public void variable() throws Exception { public void value() throws Exception { String source = "agent Container { annotation A1 { val v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -288,9 +315,11 @@ public void value() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_ANNOTATION_TYPE + ")", " protected @interface A1 {", " public int v() default 45;", " }", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/ClassCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/ClassCompilerTest.java index 6f4beb7171..4148f10b06 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/ClassCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/ClassCompilerTest.java @@ -25,6 +25,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -52,10 +53,12 @@ public static class TopLevelTest extends AbstractSarlTest { public void basic() throws Exception { String source = "class C1 { }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @SyntheticMember", @@ -72,11 +75,13 @@ public void basic() throws Exception { public void variable() throws Exception { String source = "class C1 { var v = 45 }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private int v = 45;", @@ -121,11 +126,13 @@ public void variable() throws Exception { public void value() throws Exception { String source = "class C1 { val v = 45 }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private final int v = 45;", @@ -170,11 +177,13 @@ public void value() throws Exception { public void method_0() throws Exception { String source = "class C1 { def fct { 4 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"4\", constantExpression = true)", @@ -196,10 +205,12 @@ public void method_0() throws Exception { public void method_1() throws Exception { String source = "class C1 { def fct(a : int) { a } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public int fct(final int a) {", @@ -220,11 +231,13 @@ public void method_1() throws Exception { public void method_2() throws Exception { String source = "class C1 { def fct(a : int*) { 5 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @Inline(value = \"5\", constantExpression = true)", @@ -249,12 +262,14 @@ public void method_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " @DefaultValueSource", @@ -306,12 +321,14 @@ public void methodOverriding_explicitReturnType() throws Exception { final String expectedPerson = multilineString( "package io.sarl.docs.reference.oop;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.util.Objects;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Person {", " private String firstName;", @@ -364,12 +381,14 @@ public void methodOverriding_explicitReturnType() throws Exception { "package io.sarl.docs.reference.oop;", "", "import io.sarl.docs.reference.oop.Person;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import java.util.Objects;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class PersonEx extends Person {", " private String title;", @@ -488,13 +507,16 @@ public static class InClassTest extends AbstractSarlTest { public void basic() throws Exception { String source = "class Container { class C1 { } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " public class C1 {", " @SyntheticMember", " public C1() {", @@ -516,14 +538,17 @@ public void basic() throws Exception { public void variable() throws Exception { String source = "class Container { class C1 { var v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " public class C1 {", " private int v = 45;", " ", @@ -573,14 +598,17 @@ public void variable() throws Exception { public void value() throws Exception { String source = "class Container { class C1 { val v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " public class C1 {", " private final int v = 45;", " ", @@ -630,14 +658,17 @@ public void value() throws Exception { public void method_0() throws Exception { String source = "class Container { class C1 { def fct { 4 } } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " public class C1 {", " @Inline(value = \"4\", constantExpression = true)", " public int fct() {", @@ -664,13 +695,16 @@ public void method_0() throws Exception { public void method_1() throws Exception { String source = "class Container { class C1 { def fct(a : int) { a } } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " public class C1 {", " public int fct(final int a) {", " return a;", @@ -696,14 +730,17 @@ public void method_1() throws Exception { public void method_2() throws Exception { String source = "class Container { class C1 { def fct(a : int*) { 5 } } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " public class C1 {", " @Inline(value = \"5\", constantExpression = true)", " public int fct(final int... a) {", @@ -733,15 +770,18 @@ public void method_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " public class C1 {", " @DefaultValueSource", " @Inline(value = \"5\", constantExpression = true)", @@ -789,6 +829,7 @@ public static class InAgentTest extends AbstractSarlTest { public void basic() throws Exception { String source = "agent Container { class C1 { } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -797,9 +838,11 @@ public void basic() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " protected class C1 {", " @SyntheticMember", " public C1() {", @@ -827,6 +870,7 @@ public void basic() throws Exception { public void variable() throws Exception { String source = "agent Container { class C1 { var v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -836,9 +880,11 @@ public void variable() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " protected class C1 {", " private int v = 45;", " ", @@ -894,6 +940,7 @@ public void variable() throws Exception { public void value() throws Exception { String source = "agent Container { class C1 { val v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -903,9 +950,11 @@ public void value() throws Exception { "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " protected class C1 {", " private final int v = 45;", " ", @@ -961,6 +1010,7 @@ public void value() throws Exception { public void method_0() throws Exception { String source = "agent Container { class C1 { def fct { 4 } } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -970,9 +1020,11 @@ public void method_0() throws Exception { "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " protected class C1 {", " @Inline(value = \"4\", constantExpression = true)", " public int fct() {", @@ -1005,6 +1057,7 @@ public void method_0() throws Exception { public void method_1() throws Exception { String source = "agent Container { class C1 { def fct(a : int) { a } } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1013,9 +1066,11 @@ public void method_1() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " protected class C1 {", " public int fct(final int a) {", " return a;", @@ -1047,6 +1102,7 @@ public void method_1() throws Exception { public void method_2() throws Exception { String source = "agent Container { class C1 { def fct(a : int*) { 5 } } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -1056,9 +1112,11 @@ public void method_2() throws Exception { "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " protected class C1 {", " @Inline(value = \"5\", constantExpression = true)", " public int fct(final int... a) {", @@ -1094,6 +1152,7 @@ public void method_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -1104,9 +1163,11 @@ public void method_3() throws Exception { "import org.eclipse.xtext.xbase.lib.Inline;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_CLASS + ")", " protected class C1 {", " @DefaultValueSource", " @Inline(value = \"5\", constantExpression = true)", @@ -1168,11 +1229,13 @@ public void classGeneric_X() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private X x;", @@ -1223,11 +1286,13 @@ public void classGeneric_XextendsNumber() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private X x;", @@ -1279,12 +1344,14 @@ public void classGeneric_XY() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private X x;", @@ -1342,12 +1409,14 @@ public void classGeneric_XYextendsX() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import org.eclipse.xtext.xbase.lib.Inline;", "import org.eclipse.xtext.xbase.lib.Pure;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " private X x;", @@ -1402,10 +1471,12 @@ public void functionGeneric_X_sarlNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void setX(final X param) {", @@ -1432,10 +1503,12 @@ public void functionGeneric_X_javaNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void setX(final X param) {", @@ -1462,10 +1535,12 @@ public void functionGeneric_XextendsNumber_sarlNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void setX(final X param) {", @@ -1492,10 +1567,12 @@ public void functionGeneric_XextendsNumber_javaNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void setX(final X param) {", @@ -1522,10 +1599,12 @@ public void functionGeneric_XY_sarlNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void setX(final X param) {", @@ -1553,10 +1632,12 @@ public void functionGeneric_XY_javaNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void setX(final X param) {", @@ -1584,10 +1665,12 @@ public void functionGeneric_XYextendsX_sarlNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void setX(final X param) {", @@ -1615,10 +1698,12 @@ public void functionGeneric_XYextendsX_javaNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class C1 {", " public void setX(final X param) {", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/EnumCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/EnumCompilerTest.java index de38a41afa..ca74c45ba2 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/EnumCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/EnumCompilerTest.java @@ -23,6 +23,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -49,9 +50,11 @@ public static class TopLevelTest extends AbstractSarlTest { public void basic() throws Exception { String source = "enum E1 { CST1, CST2 }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_ENUMERATION + ")", "@SuppressWarnings(\"all\")", "public enum E1 {", " CST1,", @@ -74,13 +77,16 @@ public static class InClassTest extends AbstractSarlTest { public void basic() throws Exception { String source = "class Container { enum E1 { CST1, CST2 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_ENUMERATION + ")", " public enum E1 {", " CST1,", " ", @@ -108,6 +114,7 @@ public static class InAgentTest extends AbstractSarlTest { public void basic() throws Exception { String source = "agent Container { enum E1 { CST1, CST2 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -116,9 +123,11 @@ public void basic() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_ENUMERATION + ")", " protected enum E1 {", " CST1,", " ", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/InterfaceCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/InterfaceCompilerTest.java index 7b7bcebd4b..5252897cd9 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/InterfaceCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/general/compilation/oop/InterfaceCompilerTest.java @@ -23,6 +23,7 @@ import org.junit.runners.Suite.SuiteClasses; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; /** @@ -50,9 +51,11 @@ public static class TopLevelTest extends AbstractSarlTest { public void basic() throws Exception { String source = "interface I1 { }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", "}", @@ -65,9 +68,11 @@ public void basic() throws Exception { public void variable() throws Exception { String source = "interface I1 { var v = 45 }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public static int v = 45;", @@ -81,9 +86,11 @@ public void variable() throws Exception { public void value() throws Exception { String source = "interface I1 { val v = 45 }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public final static int v = 45;", @@ -97,10 +104,12 @@ public void value() throws Exception { public void method_0() throws Exception { String source = "interface I1 { def fct }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void fct();", @@ -114,10 +123,12 @@ public void method_0() throws Exception { public void method_1() throws Exception { String source = "interface I1 { def fct(a : int) }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void fct(final int a);", @@ -131,10 +142,12 @@ public void method_1() throws Exception { public void method_2() throws Exception { String source = "interface I1 { def fct(a : int*) }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void fct(final int... a);", @@ -151,11 +164,13 @@ public void method_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " @DefaultValueSource", @@ -183,10 +198,12 @@ public void method_3() throws Exception { public void method_4() throws Exception { String source = "interface I1 { def fct(a : int) : float { a + 1f } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public default float fct(final int a) {", @@ -205,11 +222,13 @@ public void method_5() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " @DefaultValueSource", @@ -246,13 +265,16 @@ public static class InClassTest extends AbstractSarlTest { public void basic() throws Exception { String source = "class Container { interface I1 { } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " public interface I1 {", " }", " ", @@ -270,13 +292,16 @@ public void basic() throws Exception { public void variable() throws Exception { String source = "class Container { interface I1 { var v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " public interface I1 {", " public static int v = 45;", " }", @@ -295,13 +320,16 @@ public void variable() throws Exception { public void value() throws Exception { String source = "class Container { interface I1 { val v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " public interface I1 {", " public final static int v = 45;", " }", @@ -320,14 +348,17 @@ public void value() throws Exception { public void method_0() throws Exception { String source = "class Container { interface I1 { def fct } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @FunctionalInterface", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " public interface I1 {", " public abstract void fct();", " }", @@ -346,14 +377,17 @@ public void method_0() throws Exception { public void method_1() throws Exception { String source = "class Container { interface I1 { def fct(a : int) } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @FunctionalInterface", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " public interface I1 {", " public abstract void fct(final int a);", " }", @@ -372,14 +406,17 @@ public void method_1() throws Exception { public void method_2() throws Exception { String source = "class Container { interface I1 { def fct(a : int*) } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @FunctionalInterface", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " public interface I1 {", " public abstract void fct(final int... a);", " }", @@ -401,14 +438,17 @@ public void method_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_CLASS + ")", "@SuppressWarnings(\"all\")", "public class Container {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " public interface I1 {", " @DefaultValueSource", " public abstract void fct(@DefaultValue(\"Container$I1#FCT_0\") final int a);", @@ -448,6 +488,7 @@ public static class InAgentTest extends AbstractSarlTest { public void basic() throws Exception { String source = "agent Container { interface I1 { } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -456,9 +497,11 @@ public void basic() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " protected interface I1 {", " }", " ", @@ -482,6 +525,7 @@ public void basic() throws Exception { public void variable() throws Exception { String source = "agent Container { interface I1 { var v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -490,9 +534,11 @@ public void variable() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " protected interface I1 {", " public static int v = 45;", " }", @@ -517,6 +563,7 @@ public void variable() throws Exception { public void value() throws Exception { String source = "agent Container { interface I1 { val v = 45 } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -525,9 +572,11 @@ public void value() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " protected interface I1 {", " public final static int v = 45;", " }", @@ -552,6 +601,7 @@ public void value() throws Exception { public void method_0() throws Exception { String source = "agent Container { interface I1 { def fct } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -560,10 +610,12 @@ public void method_0() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @FunctionalInterface", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " protected interface I1 {", " public abstract void fct();", " }", @@ -588,6 +640,7 @@ public void method_0() throws Exception { public void method_1() throws Exception { String source = "agent Container { interface I1 { def fct(a : int) } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -596,10 +649,12 @@ public void method_1() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @FunctionalInterface", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " protected interface I1 {", " public abstract void fct(final int a);", " }", @@ -624,6 +679,7 @@ public void method_1() throws Exception { public void method_2() throws Exception { String source = "agent Container { interface I1 { def fct(a : int*) } }"; String expected = multilineString( + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -632,10 +688,12 @@ public void method_2() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @FunctionalInterface", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " protected interface I1 {", " public abstract void fct(final int... a);", " }", @@ -663,6 +721,7 @@ public void method_3() throws Exception { "import io.sarl.lang.annotation.DefaultValue;", "import io.sarl.lang.annotation.DefaultValueSource;", "import io.sarl.lang.annotation.DefaultValueUse;", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSourceCode;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", @@ -672,9 +731,11 @@ public void method_3() throws Exception { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class Container extends Agent {", " @SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + " @SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", " protected interface I1 {", " @DefaultValueSource", " public abstract void fct(@DefaultValue(\"Container$I1#FCT_0\") final int a);", @@ -727,9 +788,11 @@ public void interfaceGeneric_X() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -752,9 +815,11 @@ public void interfaceGeneric_XextendsNumber() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -778,9 +843,11 @@ public void interfaceGeneric_XY() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract Y getY();", @@ -806,9 +873,11 @@ public void interfaceGeneric_XYextendsX() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract Y getY();", @@ -832,10 +901,12 @@ public void functionGeneric_X_sarlNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -855,10 +926,12 @@ public void functionGeneric_X_javaNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -878,10 +951,12 @@ public void functionGeneric_XextendsNumber_sarlNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -901,10 +976,12 @@ public void functionGeneric_XextendsNumber_javaNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -924,10 +1001,12 @@ public void functionGeneric_XY_sarlNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -947,10 +1026,12 @@ public void functionGeneric_XY_javaNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -970,10 +1051,12 @@ public void functionGeneric_XYextendsX_sarlNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", @@ -993,10 +1076,12 @@ public void functionGeneric_XYextendsX_javaNotation() throws Exception { String expected = multilineString( "package io.sarl.lang.tests.test;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "", "@FunctionalInterface", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_INTERFACE + ")", "@SuppressWarnings(\"all\")", "public interface I1 {", " public abstract void setX(final X param);", diff --git a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/modules/compiler/batch/AbstractBatchCompilerTest.java b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/modules/compiler/batch/AbstractBatchCompilerTest.java index f252786fe7..7a837b5ea9 100644 --- a/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/modules/compiler/batch/AbstractBatchCompilerTest.java +++ b/tests/io.sarl.lang.tests/src/io/sarl/lang/tests/modules/compiler/batch/AbstractBatchCompilerTest.java @@ -31,6 +31,7 @@ import org.junit.Test; import io.sarl.lang.SARLVersion; +import io.sarl.lang.sarl.SarlPackage; import io.sarl.tests.api.AbstractSarlTest; import io.sarl.tests.api.AbstractSarlUiTest; @@ -55,6 +56,7 @@ public abstract class AbstractBatchCompilerTest extends AbstractSarlTest { private static final String JAVA_CODE = multilineString( "package io.sarl.lang.tests.compiler.batch;", "", + "import io.sarl.lang.annotation.SarlElementType;", "import io.sarl.lang.annotation.SarlSpecification;", "import io.sarl.lang.annotation.SyntheticMember;", "import io.sarl.lang.core.Agent;", @@ -63,6 +65,7 @@ public abstract class AbstractBatchCompilerTest extends AbstractSarlTest { "import javax.inject.Inject;", "", "@SarlSpecification(\"" + SARLVersion.SPECIFICATION_RELEASE_VERSION_STRING + "\")", + "@SarlElementType(" + SarlPackage.SARL_AGENT + ")", "@SuppressWarnings(\"all\")", "public class MyTestAgent extends Agent {", " protected int oneFunction() {",