use of blue.soundObject.GenericScore in project blue by kunstmusik.
the class LiveDataTest method testSerialization.
public void testSerialization() {
LiveData liveData = new LiveData();
final LiveObjectBins liveObjectBins = liveData.getLiveObjectBins();
liveObjectBins.setLiveObject(0, 0, new LiveObject(new GenericScore()));
liveObjectBins.setLiveObject(0, 2, new LiveObject(new GenericScore()));
liveObjectBins.setLiveObject(0, 4, new LiveObject(new GenericScore()));
liveObjectBins.setLiveObject(0, 6, new LiveObject(new GenericScore()));
Element elem1 = liveData.saveAsXML(null);
Element elem2;
try {
elem2 = LiveData.loadFromXML(elem1, null).saveAsXML(null);
System.out.println(elem1.toString() + "\n\n" + elem2.toString());
assertEquals(elem1.toString(), elem2.toString());
} catch (Exception ex) {
ex.printStackTrace();
fail("Did not load from xml");
}
}
use of blue.soundObject.GenericScore in project blue by kunstmusik.
the class LiveObjectBinsTest method testRemoveRow_Column.
@Test
public void testRemoveRow_Column() {
LiveObjectBins instance = new LiveObjectBins();
LiveObject liveObject = new LiveObject(new GenericScore());
instance.setLiveObject(0, 2, liveObject);
instance.insertColumn(0);
instance.insertRow(0);
assertEquals(1, instance.getColumnForObject(liveObject));
assertEquals(3, instance.getRowForObject(liveObject));
instance.removeRow(0);
assertEquals(1, instance.getColumnForObject(liveObject));
assertEquals(2, instance.getRowForObject(liveObject));
instance.removeColumn(-1);
assertEquals(1, instance.getColumnForObject(liveObject));
assertEquals(2, instance.getRowForObject(liveObject));
instance.removeColumn(0);
assertEquals(0, instance.getColumnForObject(liveObject));
assertEquals(2, instance.getRowForObject(liveObject));
instance.removeColumn(0);
assertEquals(1, instance.getColumnCount());
assertEquals(8, instance.getRowCount());
}
use of blue.soundObject.GenericScore in project blue by kunstmusik.
the class LiveObjectBinsTest method testSetLiveObject.
/**
* Test of setLiveObject method, of class LiveObjectBins.
*/
@Test
public void testSetLiveObject() {
System.out.println("setLiveObject");
int column = 0;
int row = 2;
LiveObjectBins instance = new LiveObjectBins();
LiveObject liveObject = new LiveObject(new GenericScore());
instance.setLiveObject(column, row, liveObject);
assertEquals(liveObject, instance.getLiveObject(column, row));
}
use of blue.soundObject.GenericScore in project blue by kunstmusik.
the class LiveObjectBinsTest method testInsertColumn.
/**
* Test of insertColumn method, of class LiveObjectBins.
*/
@Test
public void testInsertColumn() {
LiveObjectBins instance = new LiveObjectBins();
LiveObject liveObject = new LiveObject(new GenericScore());
instance.setLiveObject(0, 2, liveObject);
instance.insertColumn(1);
assertEquals(2, instance.getColumnCount());
assertEquals(liveObject, instance.getLiveObject(0, 2));
instance.insertColumn(-1);
assertEquals(3, instance.getColumnCount());
assertEquals(liveObject, instance.getLiveObject(1, 2));
}
use of blue.soundObject.GenericScore in project blue by kunstmusik.
the class LiveObjectTest method testSerialization.
/**
* Test of getSoundObject method, of class blue.blueLive.LiveObject.
*/
public void testSerialization() {
LiveObject liveObj = new LiveObject();
liveObj.setSObj(new GenericScore());
Element elem1 = liveObj.saveAsXML(null);
Element elem2;
try {
elem2 = liveObj.loadFromXML(elem1, null).saveAsXML(null);
assertEquals(elem1.toString(), elem2.toString());
} catch (Exception ex) {
ex.printStackTrace();
fail("Did not load from xml");
}
}
Aggregations