forked from onlyliuxin/coding2017
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request onlyliuxin#32 from tanghaojie/master
Master
- Loading branch information
Showing
16 changed files
with
257 additions
and
34 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
group12/495473393/Code/.settings/org.eclipse.core.resources.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/Week2/array/ArrayUtil.java=UTF-8 | ||
encoding//src/week2/array/ArrayUtil.java=UTF-8 | ||
encoding/src=UTF-8 |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...2/495473393/Code/src/Week1/ArrayList.java → ...2/495473393/Code/src/week1/ArrayList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week1; | ||
package week1; | ||
|
||
public class ArrayList implements List { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...473393/Code/src/Week1/BinaryTreeNode.java → ...473393/Code/src/week1/BinaryTreeNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week1; | ||
package week1; | ||
|
||
public class BinaryTreeNode { | ||
private Object data; | ||
|
2 changes: 1 addition & 1 deletion
2
...12/495473393/Code/src/Week1/Iterator.java → ...12/495473393/Code/src/week1/Iterator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week1; | ||
package week1; | ||
|
||
public interface Iterator { | ||
public boolean hasNext(); | ||
|
2 changes: 1 addition & 1 deletion
2
.../495473393/Code/src/Week1/LinkedList.java → .../495473393/Code/src/week1/LinkedList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week1; | ||
package week1; | ||
|
||
public class LinkedList implements List { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
group12/495473393/Code/src/Week1/List.java → group12/495473393/Code/src/week1/List.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week1; | ||
package week1; | ||
|
||
public interface List { | ||
public void add(Object o); | ||
|
2 changes: 1 addition & 1 deletion
2
group12/495473393/Code/src/Week1/Queue.java → group12/495473393/Code/src/week1/Queue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week1; | ||
package week1; | ||
|
||
public class Queue { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
group12/495473393/Code/src/Week1/Stack.java → group12/495473393/Code/src/week1/Stack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week1; | ||
package week1; | ||
|
||
public class Stack { | ||
private ArrayList elementData = new ArrayList(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
group12/495473393/Code/src/week2/array/ArrayUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
/** | ||
* | ||
*/ | ||
package week2.array; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
/** | ||
* @author TangHaoJie | ||
* | ||
*/ | ||
public class ArrayUtilTest { | ||
|
||
private ArrayUtil au; | ||
|
||
/** | ||
* @throws java.lang.Exception | ||
*/ | ||
@Before | ||
public void setUp() throws Exception { | ||
au = new ArrayUtil(); | ||
} | ||
|
||
/** | ||
* @throws java.lang.Exception | ||
*/ | ||
@After | ||
public void tearDown() throws Exception { | ||
} | ||
|
||
/** | ||
* {@link week2.array.ArrayUtil#reverseArray(int[])} 的测试方法。 | ||
*/ | ||
@Test | ||
public void testReverseArray() { | ||
int[] a1 = null; | ||
au.reverseArray(a1); | ||
assertArrayEquals(null, a1); | ||
|
||
int[] a2 = new int[0]; | ||
au.reverseArray(a2); | ||
assertArrayEquals(new int[0], a2); | ||
|
||
int[] a3 = new int[] { 1, 2, 3, 4, 5, 6 }; | ||
au.reverseArray(a3); | ||
assertArrayEquals(new int[] { 6, 5, 4, 3, 2, 1 }, a3); | ||
} | ||
|
||
/** | ||
* {@link week2.array.ArrayUtil#removeZero(int[])} 的测试方法。 | ||
*/ | ||
@Test | ||
public void testRemoveZero() { | ||
int[] a1 = null; | ||
int[] b1 = au.removeZero(a1); | ||
assertArrayEquals(b1, a1); | ||
|
||
int[] a2 = new int[0]; | ||
int[] b2 = au.removeZero(a2); | ||
assertArrayEquals(b2, a2); | ||
|
||
int[] a3 = new int[] { 1, 2, 3, 4, 5, 6 }; | ||
int[] b3 = au.removeZero(a3); | ||
assertArrayEquals(b3, a3); | ||
|
||
int[] a4 = new int[] { 0, 0, 1, 2, 0, 3, 4, 0, 5, 6 }; | ||
int[] b4 = au.removeZero(a4); | ||
assertArrayEquals(b4, new int[] { 1, 2, 3, 4, 5, 6 }); | ||
|
||
int[] a5 = new int[] { 1, 2, 0, 3, 4, 0, 5, 6, 0, 0, 0 }; | ||
int[] b5 = au.removeZero(a5); | ||
assertArrayEquals(b5, new int[] { 1, 2, 3, 4, 5, 6 }); | ||
} | ||
|
||
/** | ||
* {@link week2.array.ArrayUtil#merge(int[], int[])} 的测试方法。 | ||
*/ | ||
@Test | ||
public void testMerge() { | ||
int[] a1 = null; | ||
int[] b1 = null; | ||
int[] c1 = au.merge(a1, b1); | ||
assertArrayEquals(c1, null); | ||
|
||
int[] a2 = new int[0]; | ||
int[] b2 = new int[0]; | ||
int[] c2 = au.merge(a2, b2); | ||
assertArrayEquals(c2, new int[0]); | ||
|
||
int[] a3 = new int[] { 1, 3, 5, 7, 9 }; | ||
int[] b3 = new int[] { 2, 4, 6, 8, 10 }; | ||
int[] c3 = au.merge(a3, b3); | ||
assertArrayEquals(c3, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }); | ||
} | ||
|
||
/** | ||
* {@link week2.array.ArrayUtil#grow(int[], int)} 的测试方法。 | ||
*/ | ||
@Test | ||
public void testGrow() { | ||
int[] a1 = null; | ||
int[] b1 = au.grow(a1, 0); | ||
assertArrayEquals(b1, a1); | ||
|
||
int[] a2 = new int[0]; | ||
int[] b2 = au.grow(a2, 0); | ||
assertArrayEquals(b2, a2); | ||
|
||
int[] a3 = new int[] { 1, 2 }; | ||
int[] b3 = au.grow(a3, -10); | ||
assertArrayEquals(b3, a3); | ||
|
||
int[] a4 = new int[] { 1, 2 }; | ||
int[] b4 = au.grow(a4, 5); | ||
assertArrayEquals(b4, new int[] { 1, 2, 0, 0, 0, 0, 0 }); | ||
} | ||
|
||
/** | ||
* {@link week2.array.ArrayUtil#fibonacci(int)} 的测试方法。 | ||
*/ | ||
@Test | ||
public void testFibonacci() { | ||
} | ||
|
||
/** | ||
* {@link week2.array.ArrayUtil#getPrimes(int)} 的测试方法。 | ||
*/ | ||
@Test | ||
public void testGetPrimes() { | ||
} | ||
|
||
/** | ||
* {@link week2.array.ArrayUtil#getPerfectNumbers(int)} 的测试方法。 | ||
*/ | ||
@Test | ||
public void testGetPerfectNumbers() { | ||
} | ||
|
||
/** | ||
* {@link week2.array.ArrayUtil#join(int[], java.lang.String)} 的测试方法。 | ||
*/ | ||
@Test | ||
public void testJoin() { | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...ode/src/Week2/litestruts/LoginAction.java → ...ode/src/week2/litestruts/LoginAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week2.litestruts; | ||
package week2.litestruts; | ||
|
||
/** | ||
* 这是一个用来展示登录的业务类, 其中的用户名和密码都是硬编码的。 | ||
|
2 changes: 1 addition & 1 deletion
2
...393/Code/src/Week2/litestruts/Struts.java → ...393/Code/src/week2/litestruts/Struts.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week2.litestruts; | ||
package week2.litestruts; | ||
|
||
import java.util.Map; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...Code/src/Week2/litestruts/StrutsTest.java → ...Code/src/week2/litestruts/StrutsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package Week2.litestruts; | ||
package week2.litestruts; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
Oops, something went wrong.