use of org.guvnor.common.services.project.model.MavenRepository in project kie-wb-common by kiegroup.
the class ProjectScreenModelTest method testHashCode.
@Test
public void testHashCode() {
final ProjectScreenModel model = new ProjectScreenModel();
model.setPOM(new POM("test", "test", "url", new GAV("groupID", "artifactID", "version")));
final MavenRepository repository = new MavenRepository();
repository.setId("guvnor-m2-repo");
repository.setName("Guvnor M2 Repo");
repository.setUrl("http://localhost/maven2/");
model.getPOM().addRepository(repository);
model.setPOMMetaData(new Metadata());
model.setKModule(new KModuleModel());
model.setKModuleMetaData(new Metadata());
model.setProjectTagsMetaData(new Metadata());
model.setProjectImports(new ProjectImports());
model.setProjectImportsMetaData(new Metadata());
final int hashCode1 = model.hashCode();
assertTrue(hashCode1 <= Integer.MAX_VALUE);
assertTrue(hashCode1 >= Integer.MIN_VALUE);
model.getProjectImports().getImports().addImport(new Import("java.lang.List"));
final int hashCode2 = model.hashCode();
assertTrue(hashCode2 <= Integer.MAX_VALUE);
assertTrue(hashCode2 >= Integer.MIN_VALUE);
assertNotEquals(hashCode1, hashCode2);
}
use of org.guvnor.common.services.project.model.MavenRepository in project kie-wb-common by kiegroup.
the class ProjectScreenModelTests method testHashCode.
@Test
public void testHashCode() {
final ProjectScreenModel model = new ProjectScreenModel();
model.setPOM(new POM("test", "test", "url", new GAV("groupID", "artifactID", "version")));
final MavenRepository repository = new MavenRepository();
repository.setId("guvnor-m2-repo");
repository.setName("Guvnor M2 Repo");
repository.setUrl("http://localhost/maven2/");
model.getPOM().addRepository(repository);
model.setPOMMetaData(new Metadata());
model.setKModule(new KModuleModel());
model.setKModuleMetaData(new Metadata());
model.setProjectTagsMetaData(new Metadata());
model.setProjectImports(new ProjectImports());
model.setProjectImportsMetaData(new Metadata());
final int hashCode1 = model.hashCode();
assertTrue(hashCode1 <= Integer.MAX_VALUE);
assertTrue(hashCode1 >= Integer.MIN_VALUE);
model.getProjectImports().getImports().addImport(new Import("java.lang.List"));
final int hashCode2 = model.hashCode();
assertTrue(hashCode2 <= Integer.MAX_VALUE);
assertTrue(hashCode2 >= Integer.MIN_VALUE);
assertNotEquals(hashCode1, hashCode2);
}
Aggregations