View Javadoc
1   /*
2    * Copyright (C) 2014 simpligility technologies inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.simpligility.maven.plugins.android.sample;
17  
18  import com.simpligility.maven.plugins.android.PluginInfo;
19  import io.takari.maven.testing.TestResources;
20  import io.takari.maven.testing.executor.MavenExecutionResult;
21  import io.takari.maven.testing.executor.MavenRuntime;
22  import io.takari.maven.testing.executor.MavenVersions;
23  import io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder;
24  import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner;
25  
26  
27  import org.junit.Rule;
28  import org.junit.Test;
29  import org.junit.runner.RunWith;
30  
31  import java.io.File;
32  
33  @RunWith(MavenJUnitTestRunner.class)
34  @MavenVersions({"3.3.9"})
35  public class MultiDexSampleIT {
36  
37      @Rule
38      public final TestResources resources = new TestResources();
39  
40      public final MavenRuntime mavenRuntime;
41  
42      public MultiDexSampleIT(MavenRuntimeBuilder builder) throws Exception {
43          this.mavenRuntime = builder.build();
44      }
45  
46      @Test
47      public void buildDeployAndRun() throws Exception {
48          File basedir = resources.getBasedir( "multidexsample" );
49          MavenExecutionResult result = mavenRuntime
50              .forProject(basedir)
51              .execute( "clean", PluginInfo.getQualifiedGoal( "undeploy" ),
52                  "install", PluginInfo.getQualifiedGoal( "deploy" ),
53                  PluginInfo.getQualifiedGoal( "run" ) );
54  
55          result.assertErrorFreeLog();
56          result.assertLogText( "Successfully installed" );
57          result.assertLogText( "Attempting to start com.simpligility.android.multidexsample/com.simpligility.android.multidexsample.MultiDexSampleActivity" );
58      }
59  
60  }