Permalink
Browse files

fixing some tests

  • Loading branch information...
Ricardo Espirito Santo
Ricardo Espirito Santo committed Dec 1, 2016
1 parent 7a144eb commit 2baaca232cb609ef4e130748608b41db1f32f40f
View
@@ -51,14 +51,14 @@
<dependencies>
<dependency>
<groupId>com.dustriel</groupId>
<groupId>com.ricardoespsanto</groupId>
<artifactId>onesky-model</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.3</version>
</dependency>
<dependency>
<groupId>com.dustriel</groupId>
<groupId>com.ricardoespsanto</groupId>
<artifactId>onesky-service</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0</version>
</dependency>
<dependency>
@@ -16,6 +16,8 @@
package org.jenkinsci.plugins.resourcehandlers;
import com.onesky.model.ProjectLanguage;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -33,22 +35,28 @@ public void setup() {
public void generateFileNameFrom() throws Exception {
String locale = "locale";
String region = "region";
String fileName = jpfH.generateFileNameFrom("base.properties", locale, region);
ProjectLanguage projectLanguage = new ProjectLanguage("code", "englishName", "localName", locale, region,
false, true, "translationProgress", "uploadedAt", 1L);
String fileName = jpfH.generateFileNameFrom("base.properties", projectLanguage);
Assert.assertEquals("base_" + locale + "_" + region.toUpperCase() + ".properties", fileName);
}
@Test
public void generateFileNameWithoutRegion() {
String locale = "locale";
String fileName = jpfH.generateFileNameFrom("base.properties", locale, null);
ProjectLanguage projectLanguage = new ProjectLanguage("code", "englishName", "localName", locale, "",
false, true, "translationProgress", "uploadedAt", 1L);
String fileName = jpfH.generateFileNameFrom("base.properties", projectLanguage);
Assert.assertEquals("base_" + locale + ".properties", fileName);
}
@Test
public void generateFileNameWithoutLocaleOrRegion() {
String fileName = jpfH.generateFileNameFrom("base.properties", null, null);
ProjectLanguage projectLanguage = new ProjectLanguage("code", "englishName", "localName", "", "",
false, true, "translationProgress", "uploadedAt", 1L);
String fileName = jpfH.generateFileNameFrom("base.properties", projectLanguage);
Assert.assertEquals("base.properties", fileName);
}

0 comments on commit 2baaca2

Please sign in to comment.