1 package com.simpligility.maven.plugins.android.configuration;
2
3 import static org.junit.Assert.assertArrayEquals;
4
5 import org.apache.maven.plugin.MojoExecutionException;
6 import org.junit.Test;
7
8 import com.simpligility.maven.plugins.android.configuration.SimpleVersionElementParser;
9
10
11
12
13 public class SimpleVersionElementParserTest
14 {
15
16 @Test
17 public void simple() throws MojoExecutionException
18 {
19 assertArrayEquals( new int[] { 2, 14, 748, 3647 }, new SimpleVersionElementParser().parseVersionElements( "2.14.748.3647" ) );
20 assertArrayEquals( new int[] { 2147, 483, 64, 7 }, new SimpleVersionElementParser().parseVersionElements( "2147.483.64.7" ) );
21 assertArrayEquals( new int[] { 2, 1, 4, 7, 4, 8, 3, 6, 4, 7 }, new SimpleVersionElementParser().parseVersionElements( "2.1.4.7.4.8.3.6.4.7" ) );
22 }
23
24 @Test
25 public void mixed() throws MojoExecutionException
26 {
27 assertArrayEquals( new int[] { 4, 1, 16, 8, 1946 }, new SimpleVersionElementParser().parseVersionElements( "4.1.16.8-SNAPSHOT.1946" ) );
28 assertArrayEquals( new int[] { 1, 2, 15, 8, 1946 }, new SimpleVersionElementParser().parseVersionElements( "1.2.15.8-SNAPSHOT.1946" ) );
29 assertArrayEquals( new int[] { 2, 1, 6, 1246 }, new SimpleVersionElementParser().parseVersionElements( "2.1.6-SNAPSHOT.1246" ) );
30 }
31 }