-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to standard java package dirs in Java example projects, other cl…
…eanups (#3286) * Intellij can't properly index Java classes without the standard folder path (unlike Scala), so we should follow the standard convention in the Java example projects so people get a good experience when downloading/unzipping/loading them * Add `.mill-version` files to example zips for VSCode/Metals compatibility * Make `3-todo-spring-boot` exercise testcontainers/postgres/integration-testing * Add google analytics to docsite * Other tweaks to examples
- Loading branch information
Showing
84 changed files
with
241 additions
and
106 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ Inputs: | |
> mill show foo.allSourceFiles | ||
[ | ||
".../foo/src/Foo..." | ||
".../foo/src.../Foo..." | ||
] | ||
*/ | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
19 changes: 0 additions & 19 deletions
19
example/javabuilds/5-test-suite/bar/test/src/BarTests.java
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
example/javabuilds/5-test-suite/bar/test/src/bar/BarTests.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,32 @@ | ||
package bar; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
import static org.mockito.Mockito.*; | ||
import org.junit.Test; | ||
|
||
public class BarTests { | ||
|
||
@Test | ||
public void hello() { | ||
String result = new Bar().hello(); | ||
assertTrue(result.startsWith("Hello")); | ||
} | ||
|
||
@Test | ||
public void world() { | ||
String result = new Bar().hello(); | ||
assertTrue(result.endsWith("World")); | ||
} | ||
|
||
@Test | ||
public void testMockito() { | ||
Bar mockBar = mock(Bar.class); | ||
|
||
when(mockBar.hello()).thenReturn("Hello Mockito World"); | ||
|
||
String result = mockBar.hello(); | ||
|
||
assertTrue(result.equals("Hello Mockito World")); | ||
verify(mockBar).hello(); | ||
} | ||
} |
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
19 changes: 0 additions & 19 deletions
19
example/javabuilds/5-test-suite/foo/test/src/FooTests.java
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
example/javabuilds/5-test-suite/foo/test/src/foo/FooTests.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,32 @@ | ||
package foo; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
import static org.mockito.Mockito.*; | ||
import org.junit.Test; | ||
|
||
public class FooTests { | ||
|
||
@Test | ||
public void hello() { | ||
String result = new Foo().hello(); | ||
assertTrue(result.startsWith("Hello")); | ||
} | ||
|
||
@Test | ||
public void world() { | ||
String result = new Foo().hello(); | ||
assertTrue(result.endsWith("World")); | ||
} | ||
|
||
@Test | ||
public void testMockito() { | ||
Foo mockFoo = mock(Foo.class); | ||
|
||
when(mockFoo.hello()).thenReturn("Hello Mockito World"); | ||
|
||
String result = mockFoo.hello(); | ||
|
||
assertTrue(result.equals("Hello Mockito World")); | ||
verify(mockFoo).hello(); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
.../integration/src/QuxIntegrationTests.java → ...egration/src/qux/QuxIntegrationTests.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
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...s/5-test-suite/qux/test/src/QuxTests.java → ...test-suite/qux/test/src/qux/QuxTests.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion
4
...le/4-test-deps/baz/test/src/BazTests.java → ...-test-deps/baz/test/src/baz/BazTests.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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package baz; | ||
|
||
import org.junit.Test; | ||
import com.google.common.math.IntMath; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class BazTests { | ||
|
||
@Test | ||
public void simple() { | ||
BazTestUtils.bazAssertEquals(Baz.getValue(), 123); | ||
BazTestUtils.bazAssertEquals(Baz.getValue(), IntMath.mean(122, 124)); | ||
} | ||
} |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
example/javamodule/4-test-deps/qux/test/src/qux/QuxTests.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,12 @@ | ||
package qux; | ||
|
||
import org.junit.Test; | ||
import com.google.common.base.Ascii; | ||
|
||
public class QuxTests { | ||
|
||
@Test | ||
public void simple() { | ||
baz.BazTestUtils.bazAssertEquals(Ascii.toLowerCase("XYZ"), Qux.getValue()); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
1 change: 1 addition & 0 deletions
1
...javaweb/1-hello-jetty/src/HelloJetty.java → ...llo-jetty/src/com/example/HelloJetty.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
1 change: 1 addition & 0 deletions
1
...-hello-jetty/test/src/HelloJettyTest.java → .../test/src/com/example/HelloJettyTest.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
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.