-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wait for 1 second in test when file changed
Fixes #574 Signed-off-by: azerr <[email protected]>
- Loading branch information
1 parent
f8a2c15
commit 179e3d6
Showing
6 changed files
with
76 additions
and
16 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
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
40 changes: 40 additions & 0 deletions
40
.../test/java/org/eclipse/lsp4xml/extensions/contentmodel/model/FilesChangedTrackerTest.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,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2019 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lsp4xml.extensions.contentmodel.model; | ||
|
||
import java.io.IOException; | ||
|
||
import org.eclipse.lsp4xml.extensions.contentmodel.BaseFileTempTest; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Test for {@link FilesChangedTracker} | ||
* | ||
* @author Angelo ZERR | ||
* | ||
*/ | ||
public class FilesChangedTrackerTest extends BaseFileTempTest { | ||
|
||
@Test | ||
public void trackFile() throws IOException { | ||
FilesChangedTracker tracker = new FilesChangedTracker(); | ||
String fileURI = tempDirUri.getPath() + "/track.xml"; | ||
createFile(fileURI, "<root />"); | ||
tracker.addFileURI("file://" + fileURI); | ||
|
||
Assert.assertFalse("No dirty after file creation", tracker.isDirty()); | ||
|
||
updateFile(fileURI, "<root />"); | ||
Assert.assertTrue("Dirty after file modification on isDirty first call", tracker.isDirty()); | ||
Assert.assertFalse("NO Dirty after file modification on isDirty second call", tracker.isDirty()); | ||
|
||
} | ||
} |