-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JAR files are not refreshed after they are updated
Signed-off-by: Snjezana Peco <[email protected]>
- Loading branch information
Showing
10 changed files
with
144 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
org.eclipse.jdt.ls.tests/projects/eclipse/updatejar/.classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="lib" path="lib/foo.jar"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
17 changes: 17 additions & 0 deletions
17
org.eclipse.jdt.ls.tests/projects/eclipse/updatejar/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>updatejar</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
org.eclipse.jdt.ls.tests/projects/eclipse/updatejar/src/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import foo.bar; | ||
|
||
public class Test { | ||
|
||
public static void main(String[] args) { | ||
int sum = bar.add(1, 2, 3); | ||
System.out.println(sum); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...e.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/managers/EclipseBuildSupportTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2019 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.jdt.ls.core.internal.managers; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.io.File; | ||
import java.util.List; | ||
|
||
import org.apache.commons.io.FileUtils; | ||
import org.eclipse.core.resources.IMarker; | ||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.core.resources.ResourcesPlugin; | ||
import org.eclipse.jdt.ls.core.internal.ResourceUtils; | ||
import org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.CHANGE_TYPE; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.mockito.runners.MockitoJUnitRunner; | ||
|
||
/** | ||
* @author snjeza | ||
* | ||
*/ | ||
@RunWith(MockitoJUnitRunner.class) | ||
public class EclipseBuildSupportTest extends AbstractProjectsManagerBasedTest { | ||
|
||
@Test | ||
public void testUpdateJar() throws Exception { | ||
importProjects("eclipse/updatejar"); | ||
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("updatejar"); | ||
assertIsJavaProject(project); | ||
List<IMarker> errors = ResourceUtils.getErrorMarkers(project); | ||
assertEquals("Unexpected errors " + ResourceUtils.toString(errors), 2, errors.size()); | ||
File projectFile = project.getLocation().toFile(); | ||
File validFooJar = new File(projectFile, "foo.jar"); | ||
File destLib = new File(projectFile, "lib"); | ||
FileUtils.copyFileToDirectory(validFooJar, destLib); | ||
File newJar = new File(destLib, "foo.jar"); | ||
projectsManager.fileChanged(newJar.toPath().toUri().toString(), CHANGE_TYPE.CREATED); | ||
waitForBackgroundJobs(); | ||
errors = ResourceUtils.getErrorMarkers(project); | ||
assertEquals("Unexpected errors " + ResourceUtils.toString(errors), 0, errors.size()); | ||
|
||
} | ||
|
||
|
||
} |