View Javadoc
1   /*
2    * Copyright (C) 2016 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   * Contributors : 
17   * JBoss, Home of Professional Open Source
18   */
19  package com.simpligility.maven.plugins.android.sample;
20  
21  import io.takari.maven.testing.TestResources;
22  import io.takari.maven.testing.executor.MavenExecutionResult;
23  import io.takari.maven.testing.executor.MavenRuntime;
24  import io.takari.maven.testing.executor.MavenVersions;
25  import io.takari.maven.testing.executor.MavenRuntime.MavenRuntimeBuilder;
26  import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner;
27  
28  import java.io.File;
29  
30  import org.junit.Ignore;
31  import org.junit.Rule;
32  import org.junit.Test;
33  import org.junit.runner.RunWith;
34  
35  import com.simpligility.maven.plugins.android.PluginInfo;
36  
37  /**
38   * 
39   * This project tests end to end building of the project using the Jack compiler.
40   * 
41   * @author summers
42   */
43  @Ignore("Experimental test, currently fails, activate for development of Jack support")
44  @RunWith(MavenJUnitTestRunner.class)
45  @MavenVersions({"3.0.5", "3.3.9"})
46  public class JackedHelloFlashLightSampleIT {
47    
48    @Rule
49    public final TestResources resources = new TestResources();
50    
51    public final MavenRuntime mavenRuntime;
52    
53    public JackedHelloFlashLightSampleIT(MavenRuntimeBuilder builder) throws Exception {
54      this.mavenRuntime = builder.build();
55    }
56    
57    @Test
58    public void buildDeployAndRun() throws Exception {
59      File basedir = resources.getBasedir( "helloflashlight_jack" );
60      MavenExecutionResult result = mavenRuntime
61            .forProject(basedir)
62            .execute( "clean", PluginInfo.getQualifiedGoal( "undeploy" ), 
63                "install", PluginInfo.getQualifiedGoal( "deploy" ),
64                PluginInfo.getQualifiedGoal( "run" ) );
65      
66      result.assertErrorFreeLog();
67      result.assertLogText( "Successfully installed" );
68      result.assertLogText( "Attempting to start com.simpligility.android.helloflashlight/com.simpligility.android.helloflashlight.HelloFlashlight" );
69    }
70  
71  }