use of org.apache.servicecomb.foundation.common.Version in project java-chassis by ServiceComb.
the class TestVersion method constructFromStringInvalidTooManyPart.
@Test
public void constructFromStringInvalidTooManyPart() {
expectedException.expect(IllegalStateException.class);
expectedException.expectMessage(Matchers.is("Invalid version \"1.1.1.1.\"."));
version = new Version("1.1.1.1.");
}
use of org.apache.servicecomb.foundation.common.Version in project java-chassis by ServiceComb.
the class TestVersion method constructFromStringOnlyMajorMinorPatch.
@Test
public void constructFromStringOnlyMajorMinorPatch() {
version = new Version("1.1.1");
Assert.assertEquals("1.1.1.0", version.getVersion());
Assert.assertEquals(1, version.getMajor());
Assert.assertEquals(1, version.getMinor());
Assert.assertEquals(1, version.getPatch());
Assert.assertEquals(0, version.getBuild());
}
use of org.apache.servicecomb.foundation.common.Version in project java-chassis by ServiceComb.
the class MicroserviceVersion method init.
protected void init(MicroserviceVersions microserviceVersions, Microservice microservice, String microserviceName, Collection<MicroserviceInstance> instances) {
this.appManager = microserviceVersions.getAppManager();
this.microserviceVersions = microserviceVersions;
this.microservice = microservice;
this.microserviceName = microserviceName;
this.instances = instances;
this.version = new Version(microservice.getVersion());
}
Aggregations