use of com.liferay.blade.api.FileMigrator 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.FileMigrator 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);
}
}
use of com.liferay.blade.api.FileMigrator in project liferay-ide by liferay.
the class WebContentLegacyAPITest method webContentLegacyAPITest.
@Test
public void webContentLegacyAPITest() 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(20, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(961, problem.startOffset);
assertEquals(1023, problem.endOffset);
} else {
assertEquals(942, problem.startOffset);
assertEquals(1004, problem.endOffset);
}
problem = problems.get(1);
assertEquals(47, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1917, problem.startOffset);
assertEquals(1950, problem.endOffset);
} else {
assertEquals(1871, problem.startOffset);
assertEquals(1904, problem.endOffset);
}
problem = problems.get(2);
assertEquals(21, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1033, problem.startOffset);
assertEquals(1099, problem.endOffset);
} else {
assertEquals(1013, problem.startOffset);
assertEquals(1079, problem.endOffset);
}
problem = problems.get(3);
assertEquals(41, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1637, problem.startOffset);
assertEquals(1695, problem.endOffset);
} else {
assertEquals(1597, problem.startOffset);
assertEquals(1655, problem.endOffset);
}
problem = problems.get(4);
assertEquals(45, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1830, problem.startOffset);
assertEquals(1873, problem.endOffset);
} else {
assertEquals(1786, problem.startOffset);
assertEquals(1829, problem.endOffset);
}
}
use of com.liferay.blade.api.FileMigrator in project liferay-ide by liferay.
the class DeprecatedMethodsTest method deprecatedMethodsNoneVersionTestFile.
@Test
public void deprecatedMethodsNoneVersionTestFile() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(deprecatedMethodsNoneVersionTestFile);
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(2, problems.size());
}
use of com.liferay.blade.api.FileMigrator in project liferay-ide by liferay.
the class DeprecatedMethodsTest method deprecatedMethods61TestFile.
@Test
public void deprecatedMethods61TestFile() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(deprecatedMethods61TestFile);
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(4, problems.size());
}
Aggregations