Permalink
Browse files

some learning of luence

  • Loading branch information...
1 parent 808e826 commit d3cb8556ced05642f867b6988ab576eaaf2424cb @shenfeng shenfeng committed Jan 29, 2011
@@ -60,6 +60,10 @@ public void testTermQuerySearch() throws IOException {
TopDocs topDocs = searcher.search(query, 1);
Assert.assertEquals(1, topDocs.totalHits);
}
+
+ public void testQueryParser(){
+// Qu
+ }
@After
public void teardown() throws IOException {
@@ -0,0 +1,38 @@
+package jcip;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class JavaLangLearn {
+
+ private static class TestClone implements Cloneable {
+ public TestClone(int j) {
+ i = j;
+ }
+
+ // @Override
+ // protected TestClone clone() throws CloneNotSupportedException {
+ // return (TestClone) super.clone();
+ // }
+
+ public int i;
+ }
+
+ @Test
+ public void testArrayCopy() throws CloneNotSupportedException {
+ Integer iarr[] = new Integer[] { 1, 2, 3, 4, 5 };
+ Integer[] cloned = iarr.clone();
+ iarr[0] = 10;
+ Assert.assertEquals(1, cloned[0].intValue());
+
+ TestClone tc = new TestClone(10);
+ // TestClone c2 = tc.clone();
+ // Assert.assertEquals(10, c2.i);
+
+ TestClone tcArr[] = new TestClone[] { tc };
+ TestClone[] c3 = tcArr.clone();
+ tc.i = 100;
+ // shadow copy
+ Assert.assertEquals(100, c3[0].i);
+ }
+}
Oops, something went wrong. Retry.

0 comments on commit d3cb855

Please sign in to comment.