Skip to content

Commit

Permalink
IDE-5116 fix maven test error
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjhy committed Nov 24, 2023
1 parent d02508e commit 5011af9
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 37 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ jobs:
with:
repository: gamerson/liferay-ide-m2-repository
path: liferay-ide-m2-repository
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: sf.sh
shell: bash
working-directory: build/com.liferay.ide.build.source.formatter
run: |
./csf.sh
Verify:
name: Verify
runs-on: macos-latest
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout liferay-ide
Expand All @@ -38,10 +38,10 @@ jobs:
with:
repository: gamerson/liferay-ide-m2-repository
path: liferay-ide-m2-repository
- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'zulu'
cache: maven

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,8 @@ ${java_executable}
<startMenuGroupName></startMenuGroupName>
<vendor>Liferay, Inc</vendor>
<width>600</width>
<!-- <windowsSigningPkcs12File>${build_project_directory}/liferay.pfx</windowsSigningPkcs12File>
<windowsSigningPkcs12Password>${env(WINDOWS_SIGNING_PASSWORD)}</windowsSigningPkcs12Password> -->
<parameterList>
<fileParameter>
<name>java_executable</name>
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions build/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
<blade-392-md5>08aedcb6bacc3166060d0032f9489dd1</blade-392-md5>
<upgrade-plan-content-zip-url>https://us-east-1.linodeobjects.com/devtools-s3.liferay.com/liferay-ide-files/docs/code-upgrade-docs-20210312.zip</upgrade-plan-content-zip-url>
<upgrade-plan-content-zip-md5>c4bce64c362ecffcce300f31e88b2e63</upgrade-plan-content-zip-md5>
<bndtools-site>https://bndtools.jfrog.io/artifactory/update-latest/org/bndtools/org.bndtools.p2/5.3.0/org.bndtools.p2-5.3.0.jar!</bndtools-site>
<bndtools-site>https://bndtools.jfrog.io/artifactory/update-latest/org/bndtools/org.bndtools.p2/7.0.0/org.bndtools.p2-7.0.0.jar!</bndtools-site>
<eclipse-site>https://download.eclipse.org/releases/2023-12/202311171000/</eclipse-site>
<eclipse-xml-search-site>https://us-east-1.linodeobjects.com/devtools-s3.liferay.com/eclipse/eclipse-wtp-xml-search/</eclipse-xml-search-site>
<gradle-site>https://download.eclipse.org/buildship/updates/e427/releases/3.x/3.1.7.v20230428-1350</gradle-site>
<gradle-site>https://download.eclipse.org/buildship/updates/e427/releases/3.x/3.1.8.v20231117-1658/</gradle-site>
<liferay-ide-swtbot-testing-site>https://files.liferay.org.es/staged/public-files/liferay-ide/unstable/build/com.liferay.ide.testing-repository/target/repository/</liferay-ide-swtbot-testing-site>
<liferay-ide-tag>ga1</liferay-ide-tag>
<orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/R20230531010532/repository</orbit-site>
<orbit-site>https://download.eclipse.org/tools/orbit/downloads/drops/N20230908195041/repository</orbit-site>
<sapphire-site>https://us-east-1.linodeobjects.com/devtools-s3.liferay.com/eclipse/sapphire/9.1.1/</sapphire-site>
<osgi-bundles-site>https://us-east-1.linodeobjects.com/devtools-s3.liferay.com/eclipse/liferay-ide-deps/201904221700/</osgi-bundles-site>
<sign-apps>false</sign-apps>
<swtbot-site>https://download.eclipse.org/technology/swtbot/releases/2.8.0/</swtbot-site>
<tm-site>https://download.eclipse.org/tm/updates/4.5.0/repository/</tm-site>
<tm-site>https://download.eclipse.org/tm/updates/4.5.500/repository/</tm-site>
<jre-site>https://download.eclipse.org/justj/jres/17/updates/release/latest</jre-site>
<tycho-packaging-format>yyyyMMddHHmm'-ga1'</tycho-packaging-format>
<tycho-version>3.0.5</tycho-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void configureClasspath(IMavenProjectFacade facade, IClasspathDescriptor
public void configureRawClasspath(
ProjectConfigurationRequest request, IClasspathDescriptor classpath, IProgressMonitor monitor)
throws CoreException {

IMavenProjectFacade mavenProjectFacade = request.mavenProjectFacade();

IClasspathEntry jreContainerEntry = MavenClasspathHelpers.getJREContainerEntry(
Expand All @@ -293,7 +293,6 @@ public void configureRawClasspath(
JavaRuntime.newJREContainerPath(JavaRuntime.getDefaultVMInstall()));

classpath.addEntry(defaultJREContainerEntry);

}

protected void configureDeployedName(IProject project, String deployedFileName) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Automatic-Module-Name: com.liferay.ide.maven.core.tests
Bundle-Name: Liferay Maven Core Tests
Bundle-SymbolicName: com.liferay.ide.maven.core.tests
Bundle-Version: 4.0.0.qualifier
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@

import static org.junit.Assert.assertTrue;

import com.liferay.ide.core.tests.TestUtil;
import com.liferay.ide.core.util.CoreUtil;
import com.liferay.ide.project.core.modules.fragment.NewModuleFragmentOp;
import com.liferay.ide.project.core.modules.fragment.OverrideFilePath;
import com.liferay.ide.project.core.workspace.NewLiferayWorkspaceOp;
import com.liferay.ide.project.core.workspace.NewLiferayWorkspaceOpMethods;
import com.liferay.ide.server.core.tests.ServerCoreBase;
import com.liferay.ide.server.util.ServerUtil;

import java.util.List;

import org.eclipse.core.resources.IFile;
Expand All @@ -40,6 +31,15 @@
import org.junit.BeforeClass;
import org.junit.Test;

import com.liferay.ide.core.tests.TestUtil;
import com.liferay.ide.core.util.CoreUtil;
import com.liferay.ide.project.core.modules.fragment.NewModuleFragmentOp;
import com.liferay.ide.project.core.modules.fragment.OverrideFilePath;
import com.liferay.ide.project.core.workspace.NewLiferayWorkspaceOp;
import com.liferay.ide.project.core.workspace.NewLiferayWorkspaceOpMethods;
import com.liferay.ide.server.core.tests.ServerCoreBase;
import com.liferay.ide.server.util.ServerUtil;

/**
* @author Joye Luo
*/
Expand Down Expand Up @@ -135,14 +135,15 @@ public static void createLiferayWorkspaceProject() throws Exception {
workspaceOp.setProjectProvider("maven-liferay-workspace");
workspaceOp.setWorkspaceName( "test-maven-liferay-workspace" );
workspaceOp.setUseDefaultLocation( true );
workspaceOp.setProvisionLiferayBundle(true);
workspaceOp.setProvisionLiferayBundle(false);
workspaceOp.setServerName("test-maven-liferay-workspace");
workspaceOp.setLiferayVersion("7.3");
workspaceOp.setLiferayVersion("7.4");
workspaceOp.setTargetPlatform("7.4.3.101");

TestUtil.waitForBuildAndValidation();

NewLiferayWorkspaceOpMethods.execute( workspaceOp, ProgressMonitorBridge.create( new NullProgressMonitor() ) );

IProject workspaceProject = CoreUtil.getProject( "test-maven-liferay-workspace" );

assertTrue(workspaceProject != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.JavaRuntime;

import org.gradle.tooling.CancellationTokenSource;
Expand Down Expand Up @@ -341,15 +342,18 @@ public static String runGradleTask(
GradleBuild gradleBuild = gradleBuildOpt.get();

try {
IVMInstall defaultVMInstall = JavaRuntime.getDefaultVMInstall();

File jvmInstallLocation = defaultVMInstall.getInstallLocation();

if (redirectOutput) {
OutputStream outputStream = new ByteArrayOutputStream();

gradleBuild.withConnection(
connection -> {
connection.newBuild(
).setJavaHome(
JavaRuntime.getDefaultVMInstall(
).getInstallLocation()
jvmInstallLocation
).addArguments(
arguments
).forTasks(
Expand All @@ -371,8 +375,7 @@ public static String runGradleTask(
connection -> {
connection.newBuild(
).setJavaHome(
JavaRuntime.getDefaultVMInstall(
).getInstallLocation()
jvmInstallLocation
).addArguments(
arguments
).forTasks(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ protected String compute() {

@Override
protected void initDefaultValueService() {
super.initDefaultValueService();

PossibleValuesService possibleValuesService = _possibleValuesService();

_listener = new Listener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ else if (CoreUtil.isNullOrEmpty(version2Qualifier)) {

@Override
protected void initPossibleValuesService() {
Job getProductVersions = new Job("Get product versions") {
Job getTargetPlatformVersions = new Job("Get target platform versions") {

@Override
protected IStatus run(IProgressMonitor monitor) {
Expand All @@ -167,9 +167,9 @@ protected IStatus run(IProgressMonitor monitor) {

};

getProductVersions.setSystem(true);
getTargetPlatformVersions.setSystem(true);

getProductVersions.schedule();
getTargetPlatformVersions.schedule();

_listener = new FilteredListener<PropertyContentEvent>() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static void waitForBuildAndValidation() throws Exception {
manager.join(ValidatorManager.VALIDATOR_JOB_FAMILY, new NullProgressMonitor());
manager.join(ResourcesPlugin.FAMILY_AUTO_BUILD, new NullProgressMonitor());
JobUtil.waitForLiferayProjectJob();
Thread.sleep(200);
Thread.sleep(500);
manager.beginRule(root = workspace.getRoot(), null);
}
catch (InterruptedException ie) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void testNewLiferayModuleProjectNameValidataionService() throws Exception
{
NewLiferayModuleProjectOp op = NewLiferayModuleProjectOp.TYPE.instantiate();

op.setProjectName( "my-test-project" );
op.setProjectName( "my-test-project-validataionService" );

assertTrue( op.validation().ok() );

Expand Down Expand Up @@ -229,7 +229,7 @@ public void testNewLiferayModuleProjectNewProperties() throws Exception

Status exStatus =
NewLiferayModuleProjectOpMethods.execute( op, ProgressMonitorBridge.create( new NullProgressMonitor() ) );

assertEquals( "OK", exStatus.message() );

TestUtil.waitForBuildAndValidation();
Expand Down Expand Up @@ -265,6 +265,8 @@ public void testNewLiferayPanelAppNewProperties() throws Exception
Status exStatus =
NewLiferayModuleProjectOpMethods.execute( op, ProgressMonitorBridge.create( new NullProgressMonitor() ) );

TestUtil.waitForBuildAndValidation();

assertTrue( exStatus.message(), exStatus.ok() );

IProject modPorject = CoreUtil.getProject( op.getProjectName().content() );
Expand Down

0 comments on commit 5011af9

Please sign in to comment.