use of com.liferay.blade.api.FileMigrator in project liferay-ide by liferay.
the class APITestBase method test.
@Test
public void test() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(getExpectedNumber(), problems.size());
}
use of com.liferay.blade.api.FileMigrator in project liferay-ide by liferay.
the class ActionCommandImportsTest method sayHelloActionCommandFile2.
@Test
public void sayHelloActionCommandFile2() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(sayHelloActionCommandFile2);
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 CalendarLegacyAPITest method calendarLegacyAPITest.
@Test
public void calendarLegacyAPITest() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(7, problems.size());
Problem problem = problems.get(0);
assertEquals(38, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1886, problem.startOffset);
assertEquals(1946, problem.endOffset);
} else {
assertEquals(1849, problem.startOffset);
assertEquals(1909, problem.endOffset);
}
problem = problems.get(1);
assertEquals(39, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1956, problem.startOffset);
assertEquals(2011, problem.endOffset);
} else {
assertEquals(1918, problem.startOffset);
assertEquals(1973, problem.endOffset);
}
problem = problems.get(2);
assertEquals(40, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2021, problem.startOffset);
assertEquals(2074, problem.endOffset);
} else {
assertEquals(1982, problem.startOffset);
assertEquals(2035, problem.endOffset);
}
problem = problems.get(3);
assertEquals(159, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(7006, problem.startOffset);
assertEquals(7143, problem.endOffset);
} else {
assertEquals(6848, problem.startOffset);
assertEquals(6983, problem.endOffset);
}
problem = problems.get(4);
assertEquals(43, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2228, problem.startOffset);
assertEquals(2276, problem.endOffset);
} else {
assertEquals(2186, problem.startOffset);
assertEquals(2234, problem.endOffset);
}
problem = problems.get(5);
assertEquals(41, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2084, problem.startOffset);
assertEquals(2152, problem.endOffset);
} else {
assertEquals(2044, problem.startOffset);
assertEquals(2112, problem.endOffset);
}
problem = problems.get(6);
assertEquals(42, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2162, problem.startOffset);
assertEquals(2218, problem.endOffset);
} else {
assertEquals(2121, problem.startOffset);
assertEquals(2177, problem.endOffset);
}
}
use of com.liferay.blade.api.FileMigrator in project liferay-ide by liferay.
the class DDLRecordLegacyAPITest method dDLRecordLegacyAPITest.
@Test
public void dDLRecordLegacyAPITest() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(3, problems.size());
Problem problem = problems.get(0);
assertEquals(30, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(1361, problem.startOffset);
assertEquals(1426, problem.endOffset);
} else {
assertEquals(1332, problem.startOffset);
assertEquals(1397, problem.endOffset);
}
problem = problems.get(1);
assertEquals(132, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(4220, problem.startOffset);
assertEquals(4263, problem.endOffset);
} else {
assertEquals(4089, problem.startOffset);
assertEquals(4132, problem.endOffset);
}
problem = problems.get(2);
assertEquals(145, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(4619, problem.startOffset);
assertEquals(4699, problem.endOffset);
} else {
assertEquals(4475, problem.startOffset);
assertEquals(4554, problem.endOffset);
}
}
use of com.liferay.blade.api.FileMigrator in project liferay-ide by liferay.
the class MarketplaceLegacyAPITest method marketplaceLegacyAPITest.
@Test
public void marketplaceLegacyAPITest() throws Exception {
FileMigrator fmigrator = context.getService(fileMigrators[0]);
List<Problem> problems = fmigrator.analyze(getTestFile());
context.ungetService(fileMigrators[0]);
assertNotNull(problems);
assertEquals(6, problems.size());
Problem problem = problems.get(0);
assertEquals(18, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(681, problem.startOffset);
assertEquals(732, problem.endOffset);
} else {
assertEquals(664, problem.startOffset);
assertEquals(715, problem.endOffset);
}
problem = problems.get(1);
assertEquals(60, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2068, problem.startOffset);
assertEquals(2176, problem.endOffset);
} else {
assertEquals(2009, problem.startOffset);
assertEquals(2115, problem.endOffset);
}
problem = problems.get(2);
assertEquals(87, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2887, problem.startOffset);
assertEquals(2947, problem.endOffset);
} else {
assertEquals(2801, problem.startOffset);
assertEquals(2861, problem.endOffset);
}
problem = problems.get(3);
assertEquals(19, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(742, problem.startOffset);
assertEquals(796, problem.endOffset);
} else {
assertEquals(724, problem.startOffset);
assertEquals(778, problem.endOffset);
}
problem = problems.get(4);
assertEquals(73, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2503, problem.startOffset);
assertEquals(2613, problem.endOffset);
} else {
assertEquals(2431, problem.startOffset);
assertEquals(2539, problem.endOffset);
}
problem = problems.get(5);
assertEquals(82, problem.lineNumber);
if (Util.isWindows()) {
assertEquals(2764, problem.startOffset);
assertEquals(2875, problem.endOffset);
} else {
assertEquals(2683, problem.startOffset);
assertEquals(2792, problem.endOffset);
}
}
Aggregations