Commit 071f99b6 authored by Daniel Bluhm's avatar Daniel Bluhm

Remove irrelevant tests from Field tests

Signed-off-by: Daniel Bluhm's avatarDaniel Bluhm <bluhmdj@ornl.gov>
parent 1331b639
......@@ -88,107 +88,4 @@ class FieldTest {
assertEquals("test", f.getVarName());
assertFalse(f.isVarNameDifferent());
}
/**
* Test getShortType.
*/
@Test
void testGetShortType() {
Field f = Field.builder()
.name("test")
.type(String.class)
.build();
assertEquals("String", f.getShortType());
f = Field.builder()
.name("test")
.type(boolean.class)
.build();
assertEquals("boolean", f.getShortType());
f = Field.builder()
.name("test")
.type(UUID.class)
.build();
assertEquals("UUID", f.getShortType());
f = Field.builder()
.name("test")
.type(Map.Entry.class)
.build();
assertEquals("Map.Entry", f.getShortType());
f = Field.builder()
.name("test")
.type("java.util.Map$Entry<String, Object>")
.build();
assertEquals("Map.Entry<String,Object>", f.getShortType());
}
/**
* Test requiresImport.
*/
@Test
void testRequiresImport() {
Field f = Field.builder()
.name("test")
.type(String.class)
.build();
assertFalse(f.requiresImports());
f = Field.builder()
.name("test")
.type(boolean.class)
.build();
assertFalse(f.requiresImports());
f = Field.builder()
.name("test")
.type(UUID.class)
.build();
assertTrue(f.requiresImports());
}
/**
* Test getImports.
*/
@Test
void testGetImports() {
Field f = Field.builder()
.name("test")
.type(UUID.class)
.build();
assertTrue(f.getImports().contains("java.util.UUID"));
f = Field.builder()
.name("test")
.type(String.class)
.build();
Set<String> imports = f.getImports();
assertFalse(imports.contains("java.lang.String"));
assertTrue(imports.isEmpty());
f = Field.builder()
.name("test")
.type(Map.Entry.class)
.build();
assertTrue(f.getImports().contains("java.util.Map"));
f = Field.builder()
.name("test")
.type("java.util.Map$Entry<java.lang.String, java.lang.Object>")
.build();
imports = f.getImports();
assertTrue(imports.contains("java.util.Map"));
assertFalse(imports.contains("java.lang.String"));
assertFalse(imports.contains("java.lang.Object"));
f = Field.builder()
.name("test")
.type("java.util.List<java.lang.String>")
.build();
imports = f.getImports();
assertTrue(f.getImports().contains("java.util.List"));
assertFalse(f.getImports().contains("java.lang.String"));
f = Field.builder()
.name("test")
.type("java.util.Map<java.lang.String, java.util.List<java.util.Map$Entry<$interface, java.lang.String>>>")
.build();
imports = f.getImports();
assertTrue(f.getImports().contains("java.util.Map"));
assertTrue(f.getImports().contains("java.util.List"));
assertFalse(f.getImports().contains("java.lang.String"));
assertFalse(f.getImports().contains("$Entry"));
assertFalse(f.getImports().contains("$interface"));
}
}
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