View Javadoc

1   package com.jayway.maven.plugins.android.common;
2   
3   import org.apache.maven.plugin.MojoExecutionException;
4   import org.junit.Assert;
5   import org.junit.Test;
6   
7   /**
8    * @author Johan Lindquist
9    */
10  public class NativeHelperTest {
11  
12      @Test
13      public void invalidVersions()
14      {
15          String[] versions = {"r4", "r5", "r5b", "r5c", "r6", "r6b"};
16  
17          for (int i = 0; i < versions.length; i++) {
18              String version = versions[i];
19              try {
20                  NativeHelper.validateNDKVersion(7,version);
21                  Assert.fail("Version should fail: " + version);
22              } catch (MojoExecutionException e) {
23              }
24          }
25      }
26  
27      @Test
28      public void validVersions()
29      {
30          String[] versions = {"r7", "r8a", "r8z", "r10", "r19b", "r25", "r100", "r100b"};
31  
32          for (int i = 0; i < versions.length; i++) {
33              String version = versions[i];
34              try {
35                  NativeHelper.validateNDKVersion(7,version);
36              } catch (MojoExecutionException e) {
37                  Assert.fail("Version should not fail: " + version);
38              }
39          }
40      }
41  
42  
43  }