Skip to content

Commit 4233d90

Browse files
authored
Remove vaadin tests (eugenp#2257)
* Refactor Vaadin samples * Refactor Vaadin samples
1 parent 3718dfd commit 4233d90

12 files changed

Lines changed: 87 additions & 193 deletions

File tree

‎libraries/pom.xml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,10 +463,6 @@
463463
<groupId>com.vaadin</groupId>
464464
<artifactId>vaadin-server</artifactId>
465465
</dependency>
466-
<dependency>
467-
<groupId>com.vaadin</groupId>
468-
<artifactId>vaadin-push</artifactId>
469-
</dependency>
470466
<dependency>
471467
<groupId>com.vaadin</groupId>
472468
<artifactId>vaadin-client-compiled</artifactId>

‎libraries/src/main/java/com/baeldung/jetty/JettyServer.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import org.eclipse.jetty.servlet.ServletHandler;
77
import org.eclipse.jetty.util.thread.QueuedThreadPool;
88

9-
public class JettyServer {
9+
class JettyServer {
1010

1111
private Server server;
1212

13-
public void start() throws Exception {
13+
void start() throws Exception {
1414

1515
int maxThreads = 100;
1616
int minThreads = 10;
@@ -33,7 +33,7 @@ public void start() throws Exception {
3333

3434
}
3535

36-
public void stop() throws Exception {
36+
void stop() throws Exception {
3737
server.stop();
3838
}
3939
}

‎libraries/src/main/java/com/baeldung/junitparams/SafeAdditionUtil.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.junitparams;
22

3-
public class SafeAdditionUtil {
3+
class SafeAdditionUtil {
44

5-
public int safeAdd(int a, int b) {
5+
int safeAdd(int a, int b) {
66
long result = ((long) a) + b;
77
if (result > Integer.MAX_VALUE) {
88
return Integer.MAX_VALUE;

‎libraries/src/main/java/com/baeldung/netty/NettyServer.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class NettyServer {
1313

1414
private int port;
1515

16-
public NettyServer(int port) {
16+
private NettyServer(int port) {
1717
this.port = port;
1818
}
1919

@@ -27,7 +27,7 @@ public static void main(String[] args) throws Exception {
2727
new NettyServer(port).run();
2828
}
2929

30-
public void run() throws Exception {
30+
private void run() throws Exception {
3131
EventLoopGroup bossGroup = new NioEventLoopGroup();
3232
EventLoopGroup workerGroup = new NioEventLoopGroup();
3333
try {

‎libraries/src/main/java/com/baeldung/netty/RequestData.java‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ public class RequestData {
44
private int intValue;
55
private String stringValue;
66

7-
public int getIntValue() {
7+
int getIntValue() {
88
return intValue;
99
}
1010

11-
public void setIntValue(int intValue) {
11+
void setIntValue(int intValue) {
1212
this.intValue = intValue;
1313
}
1414

15-
public String getStringValue() {
15+
String getStringValue() {
1616
return stringValue;
1717
}
1818

19-
public void setStringValue(String stringValue) {
19+
void setStringValue(String stringValue) {
2020
this.stringValue = stringValue;
2121
}
2222

2323
@Override
2424
public String toString() {
2525
return "RequestData{" +
26-
"intValue=" + intValue +
27-
", stringValue='" + stringValue + '\'' +
28-
'}';
26+
"intValue=" + intValue +
27+
", stringValue='" + stringValue + '\'' +
28+
'}';
2929
}
3030
}

‎libraries/src/main/java/com/baeldung/netty/ResponseData.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
public class ResponseData {
44
private int intValue;
55

6-
public int getIntValue() {
6+
int getIntValue() {
77
return intValue;
88
}
99

10-
public void setIntValue(int intValue) {
10+
void setIntValue(int intValue) {
1111
this.intValue = intValue;
1212
}
1313

‎libraries/src/main/java/com/baeldung/netty/ResponseDataDecoder.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.baeldung.netty;
22

3-
import java.util.List;
4-
53
import io.netty.buffer.ByteBuf;
64
import io.netty.channel.ChannelHandlerContext;
75
import io.netty.handler.codec.ReplayingDecoder;
86

7+
import java.util.List;
8+
99
public class ResponseDataDecoder extends ReplayingDecoder<ResponseData> {
1010

1111
@Override

‎libraries/src/main/java/com/baeldung/quartz/QuartzExample.java‎

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,44 +20,44 @@ public static void main(String args[]) {
2020
Scheduler sched = schedFact.getScheduler();
2121

2222
JobDetail job = JobBuilder.newJob(SimpleJob.class)
23-
.withIdentity("myJob", "group1")
24-
.usingJobData("jobSays", "Hello World!")
25-
.usingJobData("myFloatValue", 3.141f)
26-
.build();
23+
.withIdentity("myJob", "group1")
24+
.usingJobData("jobSays", "Hello World!")
25+
.usingJobData("myFloatValue", 3.141f)
26+
.build();
2727

2828
Trigger trigger = TriggerBuilder.newTrigger()
29-
.withIdentity("myTrigger", "group1")
30-
.startNow()
31-
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
32-
.withIntervalInSeconds(40)
33-
.repeatForever())
34-
.build();
35-
29+
.withIdentity("myTrigger", "group1")
30+
.startNow()
31+
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
32+
.withIntervalInSeconds(40)
33+
.repeatForever())
34+
.build();
35+
3636
JobDetail jobA = JobBuilder.newJob(JobA.class)
37-
.withIdentity("jobA", "group2")
38-
.build();
39-
37+
.withIdentity("jobA", "group2")
38+
.build();
39+
4040
JobDetail jobB = JobBuilder.newJob(JobB.class)
41-
.withIdentity("jobB", "group2")
42-
.build();
43-
41+
.withIdentity("jobB", "group2")
42+
.build();
43+
4444
Trigger triggerA = TriggerBuilder.newTrigger()
45-
.withIdentity("triggerA", "group2")
46-
.startNow()
47-
.withPriority(15)
48-
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
49-
.withIntervalInSeconds(40)
50-
.repeatForever())
51-
.build();
52-
53-
Trigger triggerB = TriggerBuilder.newTrigger()
54-
.withIdentity("triggerB", "group2")
55-
.startNow()
56-
.withPriority(10)
57-
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
58-
.withIntervalInSeconds(20)
59-
.repeatForever())
60-
.build();
45+
.withIdentity("triggerA", "group2")
46+
.startNow()
47+
.withPriority(15)
48+
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
49+
.withIntervalInSeconds(40)
50+
.repeatForever())
51+
.build();
52+
53+
Trigger triggerB = TriggerBuilder.newTrigger()
54+
.withIdentity("triggerB", "group2")
55+
.startNow()
56+
.withPriority(10)
57+
.withSchedule(SimpleScheduleBuilder.simpleSchedule()
58+
.withIntervalInSeconds(20)
59+
.repeatForever())
60+
.build();
6161

6262
sched.scheduleJob(job, trigger);
6363
sched.scheduleJob(jobA, triggerA);

‎libraries/src/main/java/com/baeldung/quartz/SimpleJob.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ public class SimpleJob implements Job {
99

1010
public void execute(JobExecutionContext context) throws JobExecutionException {
1111
JobDataMap dataMap = context.getJobDetail()
12-
.getJobDataMap();
12+
.getJobDataMap();
1313

1414
String jobSays = dataMap.getString("jobSays");
1515
float myFloatValue = dataMap.getFloat("myFloatValue");
1616

1717
System.out.println("Job says: " + jobSays + ", and val is: " + myFloatValue);
18-
1918
}
20-
2119
}

‎libraries/src/main/java/com/baeldung/stm/Account.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ public class Account {
1010
private final TxnLong lastUpdate;
1111
private final TxnInteger balance;
1212

13-
public Account(final int balance) {
13+
Account(final int balance) {
1414
this.lastUpdate = StmUtils.newTxnLong(System.currentTimeMillis());
1515
this.balance = StmUtils.newTxnInteger(balance);
1616
}
1717

18-
public Integer getBalance() {
18+
Integer getBalance() {
1919
return balance.atomicGet();
2020
}
2121

22-
public void adjustBy(final int amount) {
22+
void adjustBy(final int amount) {
2323
adjustBy(amount, System.currentTimeMillis());
2424
}
2525

26-
public void adjustBy(final int amount, final long date) {
26+
private void adjustBy(final int amount, final long date) {
2727
StmUtils.atomic(() -> {
2828
balance.increment(amount);
2929
lastUpdate.set(date);
@@ -34,7 +34,7 @@ public void adjustBy(final int amount, final long date) {
3434
});
3535
}
3636

37-
public void transferTo(final Account other, final int amount) {
37+
void transferTo(final Account other, final int amount) {
3838
StmUtils.atomic(() -> {
3939
final long date = System.currentTimeMillis();
4040
adjustBy(-amount, date);
@@ -45,6 +45,6 @@ public void transferTo(final Account other, final int amount) {
4545
@Override
4646
public String toString() {
4747
return StmUtils.atomic((TxnCallable<String>)
48-
txn -> "Balance: " + balance.get(txn) + " lastUpdateDate: " + lastUpdate.get(txn));
48+
txn -> "Balance: " + balance.get(txn) + " lastUpdateDate: " + lastUpdate.get(txn));
4949
}
5050
}

0 commit comments

Comments
 (0)