Skip to content

Commit e8e9b03

Browse files
committed
List files in project + deploy location
1 parent 31c721b commit e8e9b03

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

plugins/com.google.cloud.tools.eclipse.integration.appengine/src/com/google/cloud/tools/eclipse/integration/appengine/DebugNativeAppEngineStandardProjectTest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
import java.net.URL;
4949
import java.net.URLConnection;
5050
import java.nio.charset.StandardCharsets;
51+
import java.nio.file.FileVisitResult;
52+
import java.nio.file.Files;
53+
import java.nio.file.Path;
54+
import java.nio.file.Paths;
55+
import java.nio.file.SimpleFileVisitor;
56+
import java.nio.file.attribute.BasicFileAttributes;
5157
import java.util.concurrent.TimeUnit;
5258

5359
/**
@@ -118,6 +124,11 @@ public void run() {
118124

119125
System.out.printf("---- Dev App Server ----\n%s\n------------------\n",
120126
consoleContents.getText());
127+
128+
listFiles(project.getLocation().toFile().toPath());
129+
listFiles(Paths.get(
130+
"/home/travis/build/GoogleCloudPlatform/google-cloud-eclipse/plugins/com.google.cloud.tools.eclipse.integration.appengine/target/work/data/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/testapp"));
131+
121132
assertEquals("Hello App Engine!",
122133
getUrlContents(new URL("http://localhost:8080/hello"), (int) SWTBotPreferences.TIMEOUT));
123134

@@ -137,6 +148,24 @@ public void run() {
137148
assertFalse("Stop Server button should be disabled", stopServerButton.isEnabled());
138149
}
139150

151+
/**
152+
* @param path
153+
*/
154+
private void listFiles(Path path) {
155+
try {
156+
System.out.println(">> files in " + path);
157+
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
158+
@Override
159+
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
160+
System.out.println(">> " + file);
161+
return FileVisitResult.CONTINUE;
162+
}
163+
});
164+
} catch (IOException ex) {
165+
System.err.println("Error while listing files in " + path + ": " + ex);
166+
}
167+
}
168+
140169
/**
141170
* Check that there is no remote service for the URL.
142171
*/

0 commit comments

Comments
 (0)