*/
@Test
public void structures () throws DotDataException {
//Create the new structures
Structure testStructure1 = new Structure();
testStructure1.setDefaultStructure( false );
testStructure1.setDescription( "JUnit Test Structure Description." );
testStructure1.setFixed( false );
testStructure1.setIDate( new Date() );
testStructure1.setName( "JUnit Test Structure_4" );
testStructure1.setOwner( user.getUserId() );
testStructure1.setDetailPage( "" );
testStructure1.setStructureType( Structure.STRUCTURE_TYPE_CONTENT );
testStructure1.setSystem( true );
testStructure1.setType( "structure" );
testStructure1.setVelocityVarName( "junit_test_structure_4" );
Structure testStructure2 = new Structure();
testStructure2.setDefaultStructure( false );
testStructure2.setDescription( "JUnit Test Structure Description." );
testStructure2.setFixed( false );
testStructure2.setIDate( new Date() );
testStructure2.setName( "JUnit Test Structure_5" );
testStructure2.setOwner( user.getUserId() );
testStructure2.setDetailPage( "" );
testStructure2.setStructureType( Structure.STRUCTURE_TYPE_CONTENT );
testStructure2.setSystem( true );
testStructure2.setType( "structure" );
testStructure2.setVelocityVarName( "junit_test_structure_5" );
//++++++++++++++++++++++++++++++++++++++++++++
//Saving the structures
StructureFactory.saveStructure( testStructure1 );
StructureFactory.saveStructure( testStructure2 );
//Validations
assertNotNull( testStructure1.getInode() );
assertNotNull( testStructure2.getInode() );
//++++++++++++++++++++++++++++++++++++++++++++
//Getting the structure we just saved
Structure savedStructure = StructureFactory.getStructureByInode( testStructure1.getInode() );
//Validations
assertEquals( testStructure1.getInode(), savedStructure.getInode() );
//++++++++++++++++++++++++++++++++++++++++++++
//Updating the structure
String updatedName = "UPDATED --- " + savedStructure.getName();
savedStructure.setName( updatedName );
StructureFactory.saveStructure( savedStructure );
//Getting again the saved structure
testStructure1 = StructureFactory.getStructureByInode( savedStructure.getInode() );
//Validations
assertNotNull( testStructure1.getInode() );
assertEquals( testStructure1.getName(), updatedName );
//++++++++++++++++++++++++++++++++++++++++++++
//Delete the structure
String inode = savedStructure.getInode();
StructureFactory.deleteStructure( inode );
//Verify what we just deleted
Structure tempStructure = StructureFactory.getStructureByInode( inode );
//validations
assertTrue( tempStructure == null || tempStructure.getInode() == null || tempStructure.getInode().isEmpty() );
//++++++++++++++++++++++++++++++++++++++++++++
//Delete the structure
inode = testStructure2.getInode();
StructureFactory.deleteStructure( testStructure2 );
//Verify what we just deleted
tempStructure = StructureFactory.getStructureByInode( inode );
//validations
assertTrue( tempStructure == null || tempStructure.getInode() == null || tempStructure.getInode().isEmpty() );
}