Search in sources :

Example 1 with DomainToPackageExpression

use of com.android.tools.idea.npw.project.DomainToPackageExpression in project android by JetBrains.

the class DomainToPackageExpressionTest method packageNameDeriverSantizesCompanyDomainKey.

@Test
public void packageNameDeriverSantizesCompanyDomainKey() {
    StringProperty companyDomain = new StringValueProperty("sub.exa-mple.com");
    StringProperty applicationName = new StringValueProperty("My&App");
    Expression<String> computedPackageName = new DomainToPackageExpression(companyDomain, applicationName);
    assertEquals("com.exa_mple.sub.myapp", computedPackageName.get());
    companyDomain.set("#.badstartchar.com");
    assertEquals("com.badstartchar.myapp", computedPackageName.get());
    companyDomain.set("TEST.ALLCAPS.COM");
    assertEquals("com.allcaps.test.myapp", computedPackageName.get());
    applicationName.set("#My $AppLICATION");
    assertEquals("com.allcaps.test.myapplication", computedPackageName.get());
}
Also used : DomainToPackageExpression(com.android.tools.idea.npw.project.DomainToPackageExpression) StringProperty(com.android.tools.idea.ui.properties.core.StringProperty) StringValueProperty(com.android.tools.idea.ui.properties.core.StringValueProperty) Test(org.junit.Test)

Aggregations

DomainToPackageExpression (com.android.tools.idea.npw.project.DomainToPackageExpression)1 StringProperty (com.android.tools.idea.ui.properties.core.StringProperty)1 StringValueProperty (com.android.tools.idea.ui.properties.core.StringValueProperty)1 Test (org.junit.Test)1