Commit e9f8c49b authored by Daniel Bluhm's avatar Daniel Bluhm
Browse files

Modify tests to reflect desired import behavior


Signed-off-by: Daniel Bluhm's avatarDaniel Bluhm <bluhmdj@ornl.gov>
parent 1f2ca45a
...@@ -78,7 +78,9 @@ class DataElementProcessorTest { ...@@ -78,7 +78,9 @@ class DataElementProcessorTest {
DATAFIELD_SETTER("Setter.java"), DATAFIELD_SETTER("Setter.java"),
DATAFIELD_MATCH("Match.java"), DATAFIELD_MATCH("Match.java"),
DEFAULT_NON_STRING("DefaultNonString.java"), DEFAULT_NON_STRING("DefaultNonString.java"),
DEFAULT_STRING("DefaultString.java"); DEFAULT_STRING("DefaultString.java"),
BOXED_TYPES("BoxedTypes.java"),
INNER_CLASS_TYPES("InnerClassTypes.java");
/** /**
* Parent directory of inputs. Prepended to all paths. * Parent directory of inputs. Prepended to all paths.
...@@ -116,7 +118,9 @@ class DataElementProcessorTest { ...@@ -116,7 +118,9 @@ class DataElementProcessorTest {
DATAFIELD_GETTER_INT("Getter.java"), DATAFIELD_GETTER_INT("Getter.java"),
DATAFIELD_SETTER_INT("Setter.java"), DATAFIELD_SETTER_INT("Setter.java"),
DEFAULT_NON_STRING_IMPL("DefaultNonStringImplementation.java"), DEFAULT_NON_STRING_IMPL("DefaultNonStringImplementation.java"),
DEFAULT_STRING_IMPL("DefaultStringImplementation.java"); DEFAULT_STRING_IMPL("DefaultStringImplementation.java"),
BOXED_TYPES_INT("BoxedTypesInterface.java"),
INNER_CLASS_TYPES_INT("InnerClassTypesInterface.java");
/** /**
* Parent directory of inputs. Prepended to all paths. * Parent directory of inputs. Prepended to all paths.
...@@ -267,6 +271,26 @@ class DataElementProcessorTest { ...@@ -267,6 +271,26 @@ class DataElementProcessorTest {
assertImplementationMatches(compilation, Patterns.MANY_NON_PRIMITIVE_IMPL.get()); assertImplementationMatches(compilation, Patterns.MANY_NON_PRIMITIVE_IMPL.get());
} }
/**
* Test that boxed types' type parameters are preserved.
*/
@Test
void testBoxedTypeParametersPreserved() {
Compilation compilation = helper.compile(Inputs.BOXED_TYPES.get());
assertDefaultsPresent(compilation);
assertInterfaceMatches(compilation, Patterns.BOXED_TYPES_INT.get());
}
/**
* Test that inner class types and their type parameters are preserved.
*/
@Test
void testInnerClassTypes() {
Compilation compilation = helper.compile(Inputs.INNER_CLASS_TYPES.get());
assertDefaultsPresent(compilation);
assertInterfaceMatches(compilation, Patterns.INNER_CLASS_TYPES_INT.get());
}
/** /**
* Test that Doc Comments are preserved on elements annotated with * Test that Doc Comments are preserved on elements annotated with
* {@code @DataField}. * {@code @DataField}.
......
import java.util.List;
import org.eclipse.ice.dev.annotations.DataElement;
import org.eclipse.ice.dev.annotations.DataField;
@DataElement(name = "Test")
public class BoxedTypes {
@DataField public List<String> stringList;
}
\ No newline at end of file
import java.util.Map;
import org.eclipse.ice.dev.annotations.DataElement;
import org.eclipse.ice.dev.annotations.DataField;
@DataElement(name = "Test")
public class InnerClassTypes {
@DataField public Map.Entry<String, Object> testMapEntry;
}
\ No newline at end of file
import org.eclipse.ice.data.IDataElement;
public interface Test extends IDataElement<Test> {
public List<String> getStringList();
public void setStringList(List<String> stringList);
}
\ No newline at end of file
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
) )
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class TestImplementation implements Test, Serializable { public class TestImplementation implements Test, Serializable {
@NonNull public java.lang.String test = "A String Value"; @NonNull public String test = "A String Value";
} }
\ No newline at end of file
...@@ -11,13 +11,13 @@ public class TestImplementation implements Test, Serializable { ...@@ -11,13 +11,13 @@ public class TestImplementation implements Test, Serializable {
@NonNull @NonNull
@Getter(AccessLevel.NONE) @Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE) @Setter(AccessLevel.NONE)
protected java.util.UUID privateId = java.util.UUID.randomUUID(); protected UUID privateId = UUID.randomUUID();
protected long id = 0L; protected long id = 0L;
@NonNull protected java.lang.String name = "name"; @NonNull protected String name = "name";
@NonNull protected java.lang.String description = "description"; @NonNull protected String description = "description";
@NonNull protected java.lang.String comment = "no comment"; @NonNull protected String comment = "no comment";
@NonNull protected java.lang.String context = "default"; @NonNull protected String context = "default";
protected boolean required = false; protected boolean required = false;
protected boolean secret = false; protected boolean secret = false;
protected org.eclipse.ice.data.JavascriptValidator<Test> validator; protected JavascriptValidator validator;
} }
\ No newline at end of file
import org.eclipse.ice.data.IDataElement;
public interface Test extends IDataElement<Test> {
public Entry<String, Object> getTestMapEntry();
public void setTestMapEntry(Entry<String, Object> testMapEntry);
}
\ No newline at end of file
import org.eclipse.ice.data.IDataElement; import org.eclipse.ice.data.IDataElement;
public interface Test extends IDataElement<Test> { public interface Test extends IDataElement<Test> {
public java.util.UUID getTestUuid(); public UUID getTestUuid();
public void setTestUuid(java.util.UUID testUuid); public void setTestUuid(UUID testUuid);
public java.lang.String getTestString(); public String getTestString();
public void setTestString(java.lang.String testString); public void setTestString(String testString);
public java.util.Date getTestDate(); public Date getTestDate();
public void setTestDate(java.util.Date testDate); public void setTestDate(Date testDate);
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
) )
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class TestImplementation implements Test, Serializable { public class TestImplementation implements Test, Serializable {
@NonNull public java.util.UUID testUuid; @NonNull public UUID testUuid;
@NonNull public java.lang.String testString; @NonNull public String testString;
@NonNull public java.util.Date testDate; @NonNull public Date testDate;
} }
\ No newline at end of file
import org.eclipse.ice.data.IDataElement; import org.eclipse.ice.data.IDataElement;
public interface Test extends IDataElement<Test> { public interface Test extends IDataElement<Test> {
public java.util.UUID getTestUuid(); public UUID getTestUuid();
public void setTestUuid(java.util.UUID testUuid); public void setTestUuid(UUID testUuid);
} }
\ No newline at end of file
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
) )
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class TestImplementation implements Test, Serializable { public class TestImplementation implements Test, Serializable {
@NonNull public java.util.UUID testUuid; @NonNull public UUID testUuid;
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment