@@ -0,0 +1,3364 @@
+/*%0A * Copyright 2014 Open mHealth%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.openmhealth.schema.domain;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.BlockJUnit4ClassRunner;%0A%0Aimport static org.hamcrest.CoreMatchers.equalTo;%0Aimport static org.hamcrest.CoreMatchers.notNullValue;%0Aimport static org.junit.Assert.assertThat;%0A%0A%0A/**%0A * A suite of unit tests for schema version objects.%0A */%0A@RunWith(BlockJUnit4ClassRunner.class)%0Apublic class SchemaVersionUnitTests %7B%0A%0A    @Test(expected = NullPointerException.class)%0A    public void stringConstructorShouldThrowExceptionOnUndefinedVersion() %7B%0A%0A        new SchemaVersion(null);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void stringConstructorShouldThrowExceptionOnNegativeMajorVersion() %7B%0A%0A        new SchemaVersion(%22-2.1%22);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void stringConstructorShouldThrowExceptionOnMalformedMajorVersion() %7B%0A%0A        new SchemaVersion(%22a.1%22);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void stringConstructorShouldThrowExceptionOnNegativeMinorVersion() %7B%0A%0A        new SchemaVersion(%222.-1%22);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void stringConstructorShouldThrowExceptionOnMalformedMinorVersion() %7B%0A%0A        new SchemaVersion(%222.a%22);%0A    %7D%0A%0A    @Test(expected = IllegalArgumentException.class)%0A    public void stringConstructorShouldThrowExceptionOnMalformedQualifier() %7B%0A%0A        new SchemaVersion(%222.1.%25%22);%0A    %7D%0A%0A    @Test%0A    public void stringConstructorShouldSupportZeroMajorVersion() %7B%0A%0A        SchemaVersion schemaVersion = new SchemaVersion(%220.1%22);%0A%0A        assertThat(schemaVersion, notNullValue());%0A        assertThat(schemaVersion.getMajor(), equalTo(0));%0A        assertThat(schemaVersion.getMinor(), equalTo(1));%0A        assertThat(schemaVersion.getQualifier().isPresent(), equalTo(false));%0A    %7D%0A%0A    @Test%0A    public void stringConstructorShouldSupportZeroMinorVersion() %7B%0A%0A        SchemaVersion schemaVersion = new SchemaVersion(%223.0%22);%0A%0A        assertThat(schemaVersion, notNullValue());%0A        assertThat(schemaVersion.getMajor(), equalTo(3));%0A        assertThat(schemaVersion.getMinor(), equalTo(0));%0A        assertThat(schemaVersion.getQualifier().isPresent(), equalTo(false));%0A    %7D%0A%0A    @Test%0A    public void stringConstructorShouldSupportQualifier() %7B%0A%0A        SchemaVersion schemaVersion = new SchemaVersion(%222.1.RELEASE%22);%0A%0A        assertThat(schemaVersion, notNullValue());%0A        assertThat(schemaVersion.getMajor(), equalTo(2));%0A        assertThat(schemaVersion.getMinor(), equalTo(1));%0A        assertThat(schemaVersion.getQualifier().isPresent(), equalTo(true));%0A        assertThat(schemaVersion.getQualifier().get(), equalTo(%22RELEASE%22));%0A    %7D%0A%0A    // TODO add more tests%0A%7D

Add schema version unit tests.