use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class LockLegacyAPITest method lockLegacyAPITest.
@Test
public void lockLegacyAPITest() 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(22, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(893, problem.startOffset);
assertEquals(940, problem.endOffset);
} else {
assertEquals(872, problem.startOffset);
assertEquals(919, problem.endOffset);
}
problem = problems.get(1);
assertEquals(46, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1420, problem.startOffset);
assertEquals(1484, problem.endOffset);
} else {
assertEquals(1375, problem.startOffset);
assertEquals(1438, problem.endOffset);
}
problem = problems.get(2);
assertEquals(62, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1747, problem.startOffset);
assertEquals(1806, problem.endOffset);
} else {
assertEquals(1686, problem.startOffset);
assertEquals(1745, problem.endOffset);
}
problem = problems.get(3);
assertEquals(73, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1971, problem.startOffset);
assertEquals(2044, problem.endOffset);
} else {
assertEquals(1899, problem.startOffset);
assertEquals(1971, problem.endOffset);
}
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class MVCPortletClassInPortletXMLTest method testPortletXmlFileLineNumbers.
@Test
public void testPortletXmlFileLineNumbers() throws Exception {
assertNotNull(fileMigrators[0]);
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
assertEquals(7, problems.get(0).lineNumber);
assertEquals(37, problems.get(1).lineNumber);
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class ConfigurationActionRenderMethodTest method editConfigurationActionFile.
@Test
public void editConfigurationActionFile() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(editConfigurationActionFile);
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(1, problems.size());
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class DDMLegacyAPITest method dDMLegacyAPITest.
@Test
public void dDMLegacyAPITest() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(5, problems.size());
Problem problem = problems.get(0);
assertEquals(36, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1704, problem.startOffset);
assertEquals(1779, problem.endOffset);
} else {
assertEquals(1669, problem.startOffset);
assertEquals(1744, problem.endOffset);
}
problem = problems.get(1);
assertEquals(134, problem.lineNumber);
if (Util.isWindows()) {
assertTrue(problem.startOffset >= 4829 && problem.startOffset <= 4832);
assertTrue(problem.endOffset >= 4886 && problem.endOffset <= 4889);
} else {
assertTrue(problem.startOffset >= 4696 && problem.startOffset <= 4699);
assertTrue(problem.endOffset >= 4753 && problem.endOffset <= 4756);
}
problem = problems.get(2);
assertEquals(147, problem.lineNumber);
if (Util.isWindows()) {
assertTrue(problem.startOffset >= 5177 && problem.startOffset <= 5180);
assertTrue(problem.endOffset >= 5234 && problem.endOffset <= 5237);
} else {
assertTrue(problem.startOffset >= 5031 && problem.startOffset <= 5034);
assertTrue(problem.endOffset >= 5088 && problem.endOffset <= 5091);
}
problem = problems.get(3);
assertEquals(37, problem.lineNumber);
if (Util.isWindows()) {
assertTrue(problem.startOffset >= 1789 && problem.startOffset <= 1792);
assertTrue(problem.endOffset >= 1859 && problem.endOffset <= 1862);
} else {
assertEquals(1753, problem.startOffset);
assertEquals(1823, problem.endOffset);
}
problem = problems.get(4);
assertEquals(162, problem.lineNumber);
if (Util.isWindows()) {
assertTrue(problem.startOffset >= 5573 && problem.startOffset <= 5576);
assertTrue(problem.endOffset >= 5690 && problem.endOffset <= 5693);
} else {
assertTrue(String.valueOf(problem.startOffset), problem.startOffset >= 5412 && problem.startOffset <= 5415);
assertTrue(String.valueOf(problem.endOffset), problem.endOffset >= 5527 && problem.endOffset <= 5530);
}
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class DDMStructureLocalServiceInvocationTest method ddmTemplateAnalyzeTest.
@Test
public void ddmTemplateAnalyzeTest() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(1, problems.size());
Problem problem = problems.get(0);
assertEquals(7, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(144, problem.startOffset);
assertEquals(270, problem.endOffset);
} else {
assertEquals(138, problem.startOffset);
assertEquals(264, problem.endOffset);
}
}
Aggregations