use of org.apache.servicecomb.foundation.common.Version in project java-chassis by ServiceComb.
the class TestVersion method testEquals.
@Test
public void testEquals() {
version = new Version(s1, s1, s1, s1);
Assert.assertTrue(version.equals(version));
Assert.assertTrue(version.equals(new Version(s1, s1, s1, s1)));
Assert.assertFalse(version.equals(null));
}
use of org.apache.servicecomb.foundation.common.Version in project java-chassis by ServiceComb.
the class TestVersion method constructFromStringInvalidNull.
@Test
public void constructFromStringInvalidNull() {
expectedException.expect(NullPointerException.class);
version = new Version(null);
}
use of org.apache.servicecomb.foundation.common.Version in project java-chassis by ServiceComb.
the class TestVersion method constructFromStringInvalidPatchNegative.
@Test
public void constructFromStringInvalidPatchNegative() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage(Matchers.is("patch \"-1\" can not be negative, version \"1.1.-1\"."));
version = new Version("1.1.-1");
}
use of org.apache.servicecomb.foundation.common.Version in project java-chassis by ServiceComb.
the class TestVersion method constructFromStringInvalidMinorDot.
@Test
public void constructFromStringInvalidMinorDot() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage(Matchers.is("Invalid patch \"\", version \"1.1.\"."));
expectedException.expectCause(Matchers.instanceOf(NumberFormatException.class));
version = new Version("1.1.");
}
use of org.apache.servicecomb.foundation.common.Version in project java-chassis by ServiceComb.
the class TestVersion method testToString.
@Test
public void testToString() {
version = new Version(s1, s1, s1, s1);
Assert.assertEquals("1.1.1.1", version.toString());
}
Aggregations