use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class MobileDeviceRulesLegacyAPITest method mobileDeviceRulesLegacyAPITest.
@Test
public void mobileDeviceRulesLegacyAPITest() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(8, problems.size());
Problem problem = problems.get(0);
assertEquals(36, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1554, problem.startOffset);
assertEquals(1625, problem.endOffset);
} else {
assertEquals(1519, problem.startOffset);
assertEquals(1590, problem.endOffset);
}
problem = problems.get(1);
assertEquals(64, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2804, problem.startOffset);
assertEquals(2900, problem.endOffset);
} else {
assertEquals(2741, problem.startOffset);
assertEquals(2836, problem.endOffset);
}
problem = problems.get(2);
assertEquals(37, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1635, problem.startOffset);
assertEquals(1701, problem.endOffset);
} else {
assertEquals(1599, problem.startOffset);
assertEquals(1665, problem.endOffset);
}
problem = problems.get(3);
assertEquals(68, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2960, problem.startOffset);
assertEquals(3183, problem.endOffset);
} else {
assertEquals(2893, problem.startOffset);
assertEquals(3112, problem.endOffset);
}
problem = problems.get(4);
assertEquals(38, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1711, problem.startOffset);
assertEquals(1793, problem.endOffset);
} else {
assertEquals(1674, problem.startOffset);
assertEquals(1756, problem.endOffset);
}
problem = problems.get(5);
assertEquals(50, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2248, problem.startOffset);
assertEquals(2360, problem.endOffset);
} else {
assertEquals(2199, problem.startOffset);
assertEquals(2310, problem.endOffset);
}
problem = problems.get(6);
assertEquals(39, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1803, problem.startOffset);
assertEquals(1880, problem.endOffset);
} else {
assertEquals(1765, problem.startOffset);
assertEquals(1842, problem.endOffset);
}
problem = problems.get(7);
assertEquals(57, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2513, problem.startOffset);
assertEquals(2756, problem.endOffset);
} else {
assertEquals(2457, problem.startOffset);
assertEquals(2696, problem.endOffset);
}
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class PortletConfigGetFormatMethodsTest method unicodeLanguageImplFile.
@Test
public void unicodeLanguageImplFile() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(unicodeLanguageImplFile);
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(23, problems.size());
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class PortletConfigGetFormatMethodsTest method languageUtilJspFile.
@Test
public void languageUtilJspFile() {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(languageUtilJspFile);
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(5, problems.size());
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class ShoppingCartLegacyAPITest method shoppingCartLegacyAPITest.
@Test
public void shoppingCartLegacyAPITest() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(4, problems.size());
Problem problem = problems.get(0);
assertEquals(32, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1475, problem.startOffset);
assertEquals(1540, problem.endOffset);
} else {
assertEquals(1444, problem.startOffset);
assertEquals(1509, problem.endOffset);
}
problem = problems.get(1);
assertEquals(143, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(4691, problem.startOffset);
assertEquals(4858, problem.endOffset);
} else {
assertEquals(4549, problem.startOffset);
assertEquals(4714, problem.endOffset);
}
problem = problems.get(2);
assertEquals(33, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1550, problem.startOffset);
assertEquals(1615, problem.endOffset);
} else {
assertEquals(1518, problem.startOffset);
assertEquals(1583, problem.endOffset);
}
problem = problems.get(3);
assertEquals(118, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(3987, problem.startOffset);
assertEquals(4031, problem.endOffset);
} else {
assertEquals(3870, problem.startOffset);
assertEquals(3914, problem.endOffset);
}
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class SocialNetworkingLegacyAPITest method testFull.
@Test
public void testFull() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(2, problems.size());
Problem problem = problems.get(0);
assertEquals(20, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(781, problem.startOffset);
assertEquals(843, problem.endOffset);
} else {
assertEquals(762, problem.startOffset);
assertEquals(824, problem.endOffset);
}
problem = problems.get(1);
assertEquals(31, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1086, problem.startOffset);
assertEquals(1149, problem.endOffset);
} else {
assertEquals(1056, problem.startOffset);
assertEquals(1119, problem.endOffset);
}
}
Aggregations