|
| 1 | +/** |
| 2 | + * Copyright (C) 2010-2015 eBusiness Information, Excilys Group |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 5 | + * use this file except in compliance with the License. You may obtain a copy of |
| 6 | + * 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, WITHOUT |
| 12 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | + * License for the specific language governing permissions and limitations under |
| 14 | + * the License. |
| 15 | + */ |
| 16 | +package org.androidannotations.manifest; |
| 17 | + |
| 18 | +import java.io.IOException; |
| 19 | + |
| 20 | +import org.androidannotations.internal.AndroidAnnotationProcessor; |
| 21 | +import org.androidannotations.testutils.AAProcessorTestHelper; |
| 22 | +import org.junit.Before; |
| 23 | +import org.junit.Test; |
| 24 | + |
| 25 | +public class InstantRunManifestTest extends AAProcessorTestHelper { |
| 26 | + |
| 27 | + @Before |
| 28 | + public void setUp() { |
| 29 | + addProcessor(AndroidAnnotationProcessor.class); |
| 30 | + } |
| 31 | + |
| 32 | + @Test |
| 33 | + public void generatedAppInManifestCompiles() { |
| 34 | + addManifestProcessorParameter(InstantRunManifestTest.class, "CorrectInstantRunManifest.xml"); |
| 35 | + |
| 36 | + CompileResult compileResult = compileFiles(MyApplication.class); |
| 37 | + |
| 38 | + assertCompilationSuccessful(compileResult); |
| 39 | + } |
| 40 | + |
| 41 | + @Test |
| 42 | + public void originalAppInManifestDoesNotCompile() throws IOException { |
| 43 | + addManifestProcessorParameter(InstantRunManifestTest.class, "IncorrectInstantRunManifest.xml"); |
| 44 | + |
| 45 | + CompileResult compileResult = compileFiles(MyApplication.class); |
| 46 | + |
| 47 | + assertCompilationErrorOn(MyApplication.class, "@EApplication", compileResult); |
| 48 | + } |
| 49 | + |
| 50 | +} |
0 commit comments