use of com.enonic.xp.support.AbstractEqualsTest in project xp by enonic.
the class NodeTest method equals.
@Test
public void equals() {
AbstractEqualsTest equalsTest = new AbstractEqualsTest() {
@Override
public Object getObjectX() {
return NodeIds.from("aaa", "bbb");
}
@Override
public Object[] getObjectsThatNotEqualsX() {
return new Object[] { NodeIds.from("aaa"), NodeIds.from("aaa", "ccc") };
}
@Override
public Object getObjectThatEqualsXButNotTheSame() {
return NodeIds.from("aaa", "bbb");
}
@Override
public Object getObjectThatEqualsXButNotTheSame2() {
return NodeIds.from("aaa", "bbb");
}
};
equalsTest.assertEqualsAndHashCodeContract();
}
use of com.enonic.xp.support.AbstractEqualsTest in project xp by enonic.
the class DescriptorKeyTest method equals.
@Test
public void equals() {
AbstractEqualsTest equalsTest = new AbstractEqualsTest() {
@Override
public Object getObjectX() {
return DescriptorKey.from("mainmodule:partTemplateName");
}
@Override
public Object[] getObjectsThatNotEqualsX() {
return new Object[] { DescriptorKey.from("xeon:partTemplateName"), DescriptorKey.from("mainmodule:partTemplateName2"), new Object() };
}
@Override
public Object getObjectThatEqualsXButNotTheSame() {
return DescriptorKey.from(ApplicationKey.from("mainmodule"), "partTemplateName");
}
@Override
public Object getObjectThatEqualsXButNotTheSame2() {
return DescriptorKey.from("mainmodule:partTemplateName");
}
};
equalsTest.assertEqualsAndHashCodeContract();
}
use of com.enonic.xp.support.AbstractEqualsTest in project xp by enonic.
the class MixinNameTest method equals.
@Test
public void equals() {
AbstractEqualsTest equalsTest = new AbstractEqualsTest() {
@Override
public Object getObjectX() {
return MixinName.from("myapplication:my_mixin");
}
@Override
public Object[] getObjectsThatNotEqualsX() {
return new Object[] { MixinName.from("myapplication:my_other_mixin") };
}
@Override
public Object getObjectThatEqualsXButNotTheSame() {
return MixinName.from("myapplication:my_mixin");
}
@Override
public Object getObjectThatEqualsXButNotTheSame2() {
return MixinName.from(ApplicationKey.from("myapplication"), "my_mixin");
}
};
equalsTest.assertEqualsAndHashCodeContract();
}
use of com.enonic.xp.support.AbstractEqualsTest in project xp by enonic.
the class IssueNameTest method testEquals.
@Test
public void testEquals() {
AbstractEqualsTest equalsTest = new AbstractEqualsTest() {
@Override
public Object getObjectX() {
return IssueName.from("myissue");
}
@Override
public Object[] getObjectsThatNotEqualsX() {
return new Object[] { IssueName.from("myotherissue") };
}
@Override
public Object getObjectThatEqualsXButNotTheSame() {
return IssueName.from("myissue");
}
@Override
public Object getObjectThatEqualsXButNotTheSame2() {
return IssueName.from("myissue");
}
};
equalsTest.assertEqualsAndHashCodeContract();
}
use of com.enonic.xp.support.AbstractEqualsTest in project xp by enonic.
the class NodeIdsTest method equals.
@Test
public void equals() {
AbstractEqualsTest equalsTest = new AbstractEqualsTest() {
@Override
public Object getObjectX() {
return NodeIds.from("aaa", "bbb");
}
@Override
public Object[] getObjectsThatNotEqualsX() {
return new Object[] { NodeIds.from("aaa"), NodeIds.from("aaa", "ccc") };
}
@Override
public Object getObjectThatEqualsXButNotTheSame() {
return NodeIds.from("aaa", "bbb");
}
@Override
public Object getObjectThatEqualsXButNotTheSame2() {
return NodeIds.from("aaa", "bbb");
}
};
equalsTest.assertEqualsAndHashCodeContract();
}
Aggregations