Skip to content

Commit 18913d3

Browse files
committed
Update tests.
1 parent 8fd0019 commit 18913d3

File tree

5 files changed

+3
-45
lines changed

5 files changed

+3
-45
lines changed

README.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Parameters that must be provided by the caller can be indicated by the `Required
130130

131131
```java
132132
@RequestMethod("GET")
133-
public List<Pet> getPets(@Required String owner) throws SQLException {
133+
public List<Pet> getPets(@Required String owner) throws SQLException {
134134
...
135135
}
136136
```
@@ -795,33 +795,26 @@ public record Owner(
795795

796796
```java
797797
@Table("pet")
798-
@Description("Represents a pet.")
799798
public interface Pet {
800799
@Column("name")
801800
@PrimaryKey
802801
@Index
803-
@Description("The pet's name.")
804802
String getName();
805803

806804
@Column("owner")
807805
@ForeignKey(Owner.class)
808-
@Description("The pet's owner.")
809806
String getOwner();
810807

811808
@Column("species")
812-
@Description("The pet's species.")
813809
String getSpecies();
814810

815811
@Column("sex")
816-
@Description("The pet's gender.")
817812
String getSex();
818813

819814
@Column("birth")
820-
@Description("The pet's date of birth.")
821815
LocalDate getBirth();
822816

823817
@Column("death")
824-
@Description("The pet's date of death.")
825818
LocalDate getDeath();
826819
}
827820
```
@@ -941,36 +934,29 @@ For example, the following code executes a SQL query that retrieves all rows fro
941934

942935
```java
943936
@Table("employees")
944-
@Description("Represents an employee.")
945937
public interface Employee {
946938
@Column("emp_no")
947939
@PrimaryKey
948-
@Description("The employee's employee number.")
949940
Integer getEmployeeNumber();
950941

951942
@Column("first_name")
952943
@Required
953-
@Description("The employee's first name.")
954944
String getFirstName();
955945

956946
@Column("last_name")
957947
@Required
958-
@Description("The employee's last name.")
959948
String getLastName();
960949

961950
@Column("gender")
962951
@Required
963-
@Description("The employee's gender.")
964952
String getGender();
965953

966954
@Column("birth_date")
967955
@Required
968-
@Description("The employee's birth date.")
969956
LocalDate getBirthDate();
970957

971958
@Column("hire_date")
972959
@Required
973-
@Description("The employee's hire date.")
974960
LocalDate getHireDate();
975961
}
976962
```

kilo-test/src/main/java/org/httprpc/kilo/test/Employee.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package org.httprpc.kilo.test;
1616

17-
import org.httprpc.kilo.Description;
1817
import org.httprpc.kilo.Required;
1918
import org.httprpc.kilo.sql.Column;
2019
import org.httprpc.kilo.sql.PrimaryKey;
@@ -23,35 +22,28 @@
2322
import java.time.LocalDate;
2423

2524
@Table("employees")
26-
@Description("Represents an employee.")
2725
public interface Employee {
2826
@Column("emp_no")
2927
@PrimaryKey
30-
@Description("The employee's employee number.")
3128
Integer getEmployeeNumber();
3229

3330
@Column("first_name")
3431
@Required
35-
@Description("The employee's first name.")
3632
String getFirstName();
3733

3834
@Column("last_name")
3935
@Required
40-
@Description("The employee's last name.")
4136
String getLastName();
4237

4338
@Column("gender")
4439
@Required
45-
@Description("The employee's gender.")
4640
String getGender();
4741

4842
@Column("birth_date")
4943
@Required
50-
@Description("The employee's birth date.")
5144
LocalDate getBirthDate();
5245

5346
@Column("hire_date")
5447
@Required
55-
@Description("The employee's hire date.")
5648
LocalDate getHireDate();
5749
}

kilo-test/src/main/java/org/httprpc/kilo/test/EmployeeService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import jakarta.servlet.ServletException;
1818
import jakarta.servlet.annotation.WebServlet;
19-
import org.httprpc.kilo.Description;
2019
import org.httprpc.kilo.RequestMethod;
2120
import org.httprpc.kilo.ResourcePath;
2221
import org.httprpc.kilo.WebService;
@@ -33,7 +32,6 @@
3332
import static org.httprpc.kilo.util.Iterables.*;
3433

3534
@WebServlet(urlPatterns = {"/employees/*"}, loadOnStartup = 1)
36-
@Description("Employee service.")
3735
public class EmployeeService extends WebService {
3836
private static ExecutorService executorService = null;
3937

@@ -57,7 +55,6 @@ public void destroy() {
5755
}
5856

5957
@RequestMethod("GET")
60-
@Description("Returns a list of employees.")
6158
public List<Employee> getEmployees() throws SQLException {
6259
var queryBuilder = QueryBuilder.select(Employee.class);
6360

@@ -69,7 +66,6 @@ public List<Employee> getEmployees() throws SQLException {
6966

7067
@RequestMethod("GET")
7168
@ResourcePath("stream")
72-
@Description("Returns a list of employees.")
7369
public Iterable<Employee> getEmployeesStream() {
7470
var pipe = new Pipe<Employee>(4096, 15000);
7571

kilo-test/src/main/java/org/httprpc/kilo/test/Pet.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
package org.httprpc.kilo.test;
1616

17-
import org.httprpc.kilo.Description;
1817
import org.httprpc.kilo.sql.Column;
1918
import org.httprpc.kilo.sql.ForeignKey;
2019
import org.httprpc.kilo.sql.Index;
@@ -24,32 +23,25 @@
2423
import java.time.LocalDate;
2524

2625
@Table("pet")
27-
@Description("Represents a pet.")
2826
public interface Pet {
2927
@Column("name")
3028
@PrimaryKey
3129
@Index
32-
@Description("The pet's name.")
3330
String getName();
3431

3532
@Column("owner")
3633
@ForeignKey(Owner.class)
37-
@Description("The pet's owner.")
3834
String getOwner();
3935

4036
@Column("species")
41-
@Description("The pet's species.")
4237
String getSpecies();
4338

4439
@Column("sex")
45-
@Description("The pet's gender.")
4640
String getSex();
4741

4842
@Column("birth")
49-
@Description("The pet's date of birth.")
5043
LocalDate getBirth();
5144

5245
@Column("death")
53-
@Description("The pet's date of death.")
5446
LocalDate getDeath();
5547
}

kilo-test/src/main/java/org/httprpc/kilo/test/PetService.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package org.httprpc.kilo.test;
1616

1717
import jakarta.servlet.annotation.WebServlet;
18-
import org.httprpc.kilo.Description;
1918
import org.httprpc.kilo.RequestMethod;
2019
import org.httprpc.kilo.Required;
2120
import org.httprpc.kilo.ResourcePath;
@@ -34,13 +33,9 @@
3433
import static org.httprpc.kilo.util.Iterables.*;
3534

3635
@WebServlet(urlPatterns = {"/pets/*"}, loadOnStartup = 1)
37-
@Description("Pet service.")
3836
public class PetService extends AbstractDatabaseService {
3937
@RequestMethod("GET")
40-
@Description("Returns a list of pets.")
41-
public List<Pet> getPets(
42-
@Description("The name of the owner.") @Required String owner
43-
) throws SQLException {
38+
public List<Pet> getPets(@Required String owner) throws SQLException {
4439
var queryBuilder = new QueryBuilder();
4540

4641
queryBuilder.appendLine("select * from pet where owner = :owner order by name");
@@ -55,10 +50,7 @@ public List<Pet> getPets(
5550

5651
@RequestMethod("GET")
5752
@ResourcePath("stream")
58-
@Description("Returns a list of pets.")
59-
public void getPetsStream(
60-
@Description("The name of the owner.") @Required String owner
61-
) throws SQLException, IOException {
53+
public void getPetsStream(@Required String owner) throws SQLException, IOException {
6254
var response = getResponse();
6355

6456
var accept = getRequest().getHeader("Accept");

0 commit comments

Comments
 (0)