final String vendor = "Peter Donald";
final String implTitle = "DVE vi OS3P";
final String implVendor = "Peter Donald";
final String implVersion = "1.0.2Alpha";
final Specification req1 =
new Specification( title, version, vendor,
implTitle, implVersion, implVendor );
final Specification req2 =
new Specification( title, version, vendor,
null, null, null );
final Specification req3 =
new Specification( title, "1.0.1", vendor,
null, null, null );
final Specification req4 =
new Specification( title, version, null,
null, null, null );
final Specification req5 =
new Specification( "another title", version, vendor,
implTitle, implVersion, implVendor );
final Specification avail1 =
new Specification( title, version, vendor,
implTitle, implVersion, implVendor );
final Specification avail2 =
new Specification( title, version, vendor,
implTitle, "another version", implVendor );
final Specification avail3 =
new Specification( title, version, vendor,
implTitle, implVersion, "another vendor" );
assertTrue( "avail1.isCompatibleWith( req1 )",
avail1.isCompatibleWith( req1 ) );
assertTrue( "avail1.isCompatibleWith( req2 )",
avail1.isCompatibleWith( req2 ) );
assertTrue( "avail1.isCompatibleWith( req3 )",
avail1.isCompatibleWith( req3 ) );
assertTrue( "avail1.isCompatibleWith( req4 )",
avail1.isCompatibleWith( req4 ) );
assertTrue( "!avail1.isCompatibleWith( req5 )",
!avail1.isCompatibleWith( req5 ) );
assertTrue( "!avail2.isCompatibleWith( req1 )",
!avail2.isCompatibleWith( req1 ) );
assertTrue( "avail2.isCompatibleWith( req2 )",
avail2.isCompatibleWith( req2 ) );
assertTrue( "avail2.isCompatibleWith( req3 )",
avail2.isCompatibleWith( req3 ) );
assertTrue( "avail2.isCompatibleWith( req4 )",
avail2.isCompatibleWith( req4 ) );
assertTrue( "!avail2.isCompatibleWith( req5 )",
!avail2.isCompatibleWith( req5 ) );
assertTrue( "!avail3.isCompatibleWith( req1 )",
!avail3.isCompatibleWith( req1 ) );
assertTrue( "avail3.isCompatibleWith( req2 )",
avail3.isCompatibleWith( req2 ) );
assertTrue( "avail3.isCompatibleWith( req3 )",
avail3.isCompatibleWith( req3 ) );
assertTrue( "avail3.isCompatibleWith( req4 )",
avail3.isCompatibleWith( req4 ) );
assertTrue( "!avail3.isCompatibleWith( req5 )",
!avail3.isCompatibleWith( req5 ) );
}