private void createBlockSnapshotData(String name,int numSnapshots) throws Exception {
  Volume volume=new Volume();
  URI volumeURI=URIUtil.createId(Volume.class);
  testVolumeURIs.add(volumeURI);
  volume.setId(volumeURI);
  String volName="snapVolume";
  volume.setLabel(volName);
  URI cgUri=createBlockConsistencyGroup(volName + "-cg");
  volume.setConsistencyGroup(cgUri);
  _dbClient.createObject(volume);
  for (int i=1; i <= numSnapshots; i++) {
    BlockSnapshot blockSnapshot=new BlockSnapshot();
    URI blockSnapshotURI=URIUtil.createId(BlockSnapshot.class);
    testBlockSnapshotURIs.add(blockSnapshotURI);
    blockSnapshot.setId(blockSnapshotURI);
    blockSnapshot.setLabel(name + i);
    blockSnapshot.setSnapsetLabel(name + i);
    blockSnapshot.setParent(new NamedURI(volume.getId(),name + i));
    blockSnapshot.setConsistencyGroup(cgUri);
    _dbClient.createObject(blockSnapshot);
    BlockSnapshot querySnap=_dbClient.queryObject(BlockSnapshot.class,blockSnapshotURI);
  }
}

private void createBlockSnapshotData ( String name , int numSnapshots ) throws Exception { Volume volume = new Volume ( ) ; URI volumeURI = URIUtil . createId ( Volume . class ) ; testVolumeURIs . add ( volumeURI ) ; volume . setId ( volumeURI ) ; String volName = "snapVolume" ; volume . setLabel ( volName ) ; URI cgUri = createBlockConsistencyGroup ( volName + "-cg" ) ; volume . setConsistencyGroup ( cgUri ) ; _dbClient . createObject ( volume ) ; for ( int i = 1 ; i <= numSnapshots ; i ++ ) { BlockSnapshot blockSnapshot = new BlockSnapshot ( ) ; URI blockSnapshotURI = URIUtil . createId ( BlockSnapshot . class ) ; testBlockSnapshotURIs . add ( blockSnapshotURI ) ; blockSnapshot . setId ( blockSnapshotURI ) ; blockSnapshot . setLabel ( name + i ) ; blockSnapshot . setSnapsetLabel ( name + i ) ; blockSnapshot . setParent ( new NamedURI ( volume . getId ( ) , name + i ) ) ; blockSnapshot . setConsistencyGroup ( cgUri ) ; _dbClient . createObject ( blockSnapshot ) ; BlockSnapshot querySnap = _dbClient . queryObject ( BlockSnapshot . class , blockSnapshotURI ) ; } }
creates the blockobject blocksnapshot data .
