File tree 4 files changed +47
-1
lines changed
4 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 2
2
<classpath >
3
3
<classpathentry kind =" con" path =" org.eclipse.jdt.launching.JRE_CONTAINER" />
4
4
<classpathentry kind =" src" path =" src" />
5
+ <classpathentry kind =" src" path =" test" />
6
+ <classpathentry kind =" con" path =" org.eclipse.jdt.junit.JUNIT_CONTAINER/5" />
5
7
<classpathentry kind =" output" path =" bin" />
6
8
</classpath >
Original file line number Diff line number Diff line change 25
25
env :
26
26
DEFAULT_BRANCH : main
27
27
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28
- VALIDATE_ALL_CODEBASE : true
28
+ VALIDATE_ALL_CODEBASE : false
29
29
JAVA_FILE_NAME : java.xml
Original file line number Diff line number Diff line change 14
14
<natures >
15
15
<nature >org.eclipse.jdt.core.javanature</nature >
16
16
</natures >
17
+ <filteredResources >
18
+ <filter >
19
+ <id >1708804304551</id >
20
+ <name ></name >
21
+ <type >30</type >
22
+ <matcher >
23
+ <id >org.eclipse.core.resources.regexFilterMatcher</id >
24
+ <arguments >node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments >
25
+ </matcher >
26
+ </filter >
27
+ </filteredResources >
17
28
</projectDescription >
Original file line number Diff line number Diff line change
1
+ package chapter01 ;
2
+
3
+ import static org .junit .jupiter .api .Assertions .*;
4
+
5
+ import java .io .ByteArrayOutputStream ;
6
+ import java .io .PrintStream ;
7
+
8
+ import org .junit .jupiter .api .Test ;
9
+
10
+ import com .github .jonathanbirkey .chapter01 .Exercise01 ;
11
+
12
+ class TestExercise01 {
13
+
14
+ @ Test
15
+ public void testPrint () {
16
+ ByteArrayOutputStream baos = new ByteArrayOutputStream ();
17
+ PrintStream ps = new PrintStream (baos );
18
+
19
+ PrintStream old = System .out ;
20
+
21
+ System .setOut (ps );
22
+
23
+ // execute Exercise01 main method
24
+ Exercise01 .main (new String [0 ]);
25
+
26
+ System .out .flush ();
27
+ System .setOut (old );
28
+
29
+ // test method
30
+ String expected = "Welcome to Java, Welcome to Computer Science, Programming is fun." ;
31
+ assertEquals (expected , baos .toString ());
32
+ }
33
+ }
You can’t perform that action at this time.
0 commit comments