diff --git a/ceshi/.gitignore b/ceshi/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/ceshi/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/ceshi/lib/apiguardian-api-1.1.2.jar b/ceshi/lib/apiguardian-api-1.1.2.jar new file mode 100644 index 0000000..2b678e1 Binary files /dev/null and b/ceshi/lib/apiguardian-api-1.1.2.jar differ diff --git a/ceshi/lib/hamcrest-core-1.3.jar b/ceshi/lib/hamcrest-core-1.3.jar new file mode 100644 index 0000000..9d5fe16 Binary files /dev/null and b/ceshi/lib/hamcrest-core-1.3.jar differ diff --git a/ceshi/lib/hamcrest-library-1.3.jar b/ceshi/lib/hamcrest-library-1.3.jar new file mode 100644 index 0000000..9eac80d Binary files /dev/null and b/ceshi/lib/hamcrest-library-1.3.jar differ diff --git a/ceshi/lib/junit-4.10.jar b/ceshi/lib/junit-4.10.jar new file mode 100644 index 0000000..bf5c0b9 Binary files /dev/null and b/ceshi/lib/junit-4.10.jar differ diff --git a/ceshi/lib/junit-4.13.1.jar b/ceshi/lib/junit-4.13.1.jar new file mode 100644 index 0000000..b376ffc Binary files /dev/null and b/ceshi/lib/junit-4.13.1.jar differ diff --git a/ceshi/lib/junit-jupiter-5.8.1.jar b/ceshi/lib/junit-jupiter-5.8.1.jar new file mode 100644 index 0000000..730b9ae Binary files /dev/null and b/ceshi/lib/junit-jupiter-5.8.1.jar differ diff --git a/ceshi/lib/junit-jupiter-api-5.8.1.jar b/ceshi/lib/junit-jupiter-api-5.8.1.jar new file mode 100644 index 0000000..8424eca Binary files /dev/null and b/ceshi/lib/junit-jupiter-api-5.8.1.jar differ diff --git a/ceshi/lib/junit-jupiter-engine-5.8.1.jar b/ceshi/lib/junit-jupiter-engine-5.8.1.jar new file mode 100644 index 0000000..cfa38d2 Binary files /dev/null and b/ceshi/lib/junit-jupiter-engine-5.8.1.jar differ diff --git a/ceshi/lib/junit-jupiter-params-5.8.1.jar b/ceshi/lib/junit-jupiter-params-5.8.1.jar new file mode 100644 index 0000000..1e4d0ec Binary files /dev/null and b/ceshi/lib/junit-jupiter-params-5.8.1.jar differ diff --git a/ceshi/lib/junit-platform-commons-1.8.1.jar b/ceshi/lib/junit-platform-commons-1.8.1.jar new file mode 100644 index 0000000..20185cd Binary files /dev/null and b/ceshi/lib/junit-platform-commons-1.8.1.jar differ diff --git a/ceshi/lib/junit-platform-engine-1.8.1.jar b/ceshi/lib/junit-platform-engine-1.8.1.jar new file mode 100644 index 0000000..54ce076 Binary files /dev/null and b/ceshi/lib/junit-platform-engine-1.8.1.jar differ diff --git a/ceshi/lib/opentest4j-1.2.0.jar b/ceshi/lib/opentest4j-1.2.0.jar new file mode 100644 index 0000000..d500636 Binary files /dev/null and b/ceshi/lib/opentest4j-1.2.0.jar differ diff --git a/ceshi/src/CalOpion.java b/ceshi/src/CalOpion.java new file mode 100644 index 0000000..accb443 --- /dev/null +++ b/ceshi/src/CalOpion.java @@ -0,0 +1,4 @@ +public class CalOpion { + public static int add(int a,int b){ + return a+b;} +} diff --git a/ceshi/src/Calculator.java b/ceshi/src/Calculator.java new file mode 100644 index 0000000..904247d --- /dev/null +++ b/ceshi/src/Calculator.java @@ -0,0 +1,26 @@ +public class Calculator { + static int result; //静态变量,用于存储运行结果 + public void add(int n) { + result=result+n; + } + public void substract(int n) { + result=result-1; //Bug: 正确的应该是 result =result-n + } + public void a(int n){ + }// 此方法尚未写好 + public void divide(int n){ + result=result/n; + } + public void square(int n){ + result=n*n; + } + public void squareRoot(int n) { + for (; ;) ; //Bug : 死循环 + } + public void clear() { // 将结果清零 + result = 0; + } + public int getResult() { + return result; + } +} diff --git a/ceshi/src/Main.java b/ceshi/src/Main.java new file mode 100644 index 0000000..1e87232 --- /dev/null +++ b/ceshi/src/Main.java @@ -0,0 +1,17 @@ +// 按两次 Shift 打开“随处搜索”对话框并输入 `show whitespaces`, +// 然后按 Enter 键。现在,您可以在代码中看到空格字符。 +public class Main { + public static void main(String[] args) { + // 当文本光标位于高亮显示的文本处时按 Alt+Enter, + // 可查看 IntelliJ IDEA 对于如何修正该问题的建议。 + System.out.printf("Hello and welcome!"); + + // 按 Shift+F10 或点击装订区域中的绿色箭头按钮以运行脚本。 + for (int i = 1; i <= 5; i++) { + + // 按 Shift+F9 开始调试代码。我们已为您设置了一个断点, + // 但您始终可以通过按 Ctrl+F8 添加更多断点。 + System.out.println("i = " + i); + } + } +} \ No newline at end of file diff --git a/ceshi/test/CalculatorTest.java b/ceshi/test/CalculatorTest.java new file mode 100644 index 0000000..ea99587 --- /dev/null +++ b/ceshi/test/CalculatorTest.java @@ -0,0 +1,56 @@ +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +public class CalculatorTest { + + @Before + public void setUp() throws Exception { + System.out.println("测试开始"); + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void add() { + Calculator cal = new Calculator(); + cal.add(5); + } + + @Test + public void substract() { + /**数值匹配**/ + //测试变量是否大于指定值 + assertThat(501,greaterThan(50)); + //测试变量是否小于指定值 + assertThat(6,lessThan(100)); + } + + @Test + public void a() { + } + + @Test + public void divide() { + } + + @Test + public void square() { + } + + @Test + public void squareRoot() { + } + + @Test + public void clear() { + } + + @Test + public void getResult() { + } +} \ No newline at end of file diff --git a/ceshi/test/comd/CalOpion.java b/ceshi/test/comd/CalOpion.java new file mode 100644 index 0000000..23c9801 --- /dev/null +++ b/ceshi/test/comd/CalOpion.java @@ -0,0 +1,6 @@ +package comd; + +public class CalOpion { + public static int add(int a,int b){ + return a+b;} +} diff --git a/ceshi/test/comd/CalTest.java b/ceshi/test/comd/CalTest.java new file mode 100644 index 0000000..ac7c80a --- /dev/null +++ b/ceshi/test/comd/CalTest.java @@ -0,0 +1,97 @@ +package comd; +//IJ + + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvFileSource; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.*; + +public class CalTest { + @Test + public void test1(){ + assertNotNull("name"); + } + @Test + public void test2(){ + CalOpion cal=new CalOpion(); + int num= cal.add(3,5); + assertEquals(8,num); + } +@ParameterizedTest +@ValueSource(strings = {"test1","test2","test3"}) + public void test3(String str){ + assertNotNull(str); + + } + @DisplayName("һѭ") + @ParameterizedTest + @ValueSource(ints = {1,2,3,4,5,6,7,8,9}) + public void test4(int num){ + assertNotEquals(5,num); + } + @DisplayName("ѭ") + @ParameterizedTest + @CsvSource({"3,5,8","1,0,1","4,5,9"}) + public void test5(int a1,int a2,int a3){ + assertEquals(a3, CalOpion.add(a1,a2)); + + } + public static Stream getString(){ + return Stream.of("java","c","oracle","apple"); + } + + @DisplayName("һĽ Ϊ") + @ParameterizedTest + @MethodSource("getString") + public void test6(String str){ + assertEquals("java",str); + + } + + public static List getList(){ + ArrayList list=new ArrayList(); + String [] s1={"admin","9999999","true"}; + + String [] s2={"admin","9999999","false"}; + String [] s3={"admin","9999999","true"}; + String [] s4={"admin","9999999","true"}; + + list.add(s1); + list.add(s2); + list.add(s3); + list.add(s4); + + return list; + + + } + @DisplayName("list") + @ParameterizedTest + @MethodSource("getList") + public void test7(Object username,String password){ + System.out.println(username+"sssss"+password); + + } + + @DisplayName("ļȡ") + @ParameterizedTest + @CsvFileSource(files = "/testvalue.csv",numLinesToSkip = 1) + public void test8(String username,String password){ + System.out.println(username+"----"+password); + + } + + + + +} diff --git a/ceshi/test/comd/testvalue.csv b/ceshi/test/comd/testvalue.csv new file mode 100644 index 0000000..6de9e1d --- /dev/null +++ b/ceshi/test/comd/testvalue.csv @@ -0,0 +1,4 @@ +用户名,密码 +zhangsan,123456 +lisi,12345678 +wanger,888888 diff --git a/ceshi/web/WEB-INF/web.xml b/ceshi/web/WEB-INF/web.xml new file mode 100644 index 0000000..d80081d --- /dev/null +++ b/ceshi/web/WEB-INF/web.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/ceshi/web/web/WEB-INF/web.xml b/ceshi/web/web/WEB-INF/web.xml new file mode 100644 index 0000000..d80081d --- /dev/null +++ b/ceshi/web/web/WEB-INF/web.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/doc b/doc/文档模板-软件需求规格说明书模板.docx similarity index 100% rename from doc rename to doc/文档模板-软件需求规格说明书模板.docx diff --git a/src b/src/DateTimePickerDialog.rar similarity index 100% rename from src rename to src/DateTimePickerDialog.rar