Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
388 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
354 changes: 179 additions & 175 deletions
354
javaparser-metamodel/src/main/java/com/github/javaparser/metamodel/JavaParserMetaModel.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...parser-metamodel/src/test/java/com/github/javaparser/metamodel/PropertyMetaModelTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.github.javaparser.metamodel; | ||
|
||
import com.github.javaparser.ast.Modifier; | ||
import com.github.javaparser.ast.body.BodyDeclaration; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class PropertyMetaModelTest { | ||
@Test | ||
public void whenPropertyIsVerySimpleThenTypeInfoIsCorrect() { | ||
PropertyMetaModel bert = new PropertyMetaModel(null, "bert", int.class, null, false, false, false, false, false); | ||
assertEquals("int", bert.getRawTypeName()); | ||
assertEquals("int", bert.getTypeName()); | ||
assertEquals("int", bert.getFullTypeNameForGetter()); | ||
assertEquals("int", bert.getFullTypeNameForSetter()); | ||
} | ||
|
||
@Test | ||
public void whenPropertyIsVeryComplexThenTypeInfoIsCorrect() { | ||
PropertyMetaModel bert = new PropertyMetaModel(null, "bert", BodyDeclaration.class, null, true, true, true, false, true); | ||
assertEquals("BodyDeclaration", bert.getRawTypeName()); | ||
assertEquals("BodyDeclaration<?>", bert.getTypeName()); | ||
assertEquals("Optional<NodeList<BodyDeclaration<?>>>", bert.getFullTypeNameForGetter()); | ||
assertEquals("NodeList<BodyDeclaration<?>>", bert.getFullTypeNameForSetter()); | ||
} | ||
|
||
@Test | ||
public void whenPropertyIsAnEnumThenTypeInfoIsCorrect() { | ||
PropertyMetaModel bert = new PropertyMetaModel(null, "bert", Modifier.class, null, false, false, false, true, false); | ||
assertEquals("Modifier", bert.getRawTypeName()); | ||
assertEquals("Modifier", bert.getTypeName()); | ||
assertEquals("EnumSet<Modifier>", bert.getFullTypeNameForGetter()); | ||
assertEquals("EnumSet<Modifier>", bert.getFullTypeNameForSetter()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters