use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class UpgradeAssistantSettingsUtilTests method readExistingMigrationProblemsContainer.
@Test
public void readExistingMigrationProblemsContainer() throws Exception {
MigrationProblemsContainer migrationProblemsContainer = UpgradeAssistantSettingsUtil.getObjectFromStore(MigrationProblemsContainer.class);
assertNotNull(migrationProblemsContainer);
MigrationProblems[] migrationProblems = migrationProblemsContainer.getProblemsArray();
assertEquals(2, migrationProblems.length);
FileProblems[] fileProblems = migrationProblems[0].getProblems();
assertNotNull(fileProblems);
assertEquals(18, fileProblems.length);
List<Problem> problems = fileProblems[0].getProblems();
assertNotNull(problems);
assertEquals(9, problems.size());
}
use of com.liferay.blade.api.Problem 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.Problem 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.Problem 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());
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class SocialNetworkingLegacyAPITest method testFull2.
@Test
public void testFull2() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(testFile2);
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(6, problems.size());
Problem problem = problems.get(0);
assertEquals(24, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1005, problem.startOffset);
assertEquals(1070, problem.endOffset);
} else {
assertEquals(982, problem.startOffset);
assertEquals(1047, problem.endOffset);
}
problem = problems.get(1);
assertEquals(57, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1892, problem.startOffset);
assertEquals(1955, problem.endOffset);
} else {
assertEquals(1836, problem.startOffset);
assertEquals(1899, problem.endOffset);
}
problem = problems.get(2);
assertEquals(128, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(4271, problem.startOffset);
assertEquals(4570, problem.endOffset);
} else {
assertEquals(4144, problem.startOffset);
assertEquals(4439, problem.endOffset);
}
problem = problems.get(3);
assertEquals(135, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(4591, problem.startOffset);
assertEquals(4914, problem.endOffset);
} else {
assertEquals(4457, problem.startOffset);
assertEquals(4775, problem.endOffset);
}
problem = problems.get(4);
assertEquals(25, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1080, problem.startOffset);
assertEquals(1152, problem.endOffset);
} else {
assertEquals(1056, problem.startOffset);
assertEquals(1128, problem.endOffset);
}
problem = problems.get(5);
assertEquals(156, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(5378, problem.startOffset);
assertEquals(5504, problem.endOffset);
} else {
assertEquals(5223, problem.startOffset);
assertEquals(5348, problem.endOffset);
}
}
Aggregations