use of org.neo4j.unsafe.impl.batchimport.input.DuplicateHeaderException in project neo4j by neo4j.
the class DataFactoriesTest method shouldFailForDuplicatePropertyHeaderEntries.
@Test
public void shouldFailForDuplicatePropertyHeaderEntries() throws Exception {
// GIVEN
CharSeeker seeker = seeker("one:id\tname\tname:long");
IdType idType = IdType.ACTUAL;
Extractors extractors = new Extractors('\t');
// WHEN
try {
DataFactories.defaultFormatNodeFileHeader().create(seeker, TABS, idType);
fail("Should fail");
} catch (DuplicateHeaderException e) {
assertEquals(entry("name", Type.PROPERTY, extractors.string()), e.getFirst());
assertEquals(entry("name", Type.PROPERTY, extractors.long_()), e.getOther());
}
seeker.close();
}
use of org.neo4j.unsafe.impl.batchimport.input.DuplicateHeaderException in project neo4j by neo4j.
the class DataFactoriesTest method shouldFailForDuplicateIdHeaderEntries.
@Test
public void shouldFailForDuplicateIdHeaderEntries() throws Exception {
// GIVEN
CharSeeker seeker = seeker("one:id\ttwo:id");
IdType idType = IdType.ACTUAL;
Extractors extractors = new Extractors('\t');
// WHEN
try {
DataFactories.defaultFormatNodeFileHeader().create(seeker, TABS, idType);
fail("Should fail");
} catch (DuplicateHeaderException e) {
assertEquals(entry("one", Type.ID, extractors.long_()), e.getFirst());
assertEquals(entry("two", Type.ID, extractors.long_()), e.getOther());
}
seeker.close();
}
Aggregations