Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • android_compatible_0.14
  • ipaaca-json
  • ipaaca-rsb
  • ipaaca3-dev
  • ipaaca4
  • ipaaca4py3
  • kompass
  • legacy-str
  • master
  • mqtt_port
  • rsb0.11
  • rsb0.14
  • ryt-fullport
  • softwareweek2019
  • windows-compatibility
15 results

Target

Select target project
  • scs/ipaaca
  • ramin.yaghoubzadeh/ipaaca
2 results
Select Git revision
  • ipaaca-rsb
  • ipaaca3-dev
  • ipaaca4
  • kompass
  • master
  • rsb0.14
6 results
Show changes
Showing
with 1869 additions and 126 deletions
/*
* This file is part of IPAACA, the
* "Incremental Processing Architecture
* for Artificial Conversational Agents".
*
* Copyright (c) 2009-2013 Sociable Agents Group
* CITEC, Bielefeld University
*
* http://opensource.cit-ec.de/projects/ipaaca/
* http://purl.org/net/ipaaca
*
* This file may be licensed under the terms of of the
* GNU Lesser General Public License Version 3 (the ``LGPL''),
* or (at your option) any later version.
*
* Software distributed under the License is distributed
* on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the LGPL for the specific language
* governing rights and limitations.
*
* You should have received a copy of the LGPL along with this
* program. If not, go to http://www.gnu.org/licenses/lgpl.html
* or write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The development of this software was supported by the
* Excellence Cluster EXC 277 Cognitive Interaction Technology.
* The Excellence Cluster EXC 277 is a grant of the Deutsche
* Forschungsgemeinschaft (DFG) in the context of the German
* Excellence Initiative.
*/
package ipaaca.util;
import ipaaca.AbstractIU;
import ipaaca.HandlerFunctor;
import ipaaca.IUEventHandler;
import ipaaca.IUEventType;
import ipaaca.InputBuffer;
import ipaaca.LocalMessageIU;
import ipaaca.OutputBuffer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
/**
* Utility class to handle component notification: a componentNotify is sent at initialization and whenever new components sent
* their componentNotify.
* @author hvanwelbergen
*
*/
public class ComponentNotifier
{
public static final String NOTIFY_CATEGORY = "componentNotify";
public static final String SEND_CATEGORIES = "send_categories";
public static final String RECEIVE_CATEGORIES = "recv_categories";
public static final String STATE = "state";
public static final String NAME = "name";
public static final String FUNCTION = "function";
private final OutputBuffer outBuffer;
private final String componentName;
private final String componentFunction;
private final ImmutableSet<String> sendCategories;
private final ImmutableSet<String> receiveCategories;
private final InputBuffer inBuffer;
private List<HandlerFunctor> handlers = Collections.synchronizedList(new ArrayList<HandlerFunctor>());
private volatile boolean isInitialized = false;
private final BlockingQueue<String> receiverQueue = new LinkedBlockingQueue<String>();
private class ComponentNotifyHandler implements HandlerFunctor
{
@Override
public void handle(AbstractIU iu, IUEventType type, boolean local)
{
if(iu.getPayload().get(NAME).equals(componentName))return; //don't re-notify self
String receivers[] = iu.getPayload().get(RECEIVE_CATEGORIES).split("\\s*,\\s*");
receiverQueue.addAll(ImmutableSet.copyOf(receivers));
synchronized(handlers)
{
for (HandlerFunctor h : handlers)
{
h.handle(iu, type, local);
}
}
if (iu.getPayload().get(STATE).equals("new"))
{
submitNotify(false);
}
}
}
/**
* Register a handler that will be called whenever a new component notifies this ComponentNotifier
*/
public void addNotificationHandler(HandlerFunctor h)
{
handlers.add(h);
}
/**
* Wait until the receivers are registered for categories
*/
public void waitForReceivers(ImmutableSet<String> categories)
{
Set<String> unhandledCategories = new HashSet<String>(categories);
while(!unhandledCategories.isEmpty())
{
try
{
unhandledCategories.remove(receiverQueue.take());
}
catch (InterruptedException e)
{
Thread.interrupted();
}
}
}
/**
* Wait until receivers are registered for all categories sent by the component
*/
public void waitForReceivers()
{
waitForReceivers(sendCategories);
}
private void submitNotify(boolean isNew)
{
LocalMessageIU notifyIU = new LocalMessageIU();
notifyIU.setCategory(NOTIFY_CATEGORY);
notifyIU.getPayload().put(NAME, componentName);
notifyIU.getPayload().put("function", componentFunction);
notifyIU.getPayload().put(SEND_CATEGORIES, Joiner.on(",").join(sendCategories));
notifyIU.getPayload().put(RECEIVE_CATEGORIES, Joiner.on(",").join(receiveCategories));
notifyIU.getPayload().put(STATE, isNew ? "new" : "old");
outBuffer.add(notifyIU);
}
public ComponentNotifier(String componentName, String componentFunction, Set<String> sendCategories, Set<String> receiveCategories,
OutputBuffer outBuffer, InputBuffer inBuffer)
{
this.componentName = componentName;
this.componentFunction = componentFunction;
this.sendCategories = ImmutableSet.copyOf(sendCategories);
this.receiveCategories = ImmutableSet.copyOf(receiveCategories);
this.outBuffer = outBuffer;
this.inBuffer = inBuffer;
}
public synchronized void initialize()
{
if(!isInitialized)
{
inBuffer.registerHandler(new IUEventHandler(new ComponentNotifyHandler(), EnumSet.of(IUEventType.ADDED, IUEventType.MESSAGE), ImmutableSet
.of(NOTIFY_CATEGORY)));
submitNotify(true);
isInitialized = true;
}
}
}
/*
* This file is part of IPAACA, the
* "Incremental Processing Architecture
* for Artificial Conversational Agents".
*
* Copyright (c) 2009-2016 Social Cognitive Systems Group
* CITEC, Bielefeld University
*
* http://opensource.cit-ec.de/projects/ipaaca/
* http://purl.org/net/ipaaca
*
* This file may be licensed under the terms of of the
* GNU Lesser General Public License Version 3 (the ``LGPL''),
* or (at your option) any later version.
*
* Software distributed under the License is distributed
* on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the LGPL for the specific language
* governing rights and limitations.
*
* You should have received a copy of the LGPL along with this
* program. If not, go to http://www.gnu.org/licenses/lgpl.html
* or write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The development of this software was supported by the
* Excellence Cluster EXC 277 Cognitive Interaction Technology.
* The Excellence Cluster EXC 277 is a grant of the Deutsche
* Forschungsgemeinschaft (DFG) in the context of the German
* Excellence Initiative.
*/
package ipaaca.util;
import ipaaca.LocalMessageIU;
import ipaaca.OutputBuffer;
import java.util.HashMap;
import java.util.UUID;
import org.apache.commons.lang.StringUtils;
public class IpaacaLogger {
private static OutputBuffer ob;
private static final Object lock = new Object();
private static boolean SEND_IPAACA_LOGS = true;
private static String MODULE_NAME = "???";
private static void initializeOutBuffer() {
synchronized (lock) {
if (ob == null) {
ob = new OutputBuffer("LogSender");
}
}
}
public static void setModuleName(String name) {
synchronized (lock) {
MODULE_NAME = name;
}
}
public static void setLogFileName(String fileName, String logMode) {
initializeOutBuffer();
LocalMessageIU msg = new LocalMessageIU("log");
HashMap<String, String> pl = new HashMap<String, String>();
pl.put("cmd", "open_log_file");
pl.put("filename", fileName);
if (logMode != null) {
if (logMode.equals("append") ||
logMode.equals("overwrite") ||
logMode.equals("timestamp")) {
pl.put("existing", logMode);
} else {
return;
}
}
ob.add(msg);
}
public static void sendIpaacaLogs(boolean flag) {
synchronized (lock) {
SEND_IPAACA_LOGS = flag;
}
}
private static void logConsole(String level, String text, float now, String function, String thread) {
for(String line: text.split("\n")) {
System.out.println("[" + level + "] " + thread + " " + function + " " + line);
function = StringUtils.leftPad("", function.length(), ' ');
thread = StringUtils.leftPad("", thread.length(), ' ');
}
}
private static void logIpaaca(String level, String text, float now, String function, String thread) {
initializeOutBuffer();
LocalMessageIU msg = new LocalMessageIU("log");
HashMap<String, String> pl = new HashMap<String, String>();
pl.put("module", MODULE_NAME);
pl.put("function", function);
pl.put("level", level);
pl.put("time", String.format("%.3f", now));
pl.put("thread", thread);
pl.put("uuid", UUID.randomUUID().toString());
pl.put("text", text);
msg.setPayload(pl);
ob.add(msg);
}
private static String getCallerName() {
String function = Thread.currentThread().getStackTrace()[3].getClassName();
function += "." + Thread.currentThread().getStackTrace()[3].getMethodName();
return function;
}
public static void logError(String msg) {
logError(msg, System.currentTimeMillis(), getCallerName());
}
public static void logError(String msg, float now) {
logError(msg, now, getCallerName());
}
private static void logError(String msg, float now, String callerName) {
String thread = Thread.currentThread().getName();
if (SEND_IPAACA_LOGS) {
logIpaaca("ERROR", msg, now, callerName, thread);
}
logConsole("ERROR", msg, now, callerName, thread);
}
public static void logWarn(String msg) {
logWarn(msg, System.currentTimeMillis(), getCallerName());
}
public static void logWarn(String msg, float now) {
logWarn(msg, now, getCallerName());
}
private static void logWarn(String msg, float now, String callerName) {
String thread = Thread.currentThread().getName();
if (SEND_IPAACA_LOGS) {
logIpaaca("WARN", msg, now, callerName, thread);
}
logConsole("WARN", msg, now, callerName, thread);
}
public static void logInfo(String msg) {
logInfo(msg, System.currentTimeMillis(), getCallerName());
}
public static void logInfo(String msg, float now) {
logInfo(msg, now, getCallerName());
}
private static void logInfo(String msg, float now, String callerName) {
String thread = Thread.currentThread().getName();
if (SEND_IPAACA_LOGS) {
logIpaaca("INFO", msg, now, callerName, thread);
}
logConsole("INFO", msg, now, callerName, thread);
}
public static void logDebug(String msg) {
logDebug(msg, System.currentTimeMillis(), getCallerName());
}
public static void logDebug(String msg, float now) {
logDebug(msg, now, getCallerName());
}
private static void logDebug(String msg, float now, String callerName) {
String thread = Thread.currentThread().getName();
if (SEND_IPAACA_LOGS) {
logIpaaca("DEBUG", msg, now, callerName, thread);
}
logConsole("DEBUG", msg, now, callerName, thread);
}
}
package ipaaca.util.communication;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import com.google.common.collect.ImmutableSet;
import ipaaca.AbstractIU;
import ipaaca.HandlerFunctor;
import ipaaca.IUEventHandler;
import ipaaca.IUEventType;
import ipaaca.InputBuffer;
/**
* Obtain a IU in the future. Usage:<br>
* FutureIU fu = FutureIU("componentx", "status", "started"); //wait for componentx to send a message that is it fully started<br>
* [Start componentx, assumes that component x will send a message or other iu with status=started in the payload]<br>
* AbstractIU iu = fu.take(); //get the actual IU
* @author hvanwelbergen
*/
public class FutureIU
{
private final InputBuffer inBuffer;
private final BlockingQueue<AbstractIU> queue = new ArrayBlockingQueue<AbstractIU>(1);
private final IUEventHandler handler;
public FutureIU(String category, final String idKey, final String idVal, InputBuffer inBuffer)
{
this.inBuffer = inBuffer;
handler = new IUEventHandler(new HandlerFunctor()
{
@Override
public void handle(AbstractIU iu, IUEventType type, boolean local)
{
String id = iu.getPayload().get(idKey);
if (idVal.equals(id))
{
queue.offer(iu);
}
}
}, ImmutableSet.of(category));
inBuffer.registerHandler(handler);
}
public FutureIU(String category, String idKey, String idVal)
{
this(category, idKey, idVal, new InputBuffer("FutureIU", ImmutableSet.of(category)));
}
/**
* Closes the FutureIU, use only if get is not used.
*/
public void cleanup()
{
inBuffer.removeHandler(handler);
if (inBuffer.getOwningComponentName().equals("FutureIU"))
{
inBuffer.close();
}
}
/**
* Waits (if necessary) for the IU and take it (can be done only once)
*/
public AbstractIU take() throws InterruptedException
{
AbstractIU iu;
try
{
iu = queue.take();
}
finally
{
cleanup();
}
return iu;
}
/**
* Wait for at most the given time for the IU and take it (can be done only once), return null on timeout
*/
public AbstractIU take(long timeout, TimeUnit unit) throws InterruptedException
{
AbstractIU iu;
try
{
iu = queue.poll(timeout, unit);
}
finally
{
cleanup();
}
return iu;
}
}
package ipaaca.util.communication;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import com.google.common.collect.ImmutableSet;
import ipaaca.AbstractIU;
import ipaaca.HandlerFunctor;
import ipaaca.IUEventType;
import ipaaca.InputBuffer;
/**
* Obtain multiple future ius on an specific category. Usage:<br>
* FutureIUs futures = new FutureIUs(componentx, key);<br>
* [make componentx send a IU with key=keyvaluedesired1]<br>
* AbstractIU iu = futures.take(keyvaluedesired1);<br>
* [make componentx send a IU with key=keyvaluedesired2]
* AbstractIU iu = futures.take(keyvaluedesired2);<br>
* ...<br>
* futures.close();
* @author hvanwelbergen
*/
public class FutureIUs
{
private final InputBuffer inBuffer;
private final Map<String,BlockingQueue<AbstractIU>> resultsMap = Collections.synchronizedMap(new HashMap<String,BlockingQueue<AbstractIU>>());
public FutureIUs(String category, final String idKey)
{
inBuffer = new InputBuffer("FutureIUs", ImmutableSet.of(category));
inBuffer.registerHandler(new HandlerFunctor()
{
@Override
public void handle(AbstractIU iu, IUEventType type, boolean local)
{
String id = iu.getPayload().get(idKey);
resultsMap.putIfAbsent(id, new ArrayBlockingQueue<AbstractIU>(1));
resultsMap.get(id).offer(iu);
}
}, ImmutableSet.of(category));
}
/**
* Waits (if necessary) for the IU and take it (can be done only once)
*/
public AbstractIU take(String idValue) throws InterruptedException
{
resultsMap.putIfAbsent(idValue, new ArrayBlockingQueue<AbstractIU>(1));
return resultsMap.get(idValue).take();
}
/**
* Wait for at most the given time for the IU and take it (can be done only once), return null on timeout
*/
public AbstractIU take(String idValue, long timeout, TimeUnit unit) throws InterruptedException
{
resultsMap.putIfAbsent(idValue, new ArrayBlockingQueue<AbstractIU>(1));
return resultsMap.get(idValue).poll(timeout, unit);
}
public void close()
{
inBuffer.close();
}
}
/*
* This file is part of IPAACA, the
* "Incremental Processing Architecture
* for Artificial Conversational Agents".
*
* Copyright (c) 2009-2013 Sociable Agents Group
* CITEC, Bielefeld University
*
* http://opensource.cit-ec.de/projects/ipaaca/
* http://purl.org/net/ipaaca
*
* This file may be licensed under the terms of of the
* GNU Lesser General Public License Version 3 (the ``LGPL''),
* or (at your option) any later version.
*
* Software distributed under the License is distributed
* on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the LGPL for the specific language
* governing rights and limitations.
*
* You should have received a copy of the LGPL along with this
* program. If not, go to http://www.gnu.org/licenses/lgpl.html
* or write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The development of this software was supported by the
* Excellence Cluster EXC 277 Cognitive Interaction Technology.
* The Excellence Cluster EXC 277 is a grant of the Deutsche
* Forschungsgemeinschaft (DFG) in the context of the German
* Excellence Initiative.
*/
package ipaacademo; package ipaacademo;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
...@@ -6,6 +38,11 @@ import java.io.IOException; ...@@ -6,6 +38,11 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
/**
* Demonstrates how to call a python script from java
* @author hvanwelbergen
*
*/
public class PythonCall public class PythonCall
{ {
......
/*
* This file is part of IPAACA, the
* "Incremental Processing Architecture
* for Artificial Conversational Agents".
*
* Copyright (c) 2009-2013 Sociable Agents Group
* CITEC, Bielefeld University
*
* http://opensource.cit-ec.de/projects/ipaaca/
* http://purl.org/net/ipaaca
*
* This file may be licensed under the terms of of the
* GNU Lesser General Public License Version 3 (the ``LGPL''),
* or (at your option) any later version.
*
* Software distributed under the License is distributed
* on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the LGPL for the specific language
* governing rights and limitations.
*
* You should have received a copy of the LGPL along with this
* program. If not, go to http://www.gnu.org/licenses/lgpl.html
* or write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The development of this software was supported by the
* Excellence Cluster EXC 277 Cognitive Interaction Technology.
* The Excellence Cluster EXC 277 is a grant of the Deutsche
* Forschungsgemeinschaft (DFG) in the context of the German
* Excellence Initiative.
*/
package ipaacademo;
import ipaaca.AbstractIU;
import ipaaca.HandlerFunctor;
import ipaaca.IUEventHandler;
import ipaaca.IUEventType;
import ipaaca.Initializer;
import ipaaca.InputBuffer;
import ipaaca.OutputBuffer;
import ipaaca.RemotePushIU;
import java.util.EnumSet;
import java.util.Set;
import javax.swing.JFrame;
import javax.swing.JLabel;
import com.google.common.collect.ImmutableSet;
public class TestListener
{
private static final class MyEventHandler implements HandlerFunctor
{
@Override
public void handle(AbstractIU iu, IUEventType type, boolean local)
{
switch(type)
{
case ADDED: System.out.println("IU added "+iu.getPayload().get("CONTENT")); break;
case COMMITTED: System.out.println("IU committed"); break;
case UPDATED: System.out.println("IU updated "+iu.getPayload()); break;
case LINKSUPDATED: System.out.println("IU links updated"); break;
case RETRACTED: break;
case DELETED: break;
}
}
}
static
{
Initializer.initializeIpaacaRsb();
}
private static final String CATEGORY = "spam";
private static final double RATE = 0.5;
private UpdateThread updateThread;
public TestListener()
{
Set<String> categories = new ImmutableSet.Builder<String>().add(CATEGORY).build();
JLabel label = new JLabel("");
updateThread = new UpdateThread(new InputBuffer("TestListener", categories),label);
}
public void start()
{
updateThread.start();
}
private static class UpdateThread extends Thread
{
private InputBuffer inBuffer;
private JLabel label;
public UpdateThread(InputBuffer inBuffer, JLabel label)
{
this.inBuffer = inBuffer;
this.label = label;
EnumSet<IUEventType> types = EnumSet.of(IUEventType.ADDED,IUEventType.COMMITTED,IUEventType.UPDATED,IUEventType.LINKSUPDATED);
Set<String> categories = new ImmutableSet.Builder<String>().add(CATEGORY).build();
MyEventHandler printingEventHandler;
printingEventHandler = new MyEventHandler();
this.inBuffer.registerHandler(new IUEventHandler(printingEventHandler,types,categories));
}
@Override
public void run()
{
System.out.println("Starting!");
}
}
public static void main(String args[])
{
TestListener tl = new TestListener();
tl.start();
}
}
/*
* This file is part of IPAACA, the
* "Incremental Processing Architecture
* for Artificial Conversational Agents".
*
* Copyright (c) 2009-2013 Sociable Agents Group
* CITEC, Bielefeld University
*
* http://opensource.cit-ec.de/projects/ipaaca/
* http://purl.org/net/ipaaca
*
* This file may be licensed under the terms of of the
* GNU Lesser General Public License Version 3 (the ``LGPL''),
* or (at your option) any later version.
*
* Software distributed under the License is distributed
* on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the LGPL for the specific language
* governing rights and limitations.
*
* You should have received a copy of the LGPL along with this
* program. If not, go to http://www.gnu.org/licenses/lgpl.html
* or write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The development of this software was supported by the
* Excellence Cluster EXC 277 Cognitive Interaction Technology.
* The Excellence Cluster EXC 277 is a grant of the Deutsche
* Forschungsgemeinschaft (DFG) in the context of the German
* Excellence Initiative.
*/
package ipaacademo; package ipaacademo;
import ipaaca.AbstractIU;
import ipaaca.HandlerFunctor;
import ipaaca.IUEventHandler;
import ipaaca.IUEventType;
import ipaaca.Initializer;
import ipaaca.InputBuffer;
import ipaaca.OutputBuffer;
import ipaaca.RemotePushIU;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Set; import java.util.Set;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import ipaaca.*;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JLabel; import javax.swing.JLabel;
...@@ -28,6 +63,8 @@ public class TextPrinter ...@@ -28,6 +63,8 @@ public class TextPrinter
case COMMITTED: System.out.println("IU committed"); break; case COMMITTED: System.out.println("IU committed"); break;
case UPDATED: System.out.println("IU updated "+iu.getPayload()); break; case UPDATED: System.out.println("IU updated "+iu.getPayload()); break;
case LINKSUPDATED: System.out.println("IU links updated"); break; case LINKSUPDATED: System.out.println("IU links updated"); break;
case RETRACTED: break;
case DELETED: break;
} }
} }
...@@ -185,7 +222,8 @@ public class TextPrinter ...@@ -185,7 +222,8 @@ public class TextPrinter
TextPrinter tp = new TextPrinter(); TextPrinter tp = new TextPrinter();
OutputBuffer outBuffer = new OutputBuffer("componentX"); //OutputBuffer outBuffer = new OutputBuffer("componentX");
/*String[] inputString = {"h","e","l","l","o"," ","w","o","r","l","d","!"}; /*String[] inputString = {"h","e","l","l","o"," ","w","o","r","l","d","!"};
LocalIU predIU = null; LocalIU predIU = null;
for(String str:inputString) for(String str:inputString)
......
<?xml version="1.0" encoding="UTF-8"?>
<BugCollection version="1.3.9" sequence="0" timestamp="1331224756097" analysisTimestamp="1331224757021" release="">
<Project projectName="">
<Jar>/homes/hvanwelbergen/git_pool/ipaaca/java/build</Jar>
<SrcDir>/homes/hvanwelbergen/git_pool/ipaaca/java/src</SrcDir>
<SrcDir>/homes/hvanwelbergen/git_pool/ipaaca/java/test/src</SrcDir>
</Project>
<BugInstance type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" priority="1" abbrev="CN" category="BAD_PRACTICE">
<Class classname="ipaaca.Ipaaca$IU$Builder">
<SourceLine classname="ipaaca.Ipaaca$IU$Builder" start="1" end="3024" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Class>
<Method classname="ipaaca.Ipaaca$IU$Builder" name="clone" signature="()Lcom/google/protobuf/GeneratedMessage$Builder;" isStatic="false">
<SourceLine classname="ipaaca.Ipaaca$IU$Builder" start="1" end="1" startBytecode="0" endBytecode="36" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
</BugInstance>
<BugInstance type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" priority="1" abbrev="CN" category="BAD_PRACTICE">
<Class classname="ipaaca.Ipaaca$IUCommission$Builder">
<SourceLine classname="ipaaca.Ipaaca$IUCommission$Builder" start="1" end="5034" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Class>
<Method classname="ipaaca.Ipaaca$IUCommission$Builder" name="clone" signature="()Lcom/google/protobuf/GeneratedMessage$Builder;" isStatic="false">
<SourceLine classname="ipaaca.Ipaaca$IUCommission$Builder" start="1" end="1" startBytecode="0" endBytecode="36" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
</BugInstance>
<BugInstance type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" priority="1" abbrev="CN" category="BAD_PRACTICE">
<Class classname="ipaaca.Ipaaca$IULinkUpdate$Builder">
<SourceLine classname="ipaaca.Ipaaca$IULinkUpdate$Builder" start="1" end="6219" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Class>
<Method classname="ipaaca.Ipaaca$IULinkUpdate$Builder" name="clone" signature="()Lcom/google/protobuf/GeneratedMessage$Builder;" isStatic="false">
<SourceLine classname="ipaaca.Ipaaca$IULinkUpdate$Builder" start="1" end="1" startBytecode="0" endBytecode="36" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
</BugInstance>
<BugInstance type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" priority="1" abbrev="CN" category="BAD_PRACTICE">
<Class classname="ipaaca.Ipaaca$IUPayloadUpdate$Builder">
<SourceLine classname="ipaaca.Ipaaca$IUPayloadUpdate$Builder" start="1" end="4036" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Class>
<Method classname="ipaaca.Ipaaca$IUPayloadUpdate$Builder" name="clone" signature="()Lcom/google/protobuf/GeneratedMessage$Builder;" isStatic="false">
<SourceLine classname="ipaaca.Ipaaca$IUPayloadUpdate$Builder" start="1" end="1" startBytecode="0" endBytecode="36" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
</BugInstance>
<BugInstance type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" priority="1" abbrev="CN" category="BAD_PRACTICE">
<Class classname="ipaaca.Ipaaca$IURetraction$Builder">
<SourceLine classname="ipaaca.Ipaaca$IURetraction$Builder" start="1" end="4483" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Class>
<Method classname="ipaaca.Ipaaca$IURetraction$Builder" name="clone" signature="()Lcom/google/protobuf/GeneratedMessage$Builder;" isStatic="false">
<SourceLine classname="ipaaca.Ipaaca$IURetraction$Builder" start="1" end="1" startBytecode="0" endBytecode="36" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
</BugInstance>
<BugInstance type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" priority="1" abbrev="CN" category="BAD_PRACTICE">
<Class classname="ipaaca.Ipaaca$IntMessage$Builder">
<SourceLine classname="ipaaca.Ipaaca$IntMessage$Builder" start="1" end="343" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Class>
<Method classname="ipaaca.Ipaaca$IntMessage$Builder" name="clone" signature="()Lcom/google/protobuf/GeneratedMessage$Builder;" isStatic="false">
<SourceLine classname="ipaaca.Ipaaca$IntMessage$Builder" start="1" end="1" startBytecode="0" endBytecode="36" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
</BugInstance>
<BugInstance type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" priority="1" abbrev="CN" category="BAD_PRACTICE">
<Class classname="ipaaca.Ipaaca$LinkSet$Builder">
<SourceLine classname="ipaaca.Ipaaca$LinkSet$Builder" start="1" end="838" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Class>
<Method classname="ipaaca.Ipaaca$LinkSet$Builder" name="clone" signature="()Lcom/google/protobuf/GeneratedMessage$Builder;" isStatic="false">
<SourceLine classname="ipaaca.Ipaaca$LinkSet$Builder" start="1" end="1" startBytecode="0" endBytecode="36" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
</BugInstance>
<BugInstance type="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE" priority="1" abbrev="CN" category="BAD_PRACTICE">
<Class classname="ipaaca.Ipaaca$PayloadItem$Builder">
<SourceLine classname="ipaaca.Ipaaca$PayloadItem$Builder" start="1" end="1425" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Class>
<Method classname="ipaaca.Ipaaca$PayloadItem$Builder" name="clone" signature="()Lcom/google/protobuf/GeneratedMessage$Builder;" isStatic="false">
<SourceLine classname="ipaaca.Ipaaca$PayloadItem$Builder" start="1" end="1" startBytecode="0" endBytecode="36" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
</BugInstance>
<BugInstance type="OS_OPEN_STREAM" priority="2" abbrev="OS" category="BAD_PRACTICE">
<Class classname="ipaaca.JavaPythonTest">
<SourceLine classname="ipaaca.JavaPythonTest" start="18" end="186" sourcefile="JavaPythonTest.java" sourcepath="ipaaca/JavaPythonTest.java"/>
</Class>
<Method classname="ipaaca.JavaPythonTest" name="printRuntimeErrors" signature="(Ljava/lang/Process;)V" isStatic="false">
<SourceLine classname="ipaaca.JavaPythonTest" start="43" end="75" startBytecode="0" endBytecode="72" sourcefile="JavaPythonTest.java" sourcepath="ipaaca/JavaPythonTest.java"/>
</Method>
<Type descriptor="Ljava/io/Reader;" role="TYPE_CLOSEIT">
<SourceLine classname="java.io.Reader" start="49" end="232" sourcefile="Reader.java" sourcepath="java/io/Reader.java"/>
</Type>
<SourceLine classname="ipaaca.JavaPythonTest" start="46" end="46" startBytecode="24" endBytecode="24" sourcefile="JavaPythonTest.java" sourcepath="ipaaca/JavaPythonTest.java"/>
<SourceLine classname="ipaaca.JavaPythonTest" start="69" end="69" startBytecode="126" endBytecode="126" sourcefile="JavaPythonTest.java" sourcepath="ipaaca/JavaPythonTest.java" role="SOURCE_LINE_ANOTHER_INSTANCE"/>
</BugInstance>
<BugInstance type="NP_NULL_PARAM_DEREF" priority="2" abbrev="NP" category="CORRECTNESS">
<Class classname="ipaaca.LocalIU">
<SourceLine classname="ipaaca.LocalIU" start="23" end="250" sourcefile="LocalIU.java" sourcepath="ipaaca/LocalIU.java"/>
</Class>
<Method classname="ipaaca.LocalIU" name="modifyLinks" signature="(ZLcom/google/common/collect/SetMultimap;Lcom/google/common/collect/SetMultimap;Ljava/lang/String;)V" isStatic="false">
<SourceLine classname="ipaaca.LocalIU" start="112" end="154" startBytecode="0" endBytecode="771" sourcefile="LocalIU.java" sourcepath="ipaaca/LocalIU.java"/>
</Method>
<Method classname="ipaaca.Ipaaca$IULinkUpdate$Builder" name="setWriterName" signature="(Ljava/lang/String;)Lipaaca/Ipaaca$IULinkUpdate$Builder;" isStatic="false" role="METHOD_CALLED">
<SourceLine classname="ipaaca.Ipaaca$IULinkUpdate$Builder" start="6201" end="6207" startBytecode="0" endBytecode="114" sourcefile="Ipaaca.java" sourcepath="ipaaca/Ipaaca.java"/>
</Method>
<Int value="1" role="INT_MAYBE_NULL_ARG"/>
<LocalVariable name="?" register="-1" pc="281" role="LOCAL_VARIABLE_UNKNOWN"/>
<SourceLine classname="ipaaca.LocalIU" start="147" end="147" startBytecode="281" endBytecode="281" sourcefile="LocalIU.java" sourcepath="ipaaca/LocalIU.java" role="SOURCE_LINE_INVOKED"/>
<SourceLine classname="ipaaca.LocalIU" start="132" end="132" startBytecode="71" endBytecode="71" sourcefile="LocalIU.java" sourcepath="ipaaca/LocalIU.java" role="SOURCE_LINE_KNOWN_NULL"/>
<Property name="edu.umd.cs.findbugs.detect.NullDerefProperty.LONG_RANGE_NULL_SOURCE" value="true"/>
</BugInstance>
<BugInstance type="SBSC_USE_STRINGBUFFER_CONCATENATION" priority="2" abbrev="SBSC" category="PERFORMANCE">
<Class classname="ipaacademo.TextPrinter$UpdateThread">
<SourceLine classname="ipaacademo.TextPrinter$UpdateThread" start="52" end="101" sourcefile="TextPrinter.java" sourcepath="ipaacademo/TextPrinter.java"/>
</Class>
<Method classname="ipaacademo.TextPrinter$UpdateThread" name="run" signature="()V" isStatic="false">
<SourceLine classname="ipaacademo.TextPrinter$UpdateThread" start="61" end="62" startBytecode="0" endBytecode="559" sourcefile="TextPrinter.java" sourcepath="ipaacademo/TextPrinter.java"/>
</Method>
<SourceLine classname="ipaacademo.TextPrinter$UpdateThread" start="82" end="82" startBytecode="101" endBytecode="101" sourcefile="TextPrinter.java" sourcepath="ipaacademo/TextPrinter.java"/>
</BugInstance>
<Errors errors="0" missingClasses="72">
<MissingClass>com.google.common.collect.HashMultimap</MissingClass>
<MissingClass>com.google.common.collect.ImmutableMap</MissingClass>
<MissingClass>com.google.common.collect.ImmutableSet</MissingClass>
<MissingClass>com.google.common.collect.ImmutableSet$Builder</MissingClass>
<MissingClass>com.google.common.collect.Multimap</MissingClass>
<MissingClass>com.google.common.collect.SetMultimap</MissingClass>
<MissingClass>com.google.protobuf.AbstractMessage</MissingClass>
<MissingClass>com.google.protobuf.AbstractMessage$Builder</MissingClass>
<MissingClass>com.google.protobuf.ByteString</MissingClass>
<MissingClass>com.google.protobuf.CodedInputStream</MissingClass>
<MissingClass>com.google.protobuf.CodedOutputStream</MissingClass>
<MissingClass>com.google.protobuf.Descriptors</MissingClass>
<MissingClass>com.google.protobuf.Descriptors$Descriptor</MissingClass>
<MissingClass>com.google.protobuf.Descriptors$EnumDescriptor</MissingClass>
<MissingClass>com.google.protobuf.Descriptors$EnumValueDescriptor</MissingClass>
<MissingClass>com.google.protobuf.Descriptors$FileDescriptor</MissingClass>
<MissingClass>com.google.protobuf.Descriptors$FileDescriptor$InternalDescriptorAssigner</MissingClass>
<MissingClass>com.google.protobuf.ExtensionRegistryLite</MissingClass>
<MissingClass>com.google.protobuf.GeneratedMessage</MissingClass>
<MissingClass>com.google.protobuf.GeneratedMessage$Builder</MissingClass>
<MissingClass>com.google.protobuf.GeneratedMessage$BuilderParent</MissingClass>
<MissingClass>com.google.protobuf.GeneratedMessage$FieldAccessorTable</MissingClass>
<MissingClass>com.google.protobuf.Internal</MissingClass>
<MissingClass>com.google.protobuf.Internal$EnumLite</MissingClass>
<MissingClass>com.google.protobuf.Internal$EnumLiteMap</MissingClass>
<MissingClass>com.google.protobuf.InvalidProtocolBufferException</MissingClass>
<MissingClass>com.google.protobuf.LazyStringArrayList</MissingClass>
<MissingClass>com.google.protobuf.LazyStringList</MissingClass>
<MissingClass>com.google.protobuf.Message</MissingClass>
<MissingClass>com.google.protobuf.Message$Builder</MissingClass>
<MissingClass>com.google.protobuf.MessageLite</MissingClass>
<MissingClass>com.google.protobuf.MessageLite$Builder</MissingClass>
<MissingClass>com.google.protobuf.MessageOrBuilder</MissingClass>
<MissingClass>com.google.protobuf.ProtocolMessageEnum</MissingClass>
<MissingClass>com.google.protobuf.RepeatedFieldBuilder</MissingClass>
<MissingClass>com.google.protobuf.UninitializedMessageException</MissingClass>
<MissingClass>com.google.protobuf.UnknownFieldSet</MissingClass>
<MissingClass>com.google.protobuf.UnknownFieldSet$Builder</MissingClass>
<MissingClass>com.google.protobuf.UnmodifiableLazyStringList</MissingClass>
<MissingClass>org.hamcrest.Matcher</MissingClass>
<MissingClass>org.hamcrest.MatcherAssert</MissingClass>
<MissingClass>org.hamcrest.Matchers</MissingClass>
<MissingClass>org.hamcrest.collection.IsIterableContainingInAnyOrder</MissingClass>
<MissingClass>org.junit.After</MissingClass>
<MissingClass>org.junit.Assert</MissingClass>
<MissingClass>org.junit.Before</MissingClass>
<MissingClass>org.junit.Test</MissingClass>
<MissingClass>org.mockito.Matchers</MissingClass>
<MissingClass>org.mockito.Mockito</MissingClass>
<MissingClass>org.mockito.stubbing.OngoingStubbing</MissingClass>
<MissingClass>org.mockito.verification.VerificationMode</MissingClass>
<MissingClass>org.slf4j.Logger</MissingClass>
<MissingClass>org.slf4j.LoggerFactory</MissingClass>
<MissingClass>rsb.Event</MissingClass>
<MissingClass>rsb.Factory</MissingClass>
<MissingClass>rsb.Handler</MissingClass>
<MissingClass>rsb.Informer</MissingClass>
<MissingClass>rsb.InitializeException</MissingClass>
<MissingClass>rsb.Listener</MissingClass>
<MissingClass>rsb.RSBException</MissingClass>
<MissingClass>rsb.Scope</MissingClass>
<MissingClass>rsb.converter.ConversionException</MissingClass>
<MissingClass>rsb.converter.Converter</MissingClass>
<MissingClass>rsb.converter.ConverterRepository</MissingClass>
<MissingClass>rsb.converter.ConverterSignature</MissingClass>
<MissingClass>rsb.converter.DefaultConverterRepository</MissingClass>
<MissingClass>rsb.converter.ProtocolBufferConverter</MissingClass>
<MissingClass>rsb.converter.UserData</MissingClass>
<MissingClass>rsb.converter.WireContents</MissingClass>
<MissingClass>rsb.patterns.DataCallback</MissingClass>
<MissingClass>rsb.patterns.LocalServer</MissingClass>
<MissingClass>rsb.patterns.RemoteServer</MissingClass>
</Errors>
<FindBugsSummary timestamp="Thu, 8 Mar 2012 17:39:16 +0100" total_classes="64" referenced_classes="159" total_bugs="11" total_size="6091" num_packages="2" vm_version="19.1-b02" cpu_seconds="25.20" clock_seconds="8.59" peak_mbytes="216.40" alloc_mbytes="455.12" gc_seconds="0.50" priority_2="3" priority_1="8">
<PackageStats package="ipaaca" total_bugs="10" total_types="61" total_size="6002" priority_2="2" priority_1="8">
<ClassStats class="ipaaca.AbstractIU" sourceFile="AbstractIU.java" interface="false" size="115" bugs="0"/>
<ClassStats class="ipaaca.Buffer" sourceFile="Buffer.java" interface="false" size="24" bugs="0"/>
<ClassStats class="ipaaca.ComponentCommunicationIntegrationTest" sourceFile="ComponentCommunicationIntegrationTest.java" interface="false" size="205" bugs="0"/>
<ClassStats class="ipaaca.ComponentCommunicationIntegrationTest$MyEventHandler" sourceFile="ComponentCommunicationIntegrationTest.java" interface="false" size="37" bugs="0"/>
<ClassStats class="ipaaca.HandlerFunctor" sourceFile="HandlerFunctor.java" interface="true" size="2" bugs="0"/>
<ClassStats class="ipaaca.IUAccessMode" sourceFile="IUAccessMode.java" interface="false" size="12" bugs="0"/>
<ClassStats class="ipaaca.IUCommittedException" sourceFile="IUCommittedException.java" interface="false" size="9" bugs="0"/>
<ClassStats class="ipaaca.IUConverter" sourceFile="IUConverter.java" interface="false" size="53" bugs="0"/>
<ClassStats class="ipaaca.IUEventHandler" sourceFile="IUEventHandler.java" interface="false" size="17" bugs="0"/>
<ClassStats class="ipaaca.IUEventType" sourceFile="IUEventType.java" interface="false" size="15" bugs="0"/>
<ClassStats class="ipaaca.IUPublishedException" sourceFile="IUPublishedException.java" interface="false" size="9" bugs="0"/>
<ClassStats class="ipaaca.IUReadOnlyException" sourceFile="IUReadOnlyException.java" interface="false" size="9" bugs="0"/>
<ClassStats class="ipaaca.IUStore" sourceFile="IUStore.java" interface="false" size="4" bugs="0"/>
<ClassStats class="ipaaca.IUTestUtil" sourceFile="IUTestUtil.java" interface="false" size="48" bugs="0"/>
<ClassStats class="ipaaca.IUUpdateFailedException" sourceFile="IUUpdateFailedException.java" interface="false" size="9" bugs="0"/>
<ClassStats class="ipaaca.Info" sourceFile="Info.java" interface="false" size="58" bugs="0"/>
<ClassStats class="ipaaca.Initializer" sourceFile="Initializer.java" interface="false" size="16" bugs="0"/>
<ClassStats class="ipaaca.InputBuffer" sourceFile="InputBuffer.java" interface="false" size="99" bugs="0"/>
<ClassStats class="ipaaca.InputBuffer$InputHandler" sourceFile="InputBuffer.java" interface="false" size="7" bugs="0"/>
<ClassStats class="ipaaca.InputBufferTest" sourceFile="InputBufferTest.java" interface="false" size="29" bugs="0"/>
<ClassStats class="ipaaca.IntConverter" sourceFile="IntConverter.java" interface="false" size="18" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca" sourceFile="Ipaaca.java" interface="false" size="85" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$1" sourceFile="Ipaaca.java" interface="false" size="71" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IU" sourceFile="Ipaaca.java" interface="false" size="349" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IU$AccessMode" sourceFile="Ipaaca.java" interface="false" size="50" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IU$AccessMode$1" sourceFile="Ipaaca.java" interface="false" size="7" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IU$Builder" sourceFile="Ipaaca.java" interface="false" size="676" bugs="1" priority_1="1"/>
<ClassStats class="ipaaca.Ipaaca$IUCommission" sourceFile="Ipaaca.java" interface="false" size="182" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IUCommission$Builder" sourceFile="Ipaaca.java" interface="false" size="202" bugs="1" priority_1="1"/>
<ClassStats class="ipaaca.Ipaaca$IUCommissionOrBuilder" sourceFile="Ipaaca.java" interface="true" size="7" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IULinkUpdate" sourceFile="Ipaaca.java" interface="false" size="249" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IULinkUpdate$Builder" sourceFile="Ipaaca.java" interface="false" size="535" bugs="1" priority_1="1"/>
<ClassStats class="ipaaca.Ipaaca$IULinkUpdateOrBuilder" sourceFile="Ipaaca.java" interface="true" size="19" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IUOrBuilder" sourceFile="Ipaaca.java" interface="true" size="27" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IUPayloadUpdate" sourceFile="Ipaaca.java" interface="false" size="244" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IUPayloadUpdate$Builder" sourceFile="Ipaaca.java" interface="false" size="441" bugs="1" priority_1="1"/>
<ClassStats class="ipaaca.Ipaaca$IUPayloadUpdateOrBuilder" sourceFile="Ipaaca.java" interface="true" size="17" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IURetraction" sourceFile="Ipaaca.java" interface="false" size="149" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IURetraction$Builder" sourceFile="Ipaaca.java" interface="false" size="162" bugs="1" priority_1="1"/>
<ClassStats class="ipaaca.Ipaaca$IURetractionOrBuilder" sourceFile="Ipaaca.java" interface="true" size="5" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IntMessage" sourceFile="Ipaaca.java" interface="false" size="116" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$IntMessage$Builder" sourceFile="Ipaaca.java" interface="false" size="122" bugs="1" priority_1="1"/>
<ClassStats class="ipaaca.Ipaaca$IntMessageOrBuilder" sourceFile="Ipaaca.java" interface="true" size="3" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$LinkSet" sourceFile="Ipaaca.java" interface="false" size="152" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$LinkSet$Builder" sourceFile="Ipaaca.java" interface="false" size="194" bugs="1" priority_1="1"/>
<ClassStats class="ipaaca.Ipaaca$LinkSetOrBuilder" sourceFile="Ipaaca.java" interface="true" size="6" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$PayloadItem" sourceFile="Ipaaca.java" interface="false" size="198" bugs="0"/>
<ClassStats class="ipaaca.Ipaaca$PayloadItem$Builder" sourceFile="Ipaaca.java" interface="false" size="215" bugs="1" priority_1="1"/>
<ClassStats class="ipaaca.Ipaaca$PayloadItemOrBuilder" sourceFile="Ipaaca.java" interface="true" size="7" bugs="0"/>
<ClassStats class="ipaaca.IuConverterTest" sourceFile="IuConverterTest.java" interface="false" size="69" bugs="0"/>
<ClassStats class="ipaaca.JavaPythonTest" sourceFile="JavaPythonTest.java" interface="false" size="81" bugs="1" priority_2="1"/>
<ClassStats class="ipaaca.LinkUpdateConverter" sourceFile="LinkUpdateConverter.java" interface="false" size="16" bugs="0"/>
<ClassStats class="ipaaca.LocalIU" sourceFile="LocalIU.java" interface="false" size="113" bugs="1" priority_2="1"/>
<ClassStats class="ipaaca.LocalIUTest" sourceFile="LocalIUTest.java" interface="false" size="29" bugs="0"/>
<ClassStats class="ipaaca.OutputBuffer" sourceFile="OutputBuffer.java" interface="false" size="140" bugs="0"/>
<ClassStats class="ipaaca.OutputBuffer$RemoteCommit" sourceFile="OutputBuffer.java" interface="false" size="10" bugs="0"/>
<ClassStats class="ipaaca.OutputBuffer$RemoteUpdateLinks" sourceFile="OutputBuffer.java" interface="false" size="10" bugs="0"/>
<ClassStats class="ipaaca.OutputBuffer$RemoteUpdatePayload" sourceFile="OutputBuffer.java" interface="false" size="10" bugs="0"/>
<ClassStats class="ipaaca.Payload" sourceFile="Payload.java" interface="false" size="79" bugs="0"/>
<ClassStats class="ipaaca.PayloadConverter" sourceFile="PayloadConverter.java" interface="false" size="16" bugs="0"/>
<ClassStats class="ipaaca.RemotePushIU" sourceFile="RemotePushIU.java" interface="false" size="144" bugs="0"/>
</PackageStats>
<PackageStats package="ipaacademo" total_bugs="1" total_types="3" total_size="89" priority_2="1">
<ClassStats class="ipaacademo.PythonCall" sourceFile="PythonCall.java" interface="false" size="23" bugs="0"/>
<ClassStats class="ipaacademo.TextPrinter" sourceFile="TextPrinter.java" interface="false" size="37" bugs="0"/>
<ClassStats class="ipaacademo.TextPrinter$UpdateThread" sourceFile="TextPrinter.java" interface="false" size="29" bugs="1" priority_2="1"/>
</PackageStats>
<FindBugsProfile>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindUncalledPrivateMethods" totalMilliseconds="11" invocations="64" avgMicrosecondsPerInvocation="175" maxMicrosecondsPerInvocation="1115" standardDeviationMircosecondsPerInvocation="219"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.ConstantPoolGenFactory" totalMilliseconds="12" invocations="64" avgMicrosecondsPerInvocation="187" maxMicrosecondsPerInvocation="3262" standardDeviationMircosecondsPerInvocation="403"/>
<ClassProfile name="edu.umd.cs.findbugs.util.TopologicalSort" totalMilliseconds="12" invocations="65" avgMicrosecondsPerInvocation="190" maxMicrosecondsPerInvocation="2175" standardDeviationMircosecondsPerInvocation="315"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.SerializableIdiom" totalMilliseconds="12" invocations="64" avgMicrosecondsPerInvocation="193" maxMicrosecondsPerInvocation="1797" standardDeviationMircosecondsPerInvocation="249"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.LoadedFieldSetFactory" totalMilliseconds="13" invocations="1268" avgMicrosecondsPerInvocation="10" maxMicrosecondsPerInvocation="431" standardDeviationMircosecondsPerInvocation="18"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindUnsatisfiedObligation" totalMilliseconds="13" invocations="64" avgMicrosecondsPerInvocation="211" maxMicrosecondsPerInvocation="2332" standardDeviationMircosecondsPerInvocation="428"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindSelfComparison2" totalMilliseconds="13" invocations="64" avgMicrosecondsPerInvocation="217" maxMicrosecondsPerInvocation="1786" standardDeviationMircosecondsPerInvocation="321"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindReturnRef" totalMilliseconds="15" invocations="64" avgMicrosecondsPerInvocation="247" maxMicrosecondsPerInvocation="1829" standardDeviationMircosecondsPerInvocation="350"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.AppendingToAnObjectOutputStream" totalMilliseconds="16" invocations="64" avgMicrosecondsPerInvocation="251" maxMicrosecondsPerInvocation="1707" standardDeviationMircosecondsPerInvocation="326"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.NumberConstructor" totalMilliseconds="16" invocations="64" avgMicrosecondsPerInvocation="252" maxMicrosecondsPerInvocation="1655" standardDeviationMircosecondsPerInvocation="317"/>
<ClassProfile name="edu.umd.cs.findbugs.NonReportingDetectorToDetector2Adapter" totalMilliseconds="16" invocations="2195" avgMicrosecondsPerInvocation="7" maxMicrosecondsPerInvocation="56" standardDeviationMircosecondsPerInvocation="2"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindFloatEquality" totalMilliseconds="16" invocations="64" avgMicrosecondsPerInvocation="256" maxMicrosecondsPerInvocation="1695" standardDeviationMircosecondsPerInvocation="322"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindFieldSelfAssignment" totalMilliseconds="16" invocations="64" avgMicrosecondsPerInvocation="259" maxMicrosecondsPerInvocation="1684" standardDeviationMircosecondsPerInvocation="330"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.ReverseDepthFirstSearchFactory" totalMilliseconds="16" invocations="1123" avgMicrosecondsPerInvocation="14" maxMicrosecondsPerInvocation="536" standardDeviationMircosecondsPerInvocation="26"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.SynchronizingOnContentsOfFieldToProtectField" totalMilliseconds="17" invocations="64" avgMicrosecondsPerInvocation="269" maxMicrosecondsPerInvocation="1713" standardDeviationMircosecondsPerInvocation="341"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.BadResultSetAccess" totalMilliseconds="17" invocations="64" avgMicrosecondsPerInvocation="271" maxMicrosecondsPerInvocation="1683" standardDeviationMircosecondsPerInvocation="330"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.SynchronizationOnSharedBuiltinConstant" totalMilliseconds="17" invocations="64" avgMicrosecondsPerInvocation="275" maxMicrosecondsPerInvocation="1738" standardDeviationMircosecondsPerInvocation="336"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FormatStringChecker" totalMilliseconds="17" invocations="64" avgMicrosecondsPerInvocation="278" maxMicrosecondsPerInvocation="1765" standardDeviationMircosecondsPerInvocation="355"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" totalMilliseconds="17" invocations="64" avgMicrosecondsPerInvocation="278" maxMicrosecondsPerInvocation="1929" standardDeviationMircosecondsPerInvocation="409"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.BadSyntaxForRegularExpression" totalMilliseconds="17" invocations="64" avgMicrosecondsPerInvocation="280" maxMicrosecondsPerInvocation="1826" standardDeviationMircosecondsPerInvocation="358"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.CrossSiteScripting" totalMilliseconds="18" invocations="64" avgMicrosecondsPerInvocation="284" maxMicrosecondsPerInvocation="1873" standardDeviationMircosecondsPerInvocation="361"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.ObligationDataflowFactory" totalMilliseconds="18" invocations="447" avgMicrosecondsPerInvocation="41" maxMicrosecondsPerInvocation="3665" standardDeviationMircosecondsPerInvocation="173"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindBadForLoop" totalMilliseconds="18" invocations="64" avgMicrosecondsPerInvocation="293" maxMicrosecondsPerInvocation="1830" standardDeviationMircosecondsPerInvocation="371"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.DumbMethodInvocations" totalMilliseconds="18" invocations="64" avgMicrosecondsPerInvocation="294" maxMicrosecondsPerInvocation="2837" standardDeviationMircosecondsPerInvocation="500"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.InfiniteRecursiveLoop" totalMilliseconds="19" invocations="64" avgMicrosecondsPerInvocation="298" maxMicrosecondsPerInvocation="1836" standardDeviationMircosecondsPerInvocation="390"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.LostLoggerDueToWeakReference" totalMilliseconds="19" invocations="64" avgMicrosecondsPerInvocation="309" maxMicrosecondsPerInvocation="1930" standardDeviationMircosecondsPerInvocation="394"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.DepthFirstSearchFactory" totalMilliseconds="20" invocations="1520" avgMicrosecondsPerInvocation="13" maxMicrosecondsPerInvocation="553" standardDeviationMircosecondsPerInvocation="23"/>
<ClassProfile name="edu.umd.cs.findbugs.DetectorToDetector2Adapter" totalMilliseconds="20" invocations="7135" avgMicrosecondsPerInvocation="2" maxMicrosecondsPerInvocation="64" standardDeviationMircosecondsPerInvocation="2"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindUnrelatedTypesInGenericContainer" totalMilliseconds="20" invocations="64" avgMicrosecondsPerInvocation="326" maxMicrosecondsPerInvocation="2813" standardDeviationMircosecondsPerInvocation="505"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindNonShortCircuit" totalMilliseconds="21" invocations="64" avgMicrosecondsPerInvocation="328" maxMicrosecondsPerInvocation="2172" standardDeviationMircosecondsPerInvocation="430"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.StreamResourceTracker" totalMilliseconds="21" invocations="21" avgMicrosecondsPerInvocation="1008" maxMicrosecondsPerInvocation="1622" standardDeviationMircosecondsPerInvocation="187"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindHEmismatch" totalMilliseconds="23" invocations="64" avgMicrosecondsPerInvocation="362" maxMicrosecondsPerInvocation="3891" standardDeviationMircosecondsPerInvocation="557"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.MethodReturnCheck" totalMilliseconds="23" invocations="64" avgMicrosecondsPerInvocation="368" maxMicrosecondsPerInvocation="2568" standardDeviationMircosecondsPerInvocation="482"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.InfiniteLoop" totalMilliseconds="23" invocations="64" avgMicrosecondsPerInvocation="371" maxMicrosecondsPerInvocation="2247" standardDeviationMircosecondsPerInvocation="481"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.RepeatedConditionals" totalMilliseconds="24" invocations="64" avgMicrosecondsPerInvocation="378" maxMicrosecondsPerInvocation="2526" standardDeviationMircosecondsPerInvocation="501"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindBadCast2" totalMilliseconds="25" invocations="64" avgMicrosecondsPerInvocation="393" maxMicrosecondsPerInvocation="2348" standardDeviationMircosecondsPerInvocation="542"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.impl.ZipCodeBaseFactory" totalMilliseconds="25" invocations="14" avgMicrosecondsPerInvocation="1806" maxMicrosecondsPerInvocation="23482" standardDeviationMircosecondsPerInvocation="6013"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.RuntimeExceptionCapture" totalMilliseconds="27" invocations="64" avgMicrosecondsPerInvocation="424" maxMicrosecondsPerInvocation="2570" standardDeviationMircosecondsPerInvocation="532"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindSelfComparison" totalMilliseconds="27" invocations="64" avgMicrosecondsPerInvocation="431" maxMicrosecondsPerInvocation="2891" standardDeviationMircosecondsPerInvocation="585"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.DuplicateBranches" totalMilliseconds="28" invocations="64" avgMicrosecondsPerInvocation="444" maxMicrosecondsPerInvocation="5597" standardDeviationMircosecondsPerInvocation="1014"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindSqlInjection" totalMilliseconds="28" invocations="64" avgMicrosecondsPerInvocation="444" maxMicrosecondsPerInvocation="3234" standardDeviationMircosecondsPerInvocation="600"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindPuzzlers" totalMilliseconds="32" invocations="64" avgMicrosecondsPerInvocation="503" maxMicrosecondsPerInvocation="3050" standardDeviationMircosecondsPerInvocation="647"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindDeadLocalStores" totalMilliseconds="35" invocations="64" avgMicrosecondsPerInvocation="551" maxMicrosecondsPerInvocation="3275" standardDeviationMircosecondsPerInvocation="698"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindNullDeref" totalMilliseconds="36" invocations="64" avgMicrosecondsPerInvocation="566" maxMicrosecondsPerInvocation="4243" standardDeviationMircosecondsPerInvocation="876"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.ReflectiveClasses" totalMilliseconds="36" invocations="159" avgMicrosecondsPerInvocation="229" maxMicrosecondsPerInvocation="5220" standardDeviationMircosecondsPerInvocation="583"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.UnreadFields" totalMilliseconds="43" invocations="64" avgMicrosecondsPerInvocation="676" maxMicrosecondsPerInvocation="4082" standardDeviationMircosecondsPerInvocation="868"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.DumbMethods" totalMilliseconds="47" invocations="64" avgMicrosecondsPerInvocation="734" maxMicrosecondsPerInvocation="4420" standardDeviationMircosecondsPerInvocation="944"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindNullDeref$CheckCallSitesAndReturnInstructions" totalMilliseconds="50" invocations="1065" avgMicrosecondsPerInvocation="46" maxMicrosecondsPerInvocation="1213" standardDeviationMircosecondsPerInvocation="84"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindRefComparison" totalMilliseconds="50" invocations="64" avgMicrosecondsPerInvocation="787" maxMicrosecondsPerInvocation="6427" standardDeviationMircosecondsPerInvocation="1137"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.SwitchFallthrough" totalMilliseconds="54" invocations="64" avgMicrosecondsPerInvocation="854" maxMicrosecondsPerInvocation="20855" standardDeviationMircosecondsPerInvocation="2625"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.NoteNonnullReturnValues" totalMilliseconds="55" invocations="64" avgMicrosecondsPerInvocation="870" maxMicrosecondsPerInvocation="5691" standardDeviationMircosecondsPerInvocation="1289"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.LoadOfKnownNullValue" totalMilliseconds="59" invocations="64" avgMicrosecondsPerInvocation="923" maxMicrosecondsPerInvocation="9619" standardDeviationMircosecondsPerInvocation="1598"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.EqualsOperandShouldHaveClassCompatibleWithThis" totalMilliseconds="64" invocations="159" avgMicrosecondsPerInvocation="407" maxMicrosecondsPerInvocation="3116" standardDeviationMircosecondsPerInvocation="582"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.ClassDataAnalysisEngine" totalMilliseconds="65" invocations="821" avgMicrosecondsPerInvocation="79" maxMicrosecondsPerInvocation="679" standardDeviationMircosecondsPerInvocation="70"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindInconsistentSync2" totalMilliseconds="71" invocations="64" avgMicrosecondsPerInvocation="1109" maxMicrosecondsPerInvocation="10523" standardDeviationMircosecondsPerInvocation="1891"/>
<ClassProfile name="edu.umd.cs.findbugs.ba.npe.TypeQualifierNullnessAnnotationDatabase" totalMilliseconds="81" invocations="15796" avgMicrosecondsPerInvocation="5" maxMicrosecondsPerInvocation="2014" standardDeviationMircosecondsPerInvocation="20"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.CalledMethods" totalMilliseconds="82" invocations="159" avgMicrosecondsPerInvocation="521" maxMicrosecondsPerInvocation="7484" standardDeviationMircosecondsPerInvocation="1035"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.JavaClassAnalysisEngine" totalMilliseconds="84" invocations="217" avgMicrosecondsPerInvocation="391" maxMicrosecondsPerInvocation="13488" standardDeviationMircosecondsPerInvocation="1185"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.BuildObligationPolicyDatabase" totalMilliseconds="87" invocations="159" avgMicrosecondsPerInvocation="549" maxMicrosecondsPerInvocation="7707" standardDeviationMircosecondsPerInvocation="891"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.LiveLocalStoreDataflowFactory" totalMilliseconds="118" invocations="937" avgMicrosecondsPerInvocation="126" maxMicrosecondsPerInvocation="1817" standardDeviationMircosecondsPerInvocation="195"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.OverridingEqualsNotSymmetrical" totalMilliseconds="123" invocations="159" avgMicrosecondsPerInvocation="778" maxMicrosecondsPerInvocation="8332" standardDeviationMircosecondsPerInvocation="1247"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindOpenStream" totalMilliseconds="149" invocations="64" avgMicrosecondsPerInvocation="2330" maxMicrosecondsPerInvocation="20396" standardDeviationMircosecondsPerInvocation="4456"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.NoteDirectlyRelevantTypeQualifiers" totalMilliseconds="160" invocations="159" avgMicrosecondsPerInvocation="1010" maxMicrosecondsPerInvocation="15855" standardDeviationMircosecondsPerInvocation="2000"/>
<ClassProfile name="edu.umd.cs.findbugs.ba.obl.ObligationAnalysis" totalMilliseconds="164" invocations="447" avgMicrosecondsPerInvocation="369" maxMicrosecondsPerInvocation="6575" standardDeviationMircosecondsPerInvocation="639"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.ConstantDataflowFactory" totalMilliseconds="185" invocations="1268" avgMicrosecondsPerInvocation="146" maxMicrosecondsPerInvocation="2776" standardDeviationMircosecondsPerInvocation="244"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.MethodGenFactory" totalMilliseconds="189" invocations="1360" avgMicrosecondsPerInvocation="139" maxMicrosecondsPerInvocation="30907" standardDeviationMircosecondsPerInvocation="856"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindNullDerefsInvolvingNonShortCircuitEvaluation" totalMilliseconds="193" invocations="64" avgMicrosecondsPerInvocation="3028" maxMicrosecondsPerInvocation="178315" standardDeviationMircosecondsPerInvocation="22086"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.URLProblems" totalMilliseconds="224" invocations="64" avgMicrosecondsPerInvocation="3503" maxMicrosecondsPerInvocation="174969" standardDeviationMircosecondsPerInvocation="21632"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory" totalMilliseconds="255" invocations="1268" avgMicrosecondsPerInvocation="201" maxMicrosecondsPerInvocation="9257" standardDeviationMircosecondsPerInvocation="369"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.ClassInfoAnalysisEngine" totalMilliseconds="258" invocations="819" avgMicrosecondsPerInvocation="315" maxMicrosecondsPerInvocation="11229" standardDeviationMircosecondsPerInvocation="840"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FieldItemSummary" totalMilliseconds="293" invocations="159" avgMicrosecondsPerInvocation="1844" maxMicrosecondsPerInvocation="23120" standardDeviationMircosecondsPerInvocation="3301"/>
<ClassProfile name="edu.umd.cs.findbugs.OpcodeStack$JumpInfoFactory" totalMilliseconds="324" invocations="4560" avgMicrosecondsPerInvocation="71" maxMicrosecondsPerInvocation="2589" standardDeviationMircosecondsPerInvocation="131"/>
<ClassProfile name="edu.umd.cs.findbugs.detect.FindRefComparison$SpecialTypeAnalysis" totalMilliseconds="345" invocations="916" avgMicrosecondsPerInvocation="377" maxMicrosecondsPerInvocation="6276" standardDeviationMircosecondsPerInvocation="568"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory" totalMilliseconds="488" invocations="1271" avgMicrosecondsPerInvocation="384" maxMicrosecondsPerInvocation="16954" standardDeviationMircosecondsPerInvocation="759"/>
<ClassProfile name="edu.umd.cs.findbugs.ba.npe.NullDerefAndRedundantComparisonFinder" totalMilliseconds="496" invocations="1065" avgMicrosecondsPerInvocation="466" maxMicrosecondsPerInvocation="37192" standardDeviationMircosecondsPerInvocation="1442"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory" totalMilliseconds="562" invocations="1523" avgMicrosecondsPerInvocation="369" maxMicrosecondsPerInvocation="10377" standardDeviationMircosecondsPerInvocation="684"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.IsNullValueDataflowFactory" totalMilliseconds="573" invocations="1268" avgMicrosecondsPerInvocation="452" maxMicrosecondsPerInvocation="10290" standardDeviationMircosecondsPerInvocation="809"/>
<ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.UnconditionalValueDerefDataflowFactory" totalMilliseconds="659" invocations="1123" avgMicrosecondsPerInvocation="586" maxMicrosecondsPerInvocation="40507" standardDeviationMircosecondsPerInvocation="1915"/>
</FindBugsProfile>
</FindBugsSummary>
<ClassFeatures></ClassFeatures>
<History></History>
</BugCollection>
...@@ -4,5 +4,9 @@ ...@@ -4,5 +4,9 @@
<dependency org="junit" name="junit" rev="latest.release" /> <dependency org="junit" name="junit" rev="latest.release" />
<dependency org="hamcrest" name="hamcrest-all" rev="latest.release" /> <dependency org="hamcrest" name="hamcrest-all" rev="latest.release" />
<dependency org="mockito" name="mockito-all" rev="latest.release" /> <dependency org="mockito" name="mockito-all" rev="latest.release" />
<dependency org="jboss" name="javassist" rev="latest.release" />
<dependency org="powermock" name="powermock-mockito" rev="latest.release" />
<dependency org="logback" name="logback-classic" rev="latest.release" />
<dependency org="logback" name="logback-core" rev="latest.release" />
</dependencies> </dependencies>
</ivy-module> </ivy-module>
package ipaaca;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.EnumSet;
import java.util.Set;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.google.common.collect.ImmutableSet;
/**
* Test communication of the 'MESSAGE' type between IUs
* @author hvanwelbergen
*
*/
public class ComponentMessageCommunicationIntegrationTest
{
@BeforeClass
public static void setupStatic()
{
Initializer.initializeIpaacaRsb();
}
private OutputBuffer outBuffer;
private InputBuffer inBuffer;
private LocalMessageIU localIU;
private CountingEventHandler component1EventHandler;
private CountingEventHandler component2EventHandler;
private StoringEventHandler component1StoreHandler = new StoringEventHandler();
private StoringEventHandler component2StoreHandler = new StoringEventHandler();
private static final String CATEGORY = "category1";
@Before
public void setup()
{
outBuffer = new OutputBuffer("component1");
Set<String> categories = new ImmutableSet.Builder<String>().add(CATEGORY).build();
inBuffer = new InputBuffer("component2", categories);
EnumSet<IUEventType> types = EnumSet.of(IUEventType.ADDED, IUEventType.COMMITTED, IUEventType.UPDATED, IUEventType.MESSAGE);
component2EventHandler = new CountingEventHandler();
component1EventHandler = new CountingEventHandler();
inBuffer.registerHandler(new IUEventHandler(component2EventHandler, types, categories));
outBuffer.registerHandler(new IUEventHandler(component1EventHandler, types, categories));
inBuffer.registerHandler(new IUEventHandler(component2StoreHandler, types, categories));
outBuffer.registerHandler(new IUEventHandler(component1StoreHandler, types, categories));
localIU = new LocalMessageIU();
localIU.setCategory(CATEGORY);
localIU.getPayload().put("key1", "item1");
localIU.addLinks("INIT", ImmutableSet.of("init1", "init2"));
}
@After
public void tearDown()
{
inBuffer.close();
outBuffer.close();
}
@Test
public void testAddedIU() throws InterruptedException
{
outBuffer.add(localIU);
Thread.sleep(200);
AbstractIU iuIn = inBuffer.getIU(localIU.getUid());
assertNull(iuIn);
assertThat(localIU.getLinks("INIT"), containsInAnyOrder("init1", "init2"));
assertEquals(1, component2EventHandler.getNumberOfMessageEvents(localIU.getUid()));
assertEquals(0, component1EventHandler.getNumberOfMessageEvents(localIU.getUid()));
assertEquals(1, component2EventHandler.getNumberOfMessageEvents(localIU.getUid()));
assertEquals(0, component1EventHandler.getNumberOfMessageEvents(localIU.getUid()));
assertEquals(localIU.getUid(), component2StoreHandler.getMessageIUs().get(0).getUid());
}
@Test
public void testIUCommit() throws InterruptedException
{
outBuffer.add(localIU);
localIU.commit();
Thread.sleep(200);
assertEquals(0, component1EventHandler.getNumberOfCommitEvents(localIU.getUid()));
assertEquals(0, component2EventHandler.getNumberOfCommitEvents(localIU.getUid()));
assertFalse(component2StoreHandler.getMessageIUs().get(0).isCommitted());
}
@Test
public void testIUCommitBeforePublish() throws InterruptedException
{
localIU.commit();
outBuffer.add(localIU);
Thread.sleep(200);
assertEquals(0, component1EventHandler.getNumberOfCommitEvents(localIU.getUid()));
assertEquals(0, component2EventHandler.getNumberOfCommitEvents(localIU.getUid()));
assertTrue(component2StoreHandler.getMessageIUs().get(0).isCommitted());
}
@Test
public void testIUCommitFromInputBuffer() throws InterruptedException
{
outBuffer.add(localIU);
Thread.sleep(200);
AbstractIU iuIn = component2StoreHandler.getMessageIUs().get(0);
iuIn.commit();
Thread.sleep(200);
assertFalse(localIU.isCommitted());
assertEquals(0, component1EventHandler.getNumberOfCommitEvents(localIU.getUid()));
assertEquals(0, component2EventHandler.getNumberOfCommitEvents(localIU.getUid()));
}
@Test
public void testIUUpdate() throws InterruptedException
{
outBuffer.add(localIU);
Thread.sleep(200);
AbstractIU iuIn = component2StoreHandler.getMessageIUs().get(0);
assertNull(iuIn.getPayload().get("key2"));
localIU.getPayload().put("key2", "value2");
Thread.sleep(200);
assertEquals(null, iuIn.getPayload().get("key2"));
assertEquals(0, component2EventHandler.getNumberOfUpdateEvents(localIU.getUid()));
assertEquals(0, component1EventHandler.getNumberOfUpdateEvents(localIU.getUid()));
}
@Test
public void testIUUpdateBeforePublish() throws InterruptedException
{
localIU.getPayload().put("key2", "value2");
outBuffer.add(localIU);
Thread.sleep(200);
AbstractIU iuIn = component2StoreHandler.getMessageIUs().get(0);
assertEquals("value2", iuIn.getPayload().get("key2"));
}
private void fillBuffer(int val)
{
LocalMessageIU iu = new LocalMessageIU();
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < 1000000; i++)
{
buffer.append(val);
}
iu.setCategory("");
iu.getPayload().put("x", buffer.toString());
outBuffer.add(iu);
}
@Test
public void testManyMessages()
{
for (int i = 0; i < 1000; i++)
{
fillBuffer(i);
}
}
}
package ipaaca; package ipaaca;
import static org.junit.Assert.*; import static ipaaca.IUTestUtil.assertEqualIU;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import java.util.Set; import java.util.Set;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.*;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import static ipaaca.IUTestUtil.*;
/** /**
* Integration test cases for IPAACA. * Integration test cases for IPAACA.
* Requires a running spread daemon. * Requires a running spread daemon.
* @author hvanwelbergen * @author hvanwelbergen
* *
*/ */
public class ComponentCommunicationIntegrationTest public class ComponentPushCommunicationIntegrationTest
{ {
static @BeforeClass
public static void setupStatic()
{ {
Initializer.initializeIpaacaRsb(); Initializer.initializeIpaacaRsb();
} }
...@@ -33,66 +38,10 @@ public class ComponentCommunicationIntegrationTest ...@@ -33,66 +38,10 @@ public class ComponentCommunicationIntegrationTest
private OutputBuffer outBuffer; private OutputBuffer outBuffer;
private InputBuffer inBuffer; private InputBuffer inBuffer;
private LocalIU localIU; private LocalIU localIU;
private MyEventHandler component1EventHandler; private CountingEventHandler component1EventHandler;
private MyEventHandler component2EventHandler; private CountingEventHandler component2EventHandler;
private static final String CATEGORY = "category1"; private static final String CATEGORY = "category1";
private static final class MyEventHandler implements HandlerFunctor
{
private Map<String,Integer> commitEvents = new HashMap<String,Integer>();
private Map<String,Integer> addEvents = new HashMap<String,Integer>();
private Map<String,Integer> updateEvents = new HashMap<String,Integer>();
private void updateEventMap(String key, Map<String,Integer> map)
{
int value = 0;
if(map.containsKey(key))
{
value = map.get(key);
}
value++;
map.put(key, value);
}
@Override
public void handle(AbstractIU iu, IUEventType type, boolean local)
{
switch(type)
{
case ADDED: updateEventMap(iu.getUid(),addEvents); break;
case COMMITTED: updateEventMap(iu.getUid(),commitEvents); break;
case UPDATED: updateEventMap(iu.getUid(),updateEvents); break;
}
}
public int getNumberOfCommitEvents(String iu)
{
if(!commitEvents.containsKey(iu))
{
return 0;
}
return commitEvents.get(iu);
}
public int getNumberOfAddEvents(String iu)
{
if(!addEvents.containsKey(iu))
{
return 0;
}
return addEvents.get(iu);
}
public int getNumberOfUpdateEvents(String iu)
{
if(!updateEvents.containsKey(iu))
{
return 0;
}
return updateEvents.get(iu);
}
}
@Before @Before
public void setup() public void setup()
{ {
...@@ -101,8 +50,8 @@ public class ComponentCommunicationIntegrationTest ...@@ -101,8 +50,8 @@ public class ComponentCommunicationIntegrationTest
Set<String> categories = new ImmutableSet.Builder<String>().add(CATEGORY).build(); Set<String> categories = new ImmutableSet.Builder<String>().add(CATEGORY).build();
inBuffer = new InputBuffer("component2", categories); inBuffer = new InputBuffer("component2", categories);
EnumSet<IUEventType> types = EnumSet.of(IUEventType.ADDED,IUEventType.COMMITTED,IUEventType.UPDATED); EnumSet<IUEventType> types = EnumSet.of(IUEventType.ADDED,IUEventType.COMMITTED,IUEventType.UPDATED);
component2EventHandler = new MyEventHandler(); component2EventHandler = new CountingEventHandler();
component1EventHandler = new MyEventHandler(); component1EventHandler = new CountingEventHandler();
inBuffer.registerHandler(new IUEventHandler(component2EventHandler,types,categories)); inBuffer.registerHandler(new IUEventHandler(component2EventHandler,types,categories));
outBuffer.registerHandler(new IUEventHandler(component1EventHandler,types,categories)); outBuffer.registerHandler(new IUEventHandler(component1EventHandler,types,categories));
...@@ -222,6 +171,42 @@ public class ComponentCommunicationIntegrationTest ...@@ -222,6 +171,42 @@ public class ComponentCommunicationIntegrationTest
assertEquals(1,component1EventHandler.getNumberOfUpdateEvents(localIU.getUid())); assertEquals(1,component1EventHandler.getNumberOfUpdateEvents(localIU.getUid()));
} }
@Test
public void testSetAllPayload() throws InterruptedException
{
outBuffer.add(localIU);
Thread.sleep(200);
AbstractIU iuIn = inBuffer.getIU(localIU.getUid());
HashMap<String, String> payloadUpdate = new HashMap<String, String>();
payloadUpdate.put("chunk11", "item1");
payloadUpdate.put("chunk12", "item2");
payloadUpdate.put("chunk13", "item3");
payloadUpdate.put("chunk14", "item4");
long oldRev = iuIn.getRevision();
localIU.getPayload().merge(payloadUpdate);
Thread.sleep(200);
assertEquals(oldRev + 1, iuIn.getRevision());
assertTrue(iuIn.getPayload().containsKey("chunk11"));
assertTrue(iuIn.getPayload().containsKey("chunk12"));
assertTrue(iuIn.getPayload().containsKey("chunk13"));
assertTrue(iuIn.getPayload().containsKey("chunk14"));
HashMap<String, String> payloadUpdate2 = new HashMap<String, String>();
payloadUpdate2.put("chunk21", "item5");
payloadUpdate2.put("chunk22", "item6");
payloadUpdate2.put("chunk13", "item3-changed");
payloadUpdate2.put("chunk14", "item4-changed");
long oldRev2 = iuIn.getRevision();
iuIn.getPayload().merge(payloadUpdate2);
Thread.sleep(200);
assertEquals(oldRev2 + 1, localIU.getRevision());
assertTrue(localIU.getPayload().containsKey("chunk21"));
assertTrue(localIU.getPayload().containsKey("chunk22"));
assertEquals("item3-changed", localIU.getPayload().get("chunk13"));
assertEquals("item4-changed", localIU.getPayload().get("chunk14"));
}
@Test @Test
public void testIUUpdateFromInputBuffer() throws InterruptedException public void testIUUpdateFromInputBuffer() throws InterruptedException
{ {
...@@ -359,5 +344,30 @@ public class ComponentCommunicationIntegrationTest ...@@ -359,5 +344,30 @@ public class ComponentCommunicationIntegrationTest
assertThat(iuIn.getLinks("SAME_LEVEL"),containsInAnyOrder("iu7")); assertThat(iuIn.getLinks("SAME_LEVEL"),containsInAnyOrder("iu7"));
} }
@Test
public void testPublishLinks() throws InterruptedException
{
LocalIU localIU2 = new LocalIU();
localIU2.setCategory(CATEGORY);
localIU2.getPayload().put("key1", "item2");
localIU.addLinks("SAME_LEVEL", ImmutableSet.of(localIU2.getUid()));
outBuffer.add(localIU);
outBuffer.add(localIU2);
Thread.sleep(200);
assertThat(localIU.getLinks("SAME_LEVEL"),containsInAnyOrder(localIU2.getUid()));
}
@Test
public void testPublishLinksRemote() throws InterruptedException
{
LocalIU localIU2 = new LocalIU();
localIU2.setCategory(CATEGORY);
localIU2.getPayload().put("key1", "item2");
localIU.addLinks("SAME_LEVEL", ImmutableSet.of(localIU2.getUid()));
outBuffer.add(localIU);
outBuffer.add(localIU2);
Thread.sleep(200);
AbstractIU iuIn = inBuffer.getIU(localIU.getUid());
assertThat(iuIn.getLinks("SAME_LEVEL"),containsInAnyOrder(localIU2.getUid()));
}
} }
package ipaaca;
import java.util.HashMap;
import java.util.Map;
/**
* Counts how often and in what order certain events occur
* @author hvanwelbergen
*
*/
final class CountingEventHandler implements HandlerFunctor
{
private Map<String,Integer> messageEvents = new HashMap<String,Integer>();
private Map<String,Integer> commitEvents = new HashMap<String,Integer>();
private Map<String,Integer> addEvents = new HashMap<String,Integer>();
private Map<String,Integer> updateEvents = new HashMap<String,Integer>();
private void updateEventMap(String key, Map<String,Integer> map)
{
int value = 0;
if(map.containsKey(key))
{
value = map.get(key);
}
value++;
map.put(key, value);
}
@Override
public void handle(AbstractIU iu, IUEventType type, boolean local)
{
switch(type)
{
case ADDED: updateEventMap(iu.getUid(),addEvents); break;
case COMMITTED: updateEventMap(iu.getUid(),commitEvents); break;
case UPDATED: updateEventMap(iu.getUid(),updateEvents); break;
case MESSAGE: updateEventMap(iu.getUid(),messageEvents);break;
case DELETED:
break;
case LINKSUPDATED:
break;
case RETRACTED:
break;
default:
break;
}
}
public int getNumberOfCommitEvents(String iu)
{
if(!commitEvents.containsKey(iu))
{
return 0;
}
return commitEvents.get(iu);
}
public int getNumberOfAddEvents(String iu)
{
if(!addEvents.containsKey(iu))
{
return 0;
}
return addEvents.get(iu);
}
public int getNumberOfUpdateEvents(String iu)
{
if(!updateEvents.containsKey(iu))
{
return 0;
}
return updateEvents.get(iu);
}
public int getNumberOfMessageEvents(String iu)
{
if(!messageEvents.containsKey(iu))
{
return 0;
}
return messageEvents.get(iu);
}
}
\ No newline at end of file
...@@ -3,9 +3,9 @@ import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInA ...@@ -3,9 +3,9 @@ import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInA
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import ipaaca.Ipaaca.IU; import ipaaca.protobuf.Ipaaca.IU;
import ipaaca.Ipaaca.LinkSet; import ipaaca.protobuf.Ipaaca.LinkSet;
import ipaaca.Ipaaca.PayloadItem; import ipaaca.protobuf.Ipaaca.PayloadItem;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
......
package ipaaca; package ipaaca;
import static org.junit.Assert.*; import static org.junit.Assert.assertNotNull;
import java.util.Set; import java.util.Set;
...@@ -14,10 +14,15 @@ import rsb.RSBException; ...@@ -14,10 +14,15 @@ import rsb.RSBException;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/**
* Unit testcases for the input buffer
* @author hvanwelbergen
*
*/
public class InputBufferTest public class InputBufferTest
{ {
private static final String COMPID = "Comp1"; private static final String COMPID = "Comp1";
private static final String CATEGORY = "category1"; private static final String CATEGORY = "testcat";
private InputBuffer inBuffer; private InputBuffer inBuffer;
...@@ -42,14 +47,14 @@ public class InputBufferTest ...@@ -42,14 +47,14 @@ public class InputBufferTest
@Test @Test
public void testHandleRemotePushEvent() throws RSBException, InterruptedException public void testHandleRemotePushEvent() throws RSBException, InterruptedException
{ {
Informer<Object> informer = Factory.getInstance().createInformer("/ipaaca/category/"+CATEGORY); Informer<Object> informer = Factory.getInstance().createInformer("/ipaaca/channel/default/category/"+CATEGORY);
informer.activate(); informer.activate();
RemotePushIU iu = new RemotePushIU("uid1"); RemotePushIU iu = new RemotePushIU("uid1");
iu.setCategory("/ipaaca/category/"+CATEGORY); iu.setCategory("/ipaaca/channel/default/category/"+CATEGORY);
iu.setOwnerName("owner"); iu.setOwnerName("owner");
iu.setReadOnly(false); iu.setReadOnly(false);
iu.setRevision(1); iu.setRevision(1);
informer.send(iu); informer.publish(iu);
Thread.sleep(1000); Thread.sleep(1000);
AbstractIU iuIn = inBuffer.getIU("uid1"); AbstractIU iuIn = inBuffer.getIU("uid1");
......
package ipaaca; package ipaaca;
import static ipaaca.IUTestUtil.assertEqualIU;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import ipaaca.protobuf.Ipaaca;
import ipaaca.protobuf.Ipaaca.IU;
import ipaaca.protobuf.Ipaaca.IU.AccessMode;
import ipaaca.protobuf.Ipaaca.LinkSet;
import ipaaca.protobuf.Ipaaca.PayloadItem;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import ipaaca.Ipaaca;
import ipaaca.Ipaaca.IU;
import ipaaca.Ipaaca.IU.AccessMode;
import ipaaca.Ipaaca.LinkSet;
import ipaaca.Ipaaca.PayloadItem;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.mockito.Mockito.*;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import com.google.common.collect.ImmutableSet;
import com.google.protobuf.InvalidProtocolBufferException;
import rsb.converter.ConversionException; import rsb.converter.ConversionException;
import rsb.converter.ConverterSignature; import rsb.converter.ConverterSignature;
import rsb.converter.UserData; import rsb.converter.UserData;
import rsb.converter.WireContents; import rsb.converter.WireContents;
import rsb.patterns.RemoteServer; import rsb.patterns.RemoteServer;
import static ipaaca.IUTestUtil.*;
import com.google.common.collect.ImmutableSet;
import com.google.protobuf.InvalidProtocolBufferException;
/**
* Unit test cases for the IUConverter
* @author hvanwelbergen
*
*/
public class IuConverterTest public class IuConverterTest
{ {
private static final String CATEGORY = "category1"; private static final String CATEGORY = "category1";
...@@ -44,7 +52,7 @@ public class IuConverterTest ...@@ -44,7 +52,7 @@ public class IuConverterTest
@Test @Test
public void testSerialize() throws ConversionException, InvalidProtocolBufferException public void testSerializePushIU() throws ConversionException, InvalidProtocolBufferException
{ {
RemotePushIU rpIU = new RemotePushIU("iu1"); RemotePushIU rpIU = new RemotePushIU("iu1");
rpIU.setRevision(1); rpIU.setRevision(1);
...@@ -59,7 +67,28 @@ public class IuConverterTest ...@@ -59,7 +67,28 @@ public class IuConverterTest
WireContents<ByteBuffer> wiu = converter.serialize(RemotePushIU.class,rpIU); WireContents<ByteBuffer> wiu = converter.serialize(RemotePushIU.class,rpIU);
IU iu = IU.newBuilder().mergeFrom(wiu.getSerialization().array()).build(); IU iu = IU.newBuilder().mergeFrom(wiu.getSerialization().array()).build();
assertEqualIU(iu, rpIU); assertEqualIU(iu, rpIU);
assertEquals(IU.AccessMode.PUSH,iu.getAccessMode());
}
@Test
public void testSerializeMessageIU() throws ConversionException, InvalidProtocolBufferException
{
RemoteMessageIU rmIU = new RemoteMessageIU("iu1");
rmIU.setRevision(1);
rmIU.setOwnerName("owner");
rmIU.setCategory(CATEGORY);
rmIU.setBuffer(mockInputBuffer);
rmIU.getPayload().enforcedSetItem("key1", "value1");
rmIU.getPayload().enforcedSetItem("key2", "value2");
rmIU.getPayload().enforcedSetItem("key3", "value3");
rmIU.setLinksLocally("SAME_LEVEL",ImmutableSet.of("sibling1","sibling2"));
rmIU.setLinksLocally("GROUNDED_IN",ImmutableSet.of("parent1","parent2"));
WireContents<ByteBuffer> wiu = converter.serialize(RemoteMessageIU.class,rmIU);
IU iu = IU.newBuilder().mergeFrom(wiu.getSerialization().array()).build();
assertEqualIU(iu, rmIU);
assertEquals(IU.AccessMode.MESSAGE,iu.getAccessMode());
} }
public PayloadItem createPayloadItem(String key, String value) public PayloadItem createPayloadItem(String key, String value)
...@@ -71,8 +100,9 @@ public class IuConverterTest ...@@ -71,8 +100,9 @@ public class IuConverterTest
.build(); .build();
} }
@Test @Test
public void testDeSerialize() throws ConversionException public void testDeSerializePushIU() throws ConversionException
{ {
List<PayloadItem> payload = new ArrayList<PayloadItem>(); List<PayloadItem> payload = new ArrayList<PayloadItem>();
payload.add(createPayloadItem("key1","value1")); payload.add(createPayloadItem("key1","value1"));
...@@ -108,6 +138,47 @@ public class IuConverterTest ...@@ -108,6 +138,47 @@ public class IuConverterTest
assertThat(data.getData(), instanceOf(RemotePushIU.class)); assertThat(data.getData(), instanceOf(RemotePushIU.class));
RemotePushIU rpIU = (RemotePushIU) data.getData(); RemotePushIU rpIU = (RemotePushIU) data.getData();
assertEqualIU(iu, rpIU); assertEqualIU(iu, rpIU);
}
@Test
public void testDeSerializeMessageIU() throws ConversionException
{
List<PayloadItem> payload = new ArrayList<PayloadItem>();
payload.add(createPayloadItem("key1","value1"));
payload.add(createPayloadItem("key2","value2"));
payload.add(createPayloadItem("key3","value3"));
List<LinkSet> links = new ArrayList<LinkSet>();
links.add(
LinkSet.newBuilder()
.addAllTargets(ImmutableSet.of("sibling1","sibling2"))
.setType("SAME_LEVEL")
.build()
);
links.add(
LinkSet.newBuilder()
.addAllTargets(ImmutableSet.of("parent1","parent2"))
.setType("GROUNDED_IN")
.build()
);
Ipaaca.IU iu = Ipaaca.IU.newBuilder()
.setUid("uid1")
.setRevision(1)
.setCommitted(false)
.setOwnerName("owner")
.setAccessMode(AccessMode.MESSAGE)
.setReadOnly(false)
.setCategory(CATEGORY)
.addAllPayload(payload)
.addAllLinks(links)
.setPayloadType("")
.build();
UserData<?> data = converter.deserialize("", ByteBuffer.wrap(iu.toByteArray()));
assertThat(data.getData(), instanceOf(RemoteMessageIU.class));
RemoteMessageIU rpIU = (RemoteMessageIU) data.getData();
assertEqualIU(iu, rpIU);
} }
} }
package ipaaca; package ipaaca;
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.io.BufferedInputStream; import java.io.BufferedInputStream;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.EnumSet;
import java.util.Set; import java.util.Set;
import org.junit.Before; import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
/**
* Integration tests to test the connection between Python and Java Ipaaca modules.
* Requires a running spread daemon.
* @author hvanwelbergen
*
*/
public class JavaPythonTest public class JavaPythonTest
{ {
private StoringEventHandler storeHandler = new StoringEventHandler();
static
@BeforeClass
public static void setupStatic()
{ {
Initializer.initializeIpaacaRsb(); Initializer.initializeIpaacaRsb();
} }
...@@ -27,19 +39,20 @@ public class JavaPythonTest ...@@ -27,19 +39,20 @@ public class JavaPythonTest
private static final String PYTHON_PREAMBLE = "import sys\n" private static final String PYTHON_PREAMBLE = "import sys\n"
+ "sys.path.insert(0, '../python/build/')\n" + "sys.path.insert(0, '../python/build/')\n"
+ "sys.path.insert(0, '../python/lib/')\n" + "sys.path.insert(0, '../python/lib/')\n"
+ "sys.path.insert(0, '../../deps/python/')\n"
+ "import ipaaca, time\n"; + "import ipaaca, time\n";
@Before @Before
public void setup() public void setup()
{ {
Set<String> categories = new ImmutableSet.Builder<String>().add("JavaPythonTest").build(); Set<String> categories = new ImmutableSet.Builder<String>().add("JavaPythonTest").build();
inBuffer = new InputBuffer("javaside", categories); inBuffer = new InputBuffer("javaside", categories);
} }
private void printRuntimeErrors(Process p) throws IOException private String getRuntimeErrors(Process p) throws IOException
{ {
StringBuffer errors = new StringBuffer();
InputStream in = p.getInputStream(); InputStream in = p.getInputStream();
BufferedInputStream buf = new BufferedInputStream(in); BufferedInputStream buf = new BufferedInputStream(in);
InputStreamReader inread = new InputStreamReader(buf); InputStreamReader inread = new InputStreamReader(buf);
...@@ -55,12 +68,12 @@ public class JavaPythonTest ...@@ -55,12 +68,12 @@ public class JavaPythonTest
{ {
if (p.waitFor() != 0) if (p.waitFor() != 0)
{ {
System.err.println("exit value = " + p.exitValue()); errors.append("exit value = " + p.exitValue()+"\n");
} }
} }
catch (InterruptedException e) catch (InterruptedException e)
{ {
System.err.println(e); errors.append(e);
} }
in = p.getErrorStream(); in = p.getErrorStream();
...@@ -70,15 +83,15 @@ public class JavaPythonTest ...@@ -70,15 +83,15 @@ public class JavaPythonTest
// Read the ls output // Read the ls output
while ((line = bufferedreader.readLine()) != null) while ((line = bufferedreader.readLine()) != null)
{ {
System.out.println(line); errors.append(line);
} }
return errors.toString();
} }
private boolean runPythonProgram(String pypr) throws IOException private void runPythonProgram(String pypr) throws IOException
{ {
Process p = Runtime.getRuntime().exec(new String[] { "python", "-c", pypr }); Process p = Runtime.getRuntime().exec(new String[] { "python", "-c", pypr });
printRuntimeErrors(p); assertTrue(getRuntimeErrors(p), p.exitValue()==0);
return p.exitValue()==0;
} }
@Test @Test
...@@ -91,7 +104,7 @@ public class JavaPythonTest ...@@ -91,7 +104,7 @@ public class JavaPythonTest
+ "iu.payload = {'data':'Hello from Python!'}\n" + "iu.payload = {'data':'Hello from Python!'}\n"
+ "time.sleep(0.1)\n" + "time.sleep(0.1)\n"
+ "ob.add(iu)\n"; + "ob.add(iu)\n";
assertTrue(runPythonProgram(pypr)); runPythonProgram(pypr);
Thread.sleep(200); Thread.sleep(200);
assertEquals(1, inBuffer.getIUs().size()); assertEquals(1, inBuffer.getIUs().size());
...@@ -110,7 +123,7 @@ public class JavaPythonTest ...@@ -110,7 +123,7 @@ public class JavaPythonTest
+ "time.sleep(0.1)\n" + "time.sleep(0.1)\n"
+ "iu.payload = {'data':'Hello from Python!'}\n"; + "iu.payload = {'data':'Hello from Python!'}\n";
assertTrue(runPythonProgram(pypr)); runPythonProgram(pypr);
Thread.sleep(200); Thread.sleep(200);
assertEquals(1, inBuffer.getIUs().size()); assertEquals(1, inBuffer.getIUs().size());
...@@ -127,7 +140,7 @@ public class JavaPythonTest ...@@ -127,7 +140,7 @@ public class JavaPythonTest
+"iu.add_links('testtype',['dummy1','dummy2'])\n" +"iu.add_links('testtype',['dummy1','dummy2'])\n"
+ "time.sleep(0.1)\n" + "time.sleep(0.1)\n"
+ "ob.add(iu)\n"; + "ob.add(iu)\n";
assertTrue(runPythonProgram(pypr)); runPythonProgram(pypr);
Thread.sleep(200); Thread.sleep(200);
assertEquals(1, inBuffer.getIUs().size()); assertEquals(1, inBuffer.getIUs().size());
AbstractIU iu = inBuffer.getIUs().iterator().next(); AbstractIU iu = inBuffer.getIUs().iterator().next();
...@@ -145,7 +158,7 @@ public class JavaPythonTest ...@@ -145,7 +158,7 @@ public class JavaPythonTest
+ "time.sleep(0.1)\n" + "time.sleep(0.1)\n"
+"iu.add_links('testtype',['dummy1','dummy2'])\n"; +"iu.add_links('testtype',['dummy1','dummy2'])\n";
assertTrue(runPythonProgram(pypr)); runPythonProgram(pypr);
Thread.sleep(200); Thread.sleep(200);
assertEquals(1, inBuffer.getIUs().size()); assertEquals(1, inBuffer.getIUs().size());
AbstractIU iu = inBuffer.getIUs().iterator().next(); AbstractIU iu = inBuffer.getIUs().iterator().next();
...@@ -161,7 +174,7 @@ public class JavaPythonTest ...@@ -161,7 +174,7 @@ public class JavaPythonTest
+ "ob.add(iu)\n" + "ob.add(iu)\n"
+ "time.sleep(0.1)\n" + "time.sleep(0.1)\n"
+ "iu.commit()\n"; + "iu.commit()\n";
assertTrue(runPythonProgram(pypr)); runPythonProgram(pypr);
Thread.sleep(200); Thread.sleep(200);
assertEquals(1, inBuffer.getIUs().size()); assertEquals(1, inBuffer.getIUs().size());
AbstractIU iu = inBuffer.getIUs().iterator().next(); AbstractIU iu = inBuffer.getIUs().iterator().next();
...@@ -173,15 +186,31 @@ public class JavaPythonTest ...@@ -173,15 +186,31 @@ public class JavaPythonTest
{ {
String pypr = PYTHON_PREAMBLE String pypr = PYTHON_PREAMBLE
+"ob = ipaaca.OutputBuffer('pythonside')\n" +"ob = ipaaca.OutputBuffer('pythonside')\n"
+"iu = ipaaca.IU('JavaPythonTest')\n" +"iu = ipaaca.IU('JavaPythonTest')\n"
+"iu.commit()\n" +"iu.commit()\n"
+"time.sleep(0.1)\n" +"time.sleep(0.1)\n"
+"ob.add(iu)\n"; +"ob.add(iu)\n";
assertTrue(runPythonProgram(pypr)); runPythonProgram(pypr);
Thread.sleep(200); Thread.sleep(200);
assertEquals(1, inBuffer.getIUs().size()); assertEquals(1, inBuffer.getIUs().size());
AbstractIU iu = inBuffer.getIUs().iterator().next(); AbstractIU iu = inBuffer.getIUs().iterator().next();
assertTrue(iu.isCommitted()); assertTrue(iu.isCommitted());
} }
@Test
public void testMessageFromPython()throws IOException, InterruptedException
{
inBuffer.registerHandler(new IUEventHandler(storeHandler,EnumSet.of(IUEventType.ADDED, IUEventType.MESSAGE),ImmutableSet.of("JavaPythonTest")));
String pypr = PYTHON_PREAMBLE
+"ob = ipaaca.OutputBuffer('pythonside')\n"
+"iu = ipaaca.Message('JavaPythonTest')\n"
+"iu.payload = {'data':'Hello from Python!'}\n"
+"time.sleep(0.1)\n"
+"ob.add(iu)\n";
runPythonProgram(pypr);
Thread.sleep(200);
assertEquals(1,storeHandler.getMessageIUs().size());
assertEquals("Hello from Python!", storeHandler.getMessageIUs().get(0).getPayload().get("data"));
}
} }
package ipaaca; package ipaaca;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
import ipaaca.Ipaaca.IUPayloadUpdate; import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import ipaaca.protobuf.Ipaaca.IUPayloadUpdate;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import static org.mockito.Mockito.*; /**
* Unit testcases for the LocalIU
* @author hvanwelbergen
*/
public class LocalIUTest public class LocalIUTest
{ {
OutputBuffer mockBuffer = mock(OutputBuffer.class); OutputBuffer mockBuffer = mock(OutputBuffer.class);
...@@ -21,7 +30,7 @@ public class LocalIUTest ...@@ -21,7 +30,7 @@ public class LocalIUTest
@Test @Test
public void testCommit() public void testCommit()
{ {
LocalIU liu = new LocalIU("iu1"); LocalIU liu = new LocalIU();
liu.getPayload().put("key1", "item1"); liu.getPayload().put("key1", "item1");
liu.setBuffer(mockBuffer); liu.setBuffer(mockBuffer);
liu.commit("commitWriter"); liu.commit("commitWriter");
...@@ -33,7 +42,7 @@ public class LocalIUTest ...@@ -33,7 +42,7 @@ public class LocalIUTest
@Test @Test
public void testSetPayloadOnUnpublishedIU() public void testSetPayloadOnUnpublishedIU()
{ {
LocalIU liu = new LocalIU("iu1"); LocalIU liu = new LocalIU();
liu.getPayload().put("key1", "item1"); liu.getPayload().put("key1", "item1");
assertEquals("item1", liu.getPayload().get("key1")); assertEquals("item1", liu.getPayload().get("key1"));
} }
...@@ -41,7 +50,7 @@ public class LocalIUTest ...@@ -41,7 +50,7 @@ public class LocalIUTest
@Test @Test
public void testSetPayloadOnPublishedIU() public void testSetPayloadOnPublishedIU()
{ {
LocalIU liu = new LocalIU("iu1"); LocalIU liu = new LocalIU();
liu.setBuffer(mockBuffer); liu.setBuffer(mockBuffer);
liu.getPayload().put("key1", "item1"); liu.getPayload().put("key1", "item1");
assertEquals("item1", liu.getPayload().get("key1")); assertEquals("item1", liu.getPayload().get("key1"));
......
package ipaaca;
import java.util.ArrayList;
import java.util.List;
/**
* Stores ius for which add messages occured.
* @author hvanwelbergen
*
*/
public class StoringEventHandler implements HandlerFunctor
{
private List<AbstractIU> addedIUs = new ArrayList<AbstractIU>();
private List<AbstractIU> messageIUs = new ArrayList<AbstractIU>();
public List<AbstractIU> getAddedIUs()
{
return addedIUs;
}
public List<AbstractIU> getMessageIUs()
{
return messageIUs;
}
@Override
public void handle(AbstractIU iu, IUEventType type, boolean local)
{
switch (type)
{
case ADDED:
addedIUs.add(iu);
break;
case MESSAGE:
messageIUs.add(iu);
break;
case COMMITTED:
break;
case UPDATED:
break;
case DELETED:
break;
case LINKSUPDATED:
break;
case RETRACTED:
break;
default:
break;
}
}
}
package ipaaca.util;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import ipaaca.Initializer;
import org.junit.After;
import org.junit.Test;
import com.google.common.collect.ImmutableMap;
/**
* Integration tests for the blackboard
* @author hvanwelbergen
*/
public class BlackboardIntegrationTest
{
static
{
Initializer.initializeIpaacaRsb();
}
private Blackboard bb = new Blackboard("myblackboard","blackboardx");
private BlackboardClient bbc;
@After
public void after()
{
bb.close();
if(bbc!=null)
{
bbc.close();
}
}
@Test
public void testGetValueFromBlackboardBeforeConnection()
{
bb.put("key1","value1");
bbc = new BlackboardClient("myblackboardclient","blackboardx");
bbc.waitForBlackboardConnection();
assertEquals("value1", bbc.get("key1"));
}
@Test
public void testGetValueFromBlackboardAfterConnection() throws InterruptedException
{
bbc = new BlackboardClient("myblackboardclient","blackboardx");
bbc.waitForBlackboardConnection();
bb.put("key1","value1");
Thread.sleep(200);
assertEquals("value1", bbc.get("key1"));
}
@Test
public void testSetValueOnBlackboard() throws InterruptedException
{
bbc = new BlackboardClient("myblackboardclient","blackboardx");
bbc.waitForBlackboardConnection();
bbc.put("key2","value2");
Thread.sleep(300);
assertEquals("value2", bb.get("key2"));
}
@Test
public void testBlackboardUpdateHandler()throws InterruptedException
{
BlackboardUpdateListener mockListener = mock(BlackboardUpdateListener.class);
bb.addUpdateListener(mockListener);
bbc = new BlackboardClient("myblackboardclient","blackboardx");
bbc.waitForBlackboardConnection();
bbc.put("key2","value2");
Thread.sleep(200);
bb.put("key2","value3");
verify(mockListener,times(1)).update();
}
@Test
public void testBlackboardClientUpdateHandler() throws InterruptedException
{
BlackboardUpdateListener mockListener = mock(BlackboardUpdateListener.class);
bbc = new BlackboardClient("myblackboardclient","blackboardx");
bbc.waitForBlackboardConnection();
bbc.addUpdateListener(mockListener);
bb.put("key3","value3");
Thread.sleep(200);
bbc.put("key3","value4");
verify(mockListener,times(2)).update();
}
@Test
public void testSetManyValuesOnBlackboard() throws InterruptedException
{
bbc = new BlackboardClient("myblackboardclient","blackboardx");
bbc.waitForBlackboardConnection();
for(int i=0;i<100;i++)
{
bbc.put("key"+i,"value"+i);
bb.put("key"+i,"value"+i);
}
Thread.sleep(300);
assertEquals("value2", bb.get("key2"));
assertEquals("value3", bb.get("key3"));
}
@Test
public void testSetValuesOnClient() throws InterruptedException
{
bbc = new BlackboardClient("myblackboardclient","blackboardx");
bbc.waitForBlackboardConnection();
bbc.putAll(ImmutableMap.of("key1","value1","key2","value2"));
Thread.sleep(200);
assertEquals("value1", bb.get("key1"));
assertEquals("value2", bb.get("key2"));
}
@Test
public void testSetValuesOnBlackBoard() throws InterruptedException
{
bbc = new BlackboardClient("myblackboardclient","blackboardx");
bbc.waitForBlackboardConnection();
bb.putAll(ImmutableMap.of("key1","value1","key2","value2"));
Thread.sleep(200);
assertEquals("value1", bbc.get("key1"));
assertEquals("value2", bbc.get("key2"));
}
}
package ipaaca.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import ipaaca.AbstractIU;
import ipaaca.HandlerFunctor;
import ipaaca.IUEventType;
import ipaaca.Initializer;
import ipaaca.InputBuffer;
import ipaaca.LocalIU;
import ipaaca.OutputBuffer;
import java.util.Set;
import lombok.Getter;
import org.junit.After;
import org.junit.Test;
import com.google.common.collect.ImmutableSet;
/**
* Integration test for the ComponentNotifier, connects two of them. Requires a running spread daemon.
* @author hvanwelbergen
*
*/
public class ComponentNotifierIntegrationTest
{
private ComponentNotifier notifier1;
private ComponentNotifier notifier2;
private InputBuffer inBuffer;
private OutputBuffer outBuffer;
private static final String OTHER_CATEGORY="OTHER";
static
{
Initializer.initializeIpaacaRsb();
}
private class MyHandlerFunctor implements HandlerFunctor
{
@Getter
private volatile int numCalled = 0;
@Override
public void handle(AbstractIU iu, IUEventType type, boolean local)
{
numCalled++;
}
}
@After
public void after()
{
if (inBuffer != null)
{
inBuffer.close();
}
if (outBuffer != null)
{
outBuffer.close();
}
}
private ComponentNotifier setupCompNotifier(String id, Set<String> sendList, Set<String> recvList)
{
inBuffer = new InputBuffer(id + "in", ImmutableSet.of(ComponentNotifier.NOTIFY_CATEGORY));
outBuffer = new OutputBuffer(id + "out");
return new ComponentNotifier(id, "test", ImmutableSet.copyOf(sendList), ImmutableSet.copyOf(recvList), outBuffer, inBuffer);
}
private ComponentNotifier setupCompNotifierWithOtherCategoryInputBuffer(String id, Set<String> sendList, Set<String> recvList)
{
inBuffer = new InputBuffer(id + "in", ImmutableSet.of(ComponentNotifier.NOTIFY_CATEGORY, OTHER_CATEGORY));
outBuffer = new OutputBuffer(id + "out");
return new ComponentNotifier(id, "test", ImmutableSet.copyOf(sendList), ImmutableSet.copyOf(recvList), outBuffer, inBuffer);
}
@Test
public void testSelf() throws InterruptedException
{
notifier1 = setupCompNotifier("not1", ImmutableSet.of("a1", "b1"), ImmutableSet.of("a3", "b1"));
MyHandlerFunctor h1 = new MyHandlerFunctor();
notifier1.addNotificationHandler(h1);
notifier1.initialize();
Thread.sleep(500);
assertEquals(0, h1.getNumCalled());
}
@Test
public void testTwo() throws InterruptedException
{
notifier1 = setupCompNotifier("not1", ImmutableSet.of("a1", "b1"), ImmutableSet.of("a3", "b2"));
notifier2 = setupCompNotifier("not2", ImmutableSet.of("a2", "b2"), ImmutableSet.of("a3", "b1"));
MyHandlerFunctor h1 = new MyHandlerFunctor();
MyHandlerFunctor h2 = new MyHandlerFunctor();
notifier1.addNotificationHandler(h1);
notifier2.addNotificationHandler(h2);
notifier1.initialize();
Thread.sleep(500);
notifier2.initialize();
Thread.sleep(500);
assertEquals(1, h1.getNumCalled());
assertEquals(1, h2.getNumCalled());
}
@Test
public void testOtherCategoryInInputBuffer() throws InterruptedException
{
notifier1 = setupCompNotifierWithOtherCategoryInputBuffer("not1", ImmutableSet.of("a1", "b1"), ImmutableSet.of("a3", "b1"));
MyHandlerFunctor h1 = new MyHandlerFunctor();
notifier1.addNotificationHandler(h1);
OutputBuffer out = new OutputBuffer("out");
LocalIU iu = new LocalIU(OTHER_CATEGORY);
out.add(iu);
Thread.sleep(500);
assertEquals(0, h1.getNumCalled());
assertNotNull(inBuffer.getIU(iu.getUid()));
}
}