Skip to content

Commit

Permalink
Run codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen committed Oct 5, 2024
1 parent 0ea3bcf commit 248f051
Show file tree
Hide file tree
Showing 37 changed files with 452 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,50 @@
package spoon.testing.assertions;
import org.assertj.core.api.AbstractIntegerAssert;
import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.api.AbstractStringAssert;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.MapAssert;
import org.assertj.core.api.ObjectAssert;
import spoon.reflect.code.CtExpression;
import spoon.reflect.declaration.CtAnnotatedElementType;
import spoon.reflect.declaration.CtAnnotation;
public interface CtAnnotationAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtAnnotation<?>> extends SpoonAssert<A, W> , CtExpressionAssertInterface<A, W> , CtShadowableAssertInterface<A, W> {
default ObjectAssert<?> getActualAnnotation() {
return Assertions.assertThatObject(actual().getActualAnnotation());
}

default MapAssert<String, CtExpression> getAllValues() {
return Assertions.assertThat(actual().getAllValues());
}

default CtElementAssertInterface<?, ?> getAnnotatedElement() {
return SpoonAssertions.assertThat(actual().getAnnotatedElement());
}

default ObjectAssert<CtAnnotatedElementType> getAnnotatedElementType() {
return Assertions.assertThatObject(actual().getAnnotatedElementType());
}

default CtTypeReferenceAssertInterface<?, ?> getAnnotationType() {
return SpoonAssertions.assertThat(actual().getAnnotationType());
}

default AbstractStringAssert<?> getName() {
return Assertions.assertThat(actual().getName());
}

default AbstractIntegerAssert<?> getValueAsInt() {
return Assertions.assertThat(actual().getValueAsInt());
}

default ObjectAssert<Object> getValueAsObject() {
return Assertions.assertThatObject(actual().getValueAsObject());
}

default AbstractStringAssert<?> getValueAsString() {
return Assertions.assertThat(actual().getValueAsString());
}

default MapAssert<String, CtExpression> getValues() {
return Assertions.assertThat(actual().getValues());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
package spoon.testing.assertions;
import java.util.Collection;
import org.assertj.core.api.AbstractCollectionAssert;
import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.api.Assertions;
import spoon.reflect.declaration.CtAnnotationMethod;
import spoon.reflect.declaration.CtAnnotationType;
public interface CtAnnotationTypeAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtAnnotationType<?>> extends SpoonAssert<A, W> , CtTypeAssertInterface<A, W> {}
public interface CtAnnotationTypeAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtAnnotationType<?>> extends SpoonAssert<A, W> , CtTypeAssertInterface<A, W> {
default AbstractCollectionAssert<?, Collection<? extends CtAnnotationMethod<?>>, CtAnnotationMethod<?>, ?> getAnnotationMethods() {
return Assertions.assertThat(actual().getAnnotationMethods());
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
package spoon.testing.assertions;
import org.assertj.core.api.AbstractIntegerAssert;
import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.api.AbstractStringAssert;
import org.assertj.core.api.Assertions;
import spoon.reflect.reference.CtArrayTypeReference;
public interface CtArrayTypeReferenceAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtArrayTypeReference<?>> extends CtTypeReferenceAssertInterface<A, W> , SpoonAssert<A, W> {
default CtTypeReferenceAssertInterface<?, ?> getArrayType() {
return SpoonAssertions.assertThat(actual().getArrayType());
}

default CtTypeReferenceAssertInterface<?, ?> getComponentType() {
return SpoonAssertions.assertThat(actual().getComponentType());
}

default AbstractIntegerAssert<?> getDimensionCount() {
return Assertions.assertThat(actual().getDimensionCount());
}

default AbstractStringAssert<?> getSimpleName() {
return Assertions.assertThat(actual().getSimpleName());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
package spoon.testing.assertions;
import org.assertj.core.api.AbstractBooleanAssert;
import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.api.Assertions;
import spoon.reflect.code.CtCatchVariable;
public interface CtCatchVariableAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtCatchVariable<?>> extends CtVariableAssertInterface<A, W> , SpoonAssert<A, W> , CtMultiTypedElementAssertInterface<A, W> , CtCodeElementAssertInterface<A, W> {
default CtCatchVariableReferenceAssertInterface<?, ?> getReference() {
return SpoonAssertions.assertThat(actual().getReference());
}

default CtTypeReferenceAssertInterface<?, ?> getType() {
return SpoonAssertions.assertThat(actual().getType());
}

default AbstractBooleanAssert<?> isUnnamed() {
return Assertions.assertThat(actual().isUnnamed());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package spoon.testing.assertions;
import org.assertj.core.api.AbstractObjectAssert;
import spoon.reflect.reference.CtCatchVariableReference;
public interface CtCatchVariableReferenceAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtCatchVariableReference<?>> extends CtVariableReferenceAssertInterface<A, W> , SpoonAssert<A, W> {}
public interface CtCatchVariableReferenceAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtCatchVariableReference<?>> extends CtVariableReferenceAssertInterface<A, W> , SpoonAssert<A, W> {
default CtCatchVariableAssertInterface<?, ?> getDeclaration() {
return SpoonAssertions.assertThat(actual().getDeclaration());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ default ObjectAssert<CtComment.CommentType> getCommentType() {
default AbstractStringAssert<?> getContent() {
return Assertions.assertThat(actual().getContent());
}

default AbstractStringAssert<?> getRawContent() {
return Assertions.assertThat(actual().getRawContent());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
import spoon.reflect.declaration.CtType;
import spoon.reflect.reference.CtTypeReference;
public interface CtCompilationUnitAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtCompilationUnit> extends CtElementAssertInterface<A, W> , SpoonAssert<A, W> {
default CtCompilationUnitAssertInterface<?, ?> addDeclaredType() {
return SpoonAssertions.assertThat(actual().addDeclaredType());
}

default CtModuleAssertInterface<?, ?> getDeclaredModule() {
return SpoonAssertions.assertThat(actual().getDeclaredModule());
}
Expand All @@ -15,6 +19,10 @@ public interface CtCompilationUnitAssertInterface<A extends AbstractObjectAssert
return SpoonAssertions.assertThat(actual().getDeclaredModuleReference());
}

default CtPackageAssertInterface<?, ?> getDeclaredPackage() {
return SpoonAssertions.assertThat(actual().getDeclaredPackage());
}

default ListAssert<CtTypeReference<?>> getDeclaredTypeReferences() {
return Assertions.assertThat(actual().getDeclaredTypeReferences());
}
Expand All @@ -27,7 +35,27 @@ default ListAssert<CtImport> getImports() {
return Assertions.assertThat(actual().getImports());
}

default CtTypeAssertInterface<?, ?> getMainType() {
return SpoonAssertions.assertThat(actual().getMainType());
}

default CtPackageDeclarationAssertInterface<?, ?> getPackageDeclaration() {
return SpoonAssertions.assertThat(actual().getPackageDeclaration());
}

default CtElementAssertInterface<?, ?> getParent() {
return SpoonAssertions.assertThat(actual().getParent());
}

default CtCompilationUnitAssertInterface<?, ?> setDeclaredModule() {
return SpoonAssertions.assertThat(actual().setDeclaredModule());
}

default CtCompilationUnitAssertInterface<?, ?> setDeclaredPackage() {
return SpoonAssertions.assertThat(actual().setDeclaredPackage());
}

default CtCompilationUnitAssertInterface<?, ?> setDeclaredTypes() {
return SpoonAssertions.assertThat(actual().setDeclaredTypes());
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package spoon.testing.assertions;
import java.lang.annotation.Annotation;
import java.util.Collection;
import org.assertj.core.api.AbstractBooleanAssert;
import org.assertj.core.api.AbstractCollectionAssert;
import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.api.AbstractStringAssert;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.ListAssert;
import org.assertj.core.api.ObjectAssert;
import spoon.reflect.code.CtComment;
import spoon.reflect.cu.SourcePosition;
import spoon.reflect.declaration.CtAnnotation;
import spoon.reflect.declaration.CtElement;
import spoon.reflect.reference.CtTypeReference;
public interface CtElementAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtElement> extends SpoonAssert<A, W> {
default ListAssert<CtAnnotation<? extends Annotation>> getAnnotations() {
return Assertions.assertThat(actual().getAnnotations());
Expand All @@ -18,10 +22,30 @@ default ListAssert<CtComment> getComments() {
return Assertions.assertThat(actual().getComments());
}

default AbstractStringAssert<?> getDocComment() {
return Assertions.assertThat(actual().getDocComment());
}

default CtElementAssertInterface<?, ?> getParent() {
return SpoonAssertions.assertThat(actual().getParent());
}

default ObjectAssert<SourcePosition> getPosition() {
return Assertions.assertThatObject(actual().getPosition());
}

default AbstractCollectionAssert<?, Collection<? extends CtTypeReference<?>>, CtTypeReference<?>, ?> getReferencedTypes() {
return Assertions.assertThat(actual().getReferencedTypes());
}

default AbstractStringAssert<?> getShortRepresentation() {
return Assertions.assertThat(actual().getShortRepresentation());
}

default AbstractBooleanAssert<?> hasAnnotation() {
return Assertions.assertThat(actual().hasAnnotation());
}

default AbstractBooleanAssert<?> isImplicit() {
return Assertions.assertThat(actual().isImplicit());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ default ListAssert<CtParameter<?>> getParameters() {
return SpoonAssertions.assertThat(actual().getReceiverParameter());
}

default CtExecutableReferenceAssertInterface<?, ?> getReference() {
return SpoonAssertions.assertThat(actual().getReference());
}

default AbstractCollectionAssert<?, Collection<? extends CtTypeReference<? extends Throwable>>, CtTypeReference<? extends Throwable>, ?> getThrownTypes() {
return Assertions.assertThat(actual().getThrownTypes());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@
import spoon.reflect.reference.CtExecutableReference;
import spoon.reflect.reference.CtTypeReference;
public interface CtExecutableReferenceAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtExecutableReference<?>> extends SpoonAssert<A, W> , CtActualTypeContainerAssertInterface<A, W> , CtReferenceAssertInterface<A, W> {
default CtExecutableAssertInterface<?, ?> getDeclaration() {
return SpoonAssertions.assertThat(actual().getDeclaration());
}

default CtTypeReferenceAssertInterface<?, ?> getDeclaringType() {
return SpoonAssertions.assertThat(actual().getDeclaringType());
}

default CtExecutableAssertInterface<?, ?> getExecutableDeclaration() {
return SpoonAssertions.assertThat(actual().getExecutableDeclaration());
}

default CtExecutableReferenceAssertInterface<?, ?> getOverridingExecutable() {
return SpoonAssertions.assertThat(actual().getOverridingExecutable());
}

default ListAssert<CtTypeReference<?>> getParameters() {
return Assertions.assertThat(actual().getParameters());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package spoon.testing.assertions;
import org.assertj.core.api.AbstractObjectAssert;
import spoon.reflect.declaration.CtField;
public interface CtFieldAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtField<?>> extends CtVariableAssertInterface<A, W> , SpoonAssert<A, W> , CtRHSReceiverAssertInterface<A, W> , CtShadowableAssertInterface<A, W> , CtTypeMemberAssertInterface<A, W> {}
public interface CtFieldAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtField<?>> extends CtVariableAssertInterface<A, W> , SpoonAssert<A, W> , CtRHSReceiverAssertInterface<A, W> , CtShadowableAssertInterface<A, W> , CtTypeMemberAssertInterface<A, W> {
default CtFieldReferenceAssertInterface<?, ?> getReference() {
return SpoonAssertions.assertThat(actual().getReference());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@
import org.assertj.core.api.Assertions;
import spoon.reflect.reference.CtFieldReference;
public interface CtFieldReferenceAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtFieldReference<?>> extends CtVariableReferenceAssertInterface<A, W> , SpoonAssert<A, W> {
default CtFieldAssertInterface<?, ?> getDeclaration() {
return SpoonAssertions.assertThat(actual().getDeclaration());
}

default CtTypeReferenceAssertInterface<?, ?> getDeclaringType() {
return SpoonAssertions.assertThat(actual().getDeclaringType());
}

default CtFieldAssertInterface<?, ?> getFieldDeclaration() {
return SpoonAssertions.assertThat(actual().getFieldDeclaration());
}

default AbstractBooleanAssert<?> isFinal() {
return Assertions.assertThat(actual().isFinal());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package spoon.testing.assertions;
import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.ObjectAssert;
import spoon.reflect.declaration.CtImport;
import spoon.reflect.declaration.CtImportKind;
public interface CtImportAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtImport> extends CtElementAssertInterface<A, W> , SpoonAssert<A, W> {
default ObjectAssert<CtImportKind> getImportKind() {
return Assertions.assertThatObject(actual().getImportKind());
}

default CtReferenceAssertInterface<?, ?> getReference() {
return SpoonAssertions.assertThat(actual().getReference());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
package spoon.testing.assertions;
import org.assertj.core.api.AbstractObjectAssert;
import org.assertj.core.api.AbstractStringAssert;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.ListAssert;
import spoon.javadoc.internal.JavadocDescriptionElement;
import spoon.reflect.code.CtJavaDoc;
import spoon.reflect.code.CtJavaDocTag;
public interface CtJavaDocAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtJavaDoc> extends SpoonAssert<A, W> , CtCommentAssertInterface<A, W> {
default ListAssert<JavadocDescriptionElement> getJavadocElements() {
return Assertions.assertThat(actual().getJavadocElements());
}

default AbstractStringAssert<?> getLongDescription() {
return Assertions.assertThat(actual().getLongDescription());
}

default AbstractStringAssert<?> getShortDescription() {
return Assertions.assertThat(actual().getShortDescription());
}

default ListAssert<CtJavaDocTag> getTags() {
return Assertions.assertThat(actual().getTags());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import org.assertj.core.api.Assertions;
import spoon.reflect.code.CtLabelledFlowBreak;
public interface CtLabelledFlowBreakAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtLabelledFlowBreak> extends CtCFlowBreakAssertInterface<A, W> , SpoonAssert<A, W> {
default CtStatementAssertInterface<?, ?> getLabelledStatement() {
return SpoonAssertions.assertThat(actual().getLabelledStatement());
}

default AbstractStringAssert<?> getTargetLabel() {
return Assertions.assertThat(actual().getTargetLabel());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ public interface CtLambdaAssertInterface<A extends AbstractObjectAssert<A, W>, W
return SpoonAssertions.assertThat(actual().getExpression());
}

default CtMethodAssertInterface<?, ?> getOverriddenMethod() {
return SpoonAssertions.assertThat(actual().getOverriddenMethod());
}

default CtReceiverParameterAssertInterface<?, ?> getReceiverParameter() {
return SpoonAssertions.assertThat(actual().getReceiverParameter());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
import org.assertj.core.api.Assertions;
import spoon.reflect.code.CtLocalVariable;
public interface CtLocalVariableAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtLocalVariable<?>> extends CtVariableAssertInterface<A, W> , SpoonAssert<A, W> , CtStatementAssertInterface<A, W> , CtRHSReceiverAssertInterface<A, W> , CtResourceAssertInterface<A, W> {
default CtLocalVariableReferenceAssertInterface<?, ?> getReference() {
return SpoonAssertions.assertThat(actual().getReference());
}

default AbstractBooleanAssert<?> isInferred() {
return Assertions.assertThat(actual().isInferred());
}

default AbstractBooleanAssert<?> isUnnamed() {
return Assertions.assertThat(actual().isUnnamed());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package spoon.testing.assertions;
import org.assertj.core.api.AbstractObjectAssert;
import spoon.reflect.reference.CtLocalVariableReference;
public interface CtLocalVariableReferenceAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtLocalVariableReference<?>> extends CtVariableReferenceAssertInterface<A, W> , SpoonAssert<A, W> {}
public interface CtLocalVariableReferenceAssertInterface<A extends AbstractObjectAssert<A, W>, W extends CtLocalVariableReference<?>> extends CtVariableReferenceAssertInterface<A, W> , SpoonAssert<A, W> {
default CtLocalVariableAssertInterface<?, ?> getDeclaration() {
return SpoonAssertions.assertThat(actual().getDeclaration());
}
}
Loading

0 comments on commit 248f051

Please sign in to comment.