* Test all variants for model creation
* @throws MalformedURLException
*/
@Test
public void testModelAndSetterCreation() throws MalformedURLException{
StatDataset model1 = new StatDataset();
//initial values
Assert.assertEquals(false, model1.isAutomaticImport());
Assert.assertEquals(false, model1.isLaneDataIncluded());
Assert.assertEquals(false, model1.belongsToCurrentMap());
Assert.assertEquals(null, model1.getDataURL());
Assert.assertEquals(null, model1.getDataFile());
Assert.assertNotNull(model1.getDisplayText());
Assert.assertNotNull(model1.getId());
Assert.assertEquals(0, model1.getIntervals().size());
Assert.assertEquals(0, model1.numIntervals());
//auto import
model1.setAutomaticImport(true);
Assert.assertEquals(true, model1.isAutomaticImport());
//lane data
model1.setLaneDataIncluded(true);
Assert.assertEquals(true, model1.isLaneDataIncluded());
//current map
model1.setBelongsToCurrentMap(true);
Assert.assertEquals(true, model1.belongsToCurrentMap());
//file url
URL test = new URL("file", null, "C:\\testfile.txt");
model1.setDataURL(test);
Assert.assertEquals(test, model1.getDataURL());
Assert.assertEquals(new File(test.getFile()), model1.getDataFile());
//display text
String text = "This is model1";
model1.setDisplayText(text);
Assert.assertEquals(text, model1.getDisplayText());
//intervals, 'happy path'
StatInterval interval0 = new StatInterval("interval1", 0, 200);
StatInterval interval1 = new StatInterval("interval2", 200, 500);
StatInterval interval2 = new StatInterval("interval3", 500, 1000);
model1.addInterval(interval0);
model1.addInterval(interval1);
model1.addInterval(interval2);
Assert.assertSame(interval0, model1.getInterval(0));
Assert.assertSame(interval1, model1.getInterval(1));
Assert.assertSame(interval2, model1.getInterval(2));
Assert.assertEquals(3, model1.numIntervals());
Assert.assertEquals(3, model1.getIntervals().size());
//reset all values
model1.clear();
//initial values
Assert.assertEquals(false, model1.isAutomaticImport());
Assert.assertEquals(false, model1.isLaneDataIncluded());
Assert.assertEquals(false, model1.belongsToCurrentMap());
Assert.assertEquals(null, model1.getDataFile());
Assert.assertNotNull(model1.getDisplayText());
Assert.assertNotNull(model1.getId());
Assert.assertEquals(0, model1.getIntervals().size());
Assert.assertEquals(0, model1.numIntervals());
//attention - currently wrong order of intervals possible:
model1.addInterval(interval2);
model1.addInterval(interval0);
model1.addInterval(interval1);
Assert.assertSame(interval2, model1.getInterval(0));
Assert.assertSame(interval0, model1.getInterval(1));
Assert.assertSame(interval1, model1.getInterval(2));
}