Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial commit for testrunner4iFixPlus #31

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
16 changes: 13 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
<version>2.12.6</version>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.6</version>
<groupId>org.xmlunit</groupId>
ChopinLi-cp marked this conversation as resolved.
Show resolved Hide resolved
<artifactId>xmlunit-core</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>edu.illinois.cs</groupId>
Expand All @@ -98,6 +98,16 @@
<artifactId>junit-platform-launcher</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.5.0-SNAPSHOT</version>
ChopinLi-cp marked this conversation as resolved.
Show resolved Hide resolved
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.11.2</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
2 changes: 2 additions & 0 deletions testrunner-running/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0
Premain-Class: edu.illinois.cs.statecapture.agent.MainAgent
26 changes: 24 additions & 2 deletions testrunner-running/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,21 @@
<artifactId>scala-library</artifactId>
</dependency>
<dependency>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -118,6 +126,20 @@
<include>**/*Test.*</include>
<include>**/*Suite.*</include>
</includes>
<argLine>-Xmx4096m</argLine>
ChopinLi-cp marked this conversation as resolved.
Show resolved Hide resolved
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<!--<manifest>
ChopinLi-cp marked this conversation as resolved.
Show resolved Hide resolved
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>-->
<manifestFile>MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package edu.illinois.cs.statecapture;

import com.thoughtworks.xstream.converters.collections.MapConverter;
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.io.ExtendedHierarchicalStreamWriterHelper;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.mapper.Mapper;

import java.util.Iterator;
import java.util.Map;

public class CustomMapConverter extends MapConverter {

public CustomMapConverter(Mapper mapper) {
super(mapper);
}

// Logic mostly copied from writeItem
protected void writeItemWithName(String name, Object item, MarshallingContext context, HierarchicalStreamWriter writer) {
if (item == null) {
writeNullItem(context, writer);
} else {
String clazz = mapper().serializedClass(item.getClass());
ExtendedHierarchicalStreamWriterHelper.startNode(writer, name, item.getClass());
writer.addAttribute("class", clazz); // Map the class as an attribute to the node
writeBareItem(item, context, writer);
writer.endNode();
}
}

@Override
public void marshal(final Object source, final HierarchicalStreamWriter writer, final MarshallingContext context) {
Map map = (Map) source;
String entryName = mapper().serializedClass(Map.Entry.class);
for (Iterator iterator = map.entrySet().iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
ExtendedHierarchicalStreamWriterHelper.startNode(writer, entryName, entry.getClass());

// Give consistent name to elements (their types will be encoded as attribute)
writeItemWithName("key", entry.getKey(), context, writer);
writeItemWithName("value", entry.getValue(), context, writer);

writer.endNode();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package edu.illinois.cs.statecapture;

public interface IStateCapture {

public void runCapture();
ChopinLi-cp marked this conversation as resolved.
Show resolved Hide resolved
}
Loading