use of com.liferay.blade.api.Migration in project liferay-ide by liferay.
the class AUILayoutTagsTest method findProblems.
@Test
public void findProblems() throws Exception {
ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
Migration m = context.getService(sr);
List<Problem> problems = m.findProblems(new File("jsptests/aui-layout/"), new NullProgressMonitor());
assertEquals(1, problems.size());
boolean found = false;
for (Problem problem : problems) {
if (problem.file.getName().endsWith("AUILayoutTagTest.jsp")) {
if (problem.lineNumber == 1) {
found = true;
}
}
}
if (!found) {
fail();
}
}
use of com.liferay.blade.api.Migration in project liferay-ide by liferay.
the class AUILiferayTagsTest method findProblems.
@Test
public void findProblems() throws Exception {
ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
Migration m = context.getService(sr);
List<Problem> problems = m.findProblems(new File("jsptests/aui-liferay/"), new NullProgressMonitor());
assertEquals(1, problems.size());
boolean found = false;
for (Problem problem : problems) {
if (problem.file.getName().endsWith("AUILiferayTagTest.jsp")) {
if (problem.lineNumber == 1 && problem.startOffset == 16 && problem.endOffset == 48) {
found = true;
}
}
}
if (!found) {
fail();
}
}
use of com.liferay.blade.api.Migration in project liferay-ide by liferay.
the class AllProblemsTest method allProblems.
@Test
@Ignore
public void allProblems() throws Exception {
ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
Migration m = context.getService(sr);
List<Problem> problems = m.findProblems(new File("../com.liferay.blade.upgrade.liferay70/projects/"), new NullProgressMonitor());
final int expectedSize = 304;
final int size = problems.size();
if (size != expectedSize) {
System.err.println("All problems size is " + size + ", expected size is " + expectedSize);
}
assertEquals(expectedSize, size);
for (Problem problem : problems) {
if (problem.html != null && problem.html.equals("#legacy"))
continue;
// if (problem.html == null || problem.html.equals("")) {
// for (ServiceReference<FileMigrator> ref : refs) {
// String section = (String) ref.getProperty("problem.section");
// String title = (String) ref.getProperty("problem.title");
// if (title.equals(problem.title)) {
// for (String line : lines) {
// if (section.startsWith(line)) {
// fail("line=" + line + ", section=" + section);
// }
// }
// }
// }
// }
assertNotNull("problem.title=" + problem.title + ", problem.file=" + problem.file, problem.html);
assertTrue("problem.title=" + problem.title + ", problem.file=" + problem.file, problem.html.length() > 0);
}
}
Aggregations