Skip to content

Commit bd776b5

Browse files
committed
increment
JUnit params Integer.MAX_Value
1 parent 76f4d48 commit bd776b5

File tree

12 files changed

+184
-103
lines changed

12 files changed

+184
-103
lines changed

.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_params_5_8_2.xml

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sonarIssues.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lacos-e-arrays.iml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
</content>
1313
<orderEntry type="inheritedJdk" />
1414
<orderEntry type="sourceFolder" forTests="false" />
15+
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.8.2" level="project" />
16+
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.2" level="project" />
1517
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" />
1618
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
1719
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.8.2" level="project" />
1820
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.8.2" level="project" />
19-
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.2" level="project" />
2021
<orderEntry type="library" name="Maven: com.google.inject:guice:4.0" level="project" />
2122
<orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" />
2223
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />

pom.xml

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959

6060
<dependencies>
6161

62+
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params -->
63+
<dependency>
64+
<groupId>org.junit.jupiter</groupId>
65+
<artifactId>junit-jupiter-params</artifactId>
66+
<version>5.8.2</version>
67+
<scope>test</scope>
68+
</dependency>
69+
6270
<dependency>
6371
<groupId>junit</groupId>
6472
<artifactId>junit</artifactId>

src/main/java/br/com/dio/exercises/challengefour/FourthChallenge.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class FourthChallenge {
1515
// public HashMap<String, String> input = new HashMap<>();
1616
public static String PAR = "PAR";
1717
public static String IMPAR = "IMPAR";
18+
public static String escolhaParOuImpar;
1819
public static Integer QT;
1920
public static Player player1 = new Player();
2021
public static Player player2 = new Player();
@@ -23,6 +24,14 @@ public FourthChallenge() {
2324

2425
}// end empty constructor
2526

27+
public static String getEscolhaParOuImpar() {
28+
return escolhaParOuImpar;
29+
}
30+
31+
public static void setEscolhaParOuImpar(String escolhaParOuImpar) {
32+
FourthChallenge.escolhaParOuImpar = escolhaParOuImpar;
33+
}
34+
2635
public Boolean isOdd(Integer integer){
2736

2837
System.out.println("calculating integer is odd: "+integer);
@@ -40,11 +49,9 @@ public Boolean isOdd(Integer integer){
4049
public Boolean isUnEven(Integer integer){
4150
if(integer % 2 != 0)
4251
{
43-
return true;
44-
}else if(integer % 2 == 0) {
4552
return false;
4653
}else {
47-
return false;
54+
return true;
4855
}
4956
} // end method isUnEven
5057

src/main/java/br/com/dio/exercises/challengefour/Main.java

+17-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import java.io.InputStreamReader;
66
import java.util.*;
77

8+
import static java.util.Arrays.*;
9+
810
// import static br.com.dio.exercises.challengefour.FourthChallenge.IMPAR;
911
// import static br.com.dio.exercises.challengefour.FourthChallenge.PAR;
1012

@@ -79,7 +81,7 @@ public static void main(String[] args) {
7981
System.out.println(" Test cases number "+fourthChallenge.QT);
8082
// int QT = Integer.parseInt(leitor.nextLine());
8183

82-
int line1[] = new int[2];
84+
int[] line1 = new int[2];
8385

8486
// line1 = {"4"};
8587

@@ -117,11 +119,19 @@ public static void main(String[] args) {
117119

118120
st = new StringTokenizer(br.readLine());
119121

122+
String[] s = st.nextToken().split(" ");
123+
124+
System.out.println("s");
125+
System.out.println(s);
126+
127+
// line1 = (new Integer()) s;
128+
120129
int countLine1 = 0;
121130

122131
while (st.hasMoreTokens()){
123132
line1[countLine1] = Integer.parseInt(String.valueOf(st.nextToken().split(" ")));
124133
countLine1 = countLine1 + 1;
134+
st = new StringTokenizer(br.readLine());
125135
}
126136

127137

@@ -143,6 +153,8 @@ public static void main(String[] args) {
143153

144154
countLine2 = countLine2 + 1;
145155

156+
st = new StringTokenizer(br.readLine());
157+
146158
}// end while
147159

148160

@@ -212,6 +224,10 @@ public static void main(String[] args) {
212224

213225
} catch (Exception e) {
214226

227+
System.out.println("Exception.");
228+
System.out.println(e.getMessage());
229+
e.printStackTrace();
230+
215231
} finally {
216232

217233
}

src/main/java/br/com/dio/exercises/challengefour/Player.java

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import static br.com.dio.exercises.challengefour.FourthChallenge.IMPAR;
66
import static br.com.dio.exercises.challengefour.FourthChallenge.PAR;
7+
// import static jdk.vm.ci.code.CodeUtil.isOdd;
78

89
public class Player {
910

@@ -51,6 +52,7 @@ public Integer getNumberChosen() {
5152

5253
public void setNumberChosen(Integer numberChosen) {
5354
this.numberChosen = numberChosen;
55+
5456
}
5557

5658
public HashMap<String, String> getInput() {

0 commit comments

Comments
 (0)