-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from Fueled/fix-compiler-package
fix(compiler): fix package computation from different package fragment
- Loading branch information
Showing
4 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
flowr-compiler/src/test/java/com/fueled/flowr/compilers/DeepLinkAnnotationCompilerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.fueled.flowr.compilers; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
/** | ||
* Created by julienFueled on 5/25/17. | ||
*/ | ||
public class DeepLinkAnnotationCompilerTest { | ||
|
||
private static final String TEST_PACKAGE = "com.fueled.flowr.sample"; | ||
|
||
DeepLinkAnnotationCompiler compiler; | ||
|
||
@Before | ||
public void setup() { | ||
compiler = new DeepLinkAnnotationCompiler(); | ||
} | ||
|
||
@Test | ||
public void process() throws Exception { | ||
|
||
} | ||
|
||
@Test | ||
public void generateCanonicalNameOneFragmentTest() throws Exception { | ||
List<String> fragmentList = new ArrayList<>(); | ||
fragmentList.add("com.fueled.flowr.sample.DemoFragment"); | ||
String handlerPackage = compiler.generateCanonicalName(fragmentList); | ||
assertEquals(handlerPackage, TEST_PACKAGE); | ||
} | ||
|
||
@Test | ||
public void generateCanonicalNameTwoFragmentSamePackageTest() throws Exception { | ||
List<String> fragmentList = new ArrayList<>(); | ||
fragmentList.add(TEST_PACKAGE + ".DemoFragment"); | ||
fragmentList.add(TEST_PACKAGE + ".TestFragment"); | ||
String handlerPackage = compiler.generateCanonicalName(fragmentList); | ||
assertEquals(handlerPackage, TEST_PACKAGE); | ||
} | ||
|
||
@Test | ||
public void generateCanonicalNameTwoFragmentDifferentPackageTest() throws Exception { | ||
List<String> fragmentList = new ArrayList<>(); | ||
fragmentList.add(TEST_PACKAGE + ".demo.DemoFragment"); | ||
fragmentList.add(TEST_PACKAGE + ".TestFragment"); | ||
String handlerPackage = compiler.generateCanonicalName(fragmentList); | ||
assertEquals(handlerPackage, TEST_PACKAGE); | ||
} | ||
|
||
@Test | ||
public void generateCanonicalNameTwoFragmentDifferentPackage2Test() throws Exception { | ||
List<String> fragmentList = new ArrayList<>(); | ||
fragmentList.add(TEST_PACKAGE + ".demo.DemoFragment"); | ||
fragmentList.add(TEST_PACKAGE + ".test.TestFragment"); | ||
String handlerPackage = compiler.generateCanonicalName(fragmentList); | ||
assertEquals(handlerPackage, TEST_PACKAGE); | ||
} | ||
|
||
} |