}
private void saveVerifierComponentAndGet(Restriction component) {
VerifierData data = VerifierReportFactory.newVerifierData();
ObjectType objectType = new ObjectType(new PackageDescr("testPackage1"));
Field field = new Field(new PackageDescr("testPackage1"));
field.setObjectTypePath( objectType.getPath() );
component.setFieldPath( field.getPath() );
assertNotNull( component.getFieldPath() );
data.add( objectType );
data.add( field );
data.add( component );
Collection<VerifierComponent> all = data.getAll();
assertEquals( 3,
all.size() );
assertTrue( all.contains( objectType ) );
assertTrue( all.contains( field ) );
assertTrue( all.contains( component ) );
Collection<VerifierComponent> components = data.getAll( component.getVerifierComponentType() );
assertEquals( 1,
components.size() );
assertEquals( component,
components.toArray()[0] );
VerifierComponent component2 = data.getVerifierObject( component.getVerifierComponentType(),
component.getPath() );
assertNotNull( component2 );
assertEquals( component,
component2 );
Collection<VerifierComponent> fields = data.getAll( field.getVerifierComponentType() );
assertEquals( 1,
fields.size() );
assertEquals( field,
fields.toArray()[0] );
VerifierComponent field2 = data.getVerifierObject( field.getVerifierComponentType(),
field.getPath() );
assertNotNull( field2 );
assertEquals( field,
field2 );
Collection<VerifierComponent> objectTypes = data.getAll( objectType.getVerifierComponentType() );
assertEquals( 1,
objectTypes.size() );
assertEquals( objectType,
objectTypes.toArray()[0] );
VerifierComponent objectType2 = data.getVerifierObject( objectType.getVerifierComponentType(),
objectType.getPath() );
assertNotNull( objectType2 );
assertEquals( objectType,
objectType2 );
}