Skip to content

Commit

Permalink
Merge branch 'master' of github.com:javasoze/kamikaze
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wang committed Nov 2, 2011
2 parents 78d80fd + be61364 commit d4367d2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 27 deletions.
31 changes: 30 additions & 1 deletion pom.xml
Expand Up @@ -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>
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down
Binary file removed src/test/test-data/SerialDocSet
Binary file not shown.

0 comments on commit d4367d2

Please sign in to comment.