Search in sources :

Example 11 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class PortletIconTagsTest 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/portlet-icon/"), new NullProgressMonitor());
    assertEquals(13, problems.size());
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Test(org.junit.Test)

Example 12 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class AllJSPTagProblemsTest method allProblems.

@Ignore
@Test
public void allProblems() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/"), new NullProgressMonitor());
    final int expectedSize = 59;
    final int size = problems.size();
    if (size != expectedSize) {
        System.err.println("All problems size is " + size + ", expected size is " + expectedSize);
    }
    assertEquals(expectedSize, size);
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 13 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class AppViewSearchEntryTagsTest 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/app-view-search-entry/"), new NullProgressMonitor());
    assertEquals(3, problems.size());
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Test(org.junit.Test)

Example 14 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class FileSetMigrationTest method findProblemsOnJustFileSet.

@Test
public void findProblemsOnJustFileSet() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    Set<File> fileset = new HashSet<>();
    fileset.add(new File("jsptests/app-view-search-entry/AppViewSearchEntryTagsTest.jsp"));
    fileset.add(new File("jsptests/asset-preview/AssetPreviewTest.jsp"));
    List<Problem> problems = m.findProblems(fileset, new NullProgressMonitor());
    assertEquals(4, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("AssetPreviewTest.jsp") && problem.lineNumber == 7 && problem.startOffset >= 230 && problem.endOffset >= 310) {
            found = true;
        }
    }
    if (!found) {
        fail();
    }
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 15 with Migration

use of com.liferay.blade.api.Migration in project liferay-ide by liferay.

the class InitJSPParseTest method initParseErrorCheck.

@Test
public void initParseErrorCheck() throws Exception {
    ServiceReference<Migration> sr = context.getServiceReference(Migration.class);
    Migration m = context.getService(sr);
    List<Problem> problems = m.findProblems(new File("jsptests/jukebox-portlet/"), new NullProgressMonitor());
    assertEquals(327, problems.size());
    boolean found = false;
    for (Problem problem : problems) {
        if (problem.file.getName().endsWith("view_search.jsp")) {
            if (problem.lineNumber == 109) {
                found = true;
            }
        }
    }
    if (!found) {
        fail();
    }
}
Also used : NullProgressMonitor(com.liferay.blade.util.NullProgressMonitor) Migration(com.liferay.blade.api.Migration) Problem(com.liferay.blade.api.Problem) File(java.io.File) Test(org.junit.Test)

Aggregations

Migration (com.liferay.blade.api.Migration)28 Problem (com.liferay.blade.api.Problem)28 File (java.io.File)28 Test (org.junit.Test)27 NullProgressMonitor (com.liferay.blade.util.NullProgressMonitor)26 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 Ignore (org.junit.Ignore)2 AutoMigrator (com.liferay.blade.api.AutoMigrator)1 ProgressMonitor (com.liferay.blade.api.ProgressMonitor)1 FileProblems (com.liferay.ide.project.core.upgrade.FileProblems)1 MigrationProblems (com.liferay.ide.project.core.upgrade.MigrationProblems)1 MigrationProblemsContainer (com.liferay.ide.project.core.upgrade.MigrationProblemsContainer)1 UpgradeProblems (com.liferay.ide.project.core.upgrade.UpgradeProblems)1 ExecutionException (org.eclipse.core.commands.ExecutionException)1 IFile (org.eclipse.core.resources.IFile)1 WorkspaceJob (org.eclipse.core.resources.WorkspaceJob)1 CoreException (org.eclipse.core.runtime.CoreException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1