Permalink
Browse files

Merge branch 'master' of github.com:javasoze/kamikaze

  • Loading branch information...
2 parents 78d80fd + be61364 commit d4367d20c8d56cf299c82c1655d0045c59f5a1b7 John Wang committed Nov 2, 2011
View
31 pom.xml
@@ -9,7 +9,7 @@
<groupId>com.linkedin.kamikaze</groupId>
<artifactId>kamikaze</artifactId>
<packaging>jar</packaging>
- <version>3.0.5-SNAPSHOT</version>
+ <version>3.0.5</version>
<name>kamikaze</name>
<description>information retrival utility package for enhancing Lucene</description>
<url>http://sna-projects.com/kamikaze</url>
@@ -143,4 +143,33 @@
-->
</distributionManagement>
+ <profiles>
+ <profile>
+ <id>release-sign-artifacts</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
@@ -1,38 +1,20 @@
package com.kamikaze.test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.fail;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.TreeSet;
+import junit.framework.TestCase;
+
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
-import org.apache.lucene.util.OpenBitSet;
import org.junit.Test;
-import junit.framework.TestCase;
-import com.kamikaze.docidset.api.DocSet;
-import com.kamikaze.docidset.api.StatefulDSIterator;
-import com.kamikaze.docidset.bitset.MyOpenBitSet;
-import com.kamikaze.docidset.impl.AndDocIdSet;
-import com.kamikaze.docidset.impl.IntArrayDocIdSet;
import com.kamikaze.docidset.impl.NotDocIdSet;
-import com.kamikaze.docidset.impl.OBSDocIdSet;
-import com.kamikaze.docidset.impl.OrDocIdSet;
import com.kamikaze.docidset.impl.PForDeltaDocIdSet;
public class PForDeltaTestDocSetSerializationTest extends TestCase {
@@ -81,12 +63,14 @@ public void testNotDocSetSerialization() throws Exception {
DocIdSet not = new NotDocIdSet(docSet, max);
+ byte[] serialized = null;
try {
- File f = new File(serial);
- ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f));
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(bout);
oos.writeObject(not);
oos.flush();
oos.close();
+ serialized = bout.toByteArray();
} catch (Exception e) {
e.printStackTrace();
@@ -96,8 +80,7 @@ public void testNotDocSetSerialization() throws Exception {
NotDocIdSet not2 = null;
try {
- InputStream f = new FileInputStream(new File(serial));
- ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(f));
+ ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(serialized));
not2 = (NotDocIdSet) (ois.readObject());
} catch (Exception e) {
e.printStackTrace();
Binary file not shown.

0 comments on commit d4367d2

Please sign in to comment.