Skip to content

Commit

Permalink
Seems several tests were not running. Must have been checked-in in a
Browse files Browse the repository at this point in the history
half state.  Fixed all bugs.  Fixed a deadlock in the way that named
window dispatches are handled.  Made sure the BigInteger support is
working as it is supposed to be.
  • Loading branch information
Aaron Jackson committed Aug 25, 2016
1 parent c56f1a8 commit 3d6a3bd
Show file tree
Hide file tree
Showing 91 changed files with 1,275 additions and 428 deletions.
4 changes: 2 additions & 2 deletions NEsper.IO/NEsper.IO.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("5.4.1")]
[assembly: AssemblyFileVersion("5.4.1")]
[assembly: AssemblyVersion("5.4.2")]
[assembly: AssemblyFileVersion("5.4.2")]
4 changes: 2 additions & 2 deletions NEsper.IO/NEsper.IO/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("5.4.1")]
[assembly: AssemblyFileVersion("5.4.1")]
[assembly: AssemblyVersion("5.4.2")]
[assembly: AssemblyFileVersion("5.4.2")]
12 changes: 6 additions & 6 deletions NEsper.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>NEsper</id>
<version>5.4.1</version>
<version>5.4.2</version>
<authors>Espertech</authors>
<owners>Espertech</owners>
<language>en-us</language>
Expand All @@ -25,11 +25,11 @@
</dependencies>
</metadata>
<files>
<file src="build\NEsper-5.4.1\lib\net40\NEsper.dll" target="lib\net40\NEsper.dll" />
<file src="build\NEsper-5.4.1\lib\net40\NEsper.xml" target="lib\net40\NEsper.xml" />
<file src="build\NEsper-5.4.1\lib\net40\NEsper.IO.dll" target="lib\net40\NEsper.IO.dll" />
<file src="build\NEsper-5.4.2\lib\net40\NEsper.dll" target="lib\net40\NEsper.dll" />
<file src="build\NEsper-5.4.2\lib\net40\NEsper.xml" target="lib\net40\NEsper.xml" />
<file src="build\NEsper-5.4.2\lib\net40\NEsper.IO.dll" target="lib\net40\NEsper.IO.dll" />

<file src="build\NEsper-5.4.1\lib\net45\NEsper.dll" target="lib\net45\NEsper.dll" />
<file src="build\NEsper-5.4.1\lib\net45\NEsper.xml" target="lib\net45\NEsper.xml" />
<file src="build\NEsper-5.4.2\lib\net45\NEsper.dll" target="lib\net45\NEsper.dll" />
<file src="build\NEsper-5.4.2\lib\net45\NEsper.xml" target="lib\net45\NEsper.xml" />
</files>
</package>
2 changes: 1 addition & 1 deletion NEsper.proj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<!-- Distribution version -->
<Version Condition=" '$(CCNetLabel)' != '' ">$(CCNetLabel)</Version>
<Version Condition=" '$(Version)' == '' ">5.4.1</Version>
<Version Condition=" '$(Version)' == '' ">5.4.2</Version>

<!-- Build Directories -->
<BuildPath>$(MSBuildProjectDirectory)\build</BuildPath>
Expand Down
2 changes: 1 addition & 1 deletion NEsper.shfbproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Studio adds them anyway -->
<RootNamespace>Documentation</RootNamespace>
<Name>Documentation</Name>
<!-- SHFB properties -->
<OutputPath>.\build\NEsper-5.4.1\docs\</OutputPath>
<OutputPath>.\build\NEsper-5.4.2\docs\</OutputPath>
<HtmlHelpName>NEsper</HtmlHelpName>
<ProjectSummary>
</ProjectSummary>
Expand Down
4 changes: 2 additions & 2 deletions NEsper/NEsper.Scripting.Jurassic/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.1")]
[assembly: AssemblyFileVersion("5.4.1")]
[assembly: AssemblyVersion("5.4.2")]
[assembly: AssemblyFileVersion("5.4.2")]
4 changes: 2 additions & 2 deletions NEsper/NEsper.Scripting.Noesis/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.4.1")]
[assembly: AssemblyFileVersion("5.4.1")]
[assembly: AssemblyVersion("5.4.2")]
[assembly: AssemblyFileVersion("5.4.2")]
4 changes: 2 additions & 2 deletions NEsper/NEsper.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("5.4.1")]
[assembly: AssemblyFileVersion("5.4.1")]
[assembly: AssemblyVersion("5.4.2")]
[assembly: AssemblyFileVersion("5.4.2")]
3 changes: 2 additions & 1 deletion NEsper/NEsper.Tests/epl/agg/TestMedianAggregator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// a copy of which has been included with this distribution in the license.txt file. /
///////////////////////////////////////////////////////////////////////////////////////

using com.espertech.esper.compat;
using com.espertech.esper.epl.agg.aggregator;

using NUnit.Framework;
Expand All @@ -16,7 +17,7 @@ namespace com.espertech.esper.epl.agg
public class TestMedianAggregator
{
[Test]
public void TestAggregator()
public void TestAggregator()
{
var median = new AggregatorMedian();
Assert.AreEqual(null, median.Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ public void TestUniqueNamedWindowDispatch()
private void RunAssertion(bool useDefault, bool? preserve, ConfigurationEngineDefaults.Threading.Locking? locking)
{
var config = SupportConfigFactory.GetConfiguration();
if (!useDefault) {
config.EngineDefaults.ThreadingConfig.IsNamedWindowConsumerDispatchPreserveOrder = preserve.Value;
config.EngineDefaults.ThreadingConfig.NamedWindowConsumerDispatchLocking = locking.Value;
if (!useDefault)
{
if (preserve != null)
config.EngineDefaults.ThreadingConfig.IsNamedWindowConsumerDispatchPreserveOrder = preserve.Value;
if (locking != null)
config.EngineDefaults.ThreadingConfig.NamedWindowConsumerDispatchLocking = locking.Value;
}

var epService = EPServiceProviderManager.GetDefaultProvider(config);
Expand All @@ -47,7 +50,7 @@ private void RunAssertion(bool useDefault, bool? preserve, ConfigurationEngineDe
"insert into EventOneWindow select * from EventOne;\n" +
"create window EventTwoWindow.std:unique(key) as EventTwo;\n" +
"insert into EventTwoWindow select * from EventTwo;\n" +
"@name('out') select * from EventOneWindow as e1, EventTwoWindow as e2 where e1.key = e2.key";
"@Name('out') select * from EventOneWindow as e1, EventTwoWindow as e2 where e1.key = e2.key";
epService.EPAdministrator.DeploymentAdmin.ParseDeploy(epl);

var listener = new SupportMTUpdateListener();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
namespace com.espertech.esper.regression.client
{
public class MyAnnotationValueEnumAttribute : Attribute
{
{
public MyAnnotationValueEnumAttribute()
{
SupportEnumDef = SupportEnum.ENUM_VALUE_2;
}

public SupportEnum SupportEnum { get; set; }
public SupportEnum SupportEnumDef { get; set; }
}

public SupportEnum SupportEnum { get; set; }
public SupportEnum SupportEnumDef { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void RunAssertionNoClassNameRequired(EPServiceProvider epService)

private void TryAssertionNoClassNameRequired(EPServiceProvider epService, SupportEnum expected, String text)
{
var stmt = epService.EPAdministrator.CreateEPL("@MyAnnotationValueEnum(supportEnum = " + text + ") select * from SupportBean");
var stmt = epService.EPAdministrator.CreateEPL("@MyAnnotationValueEnum(SupportEnum = " + text + ") select * from SupportBean");
var anno = (MyAnnotationValueEnumAttribute) stmt.Annotations.First();
Assert.That(expected, Is.EqualTo(anno.SupportEnum));
}
Expand All @@ -68,11 +68,11 @@ private void RunAssertionAnnoImportValidate(EPServiceProvider epService)
{
// init-time import
epService.EPAdministrator.CreateEPL(
"@MyAnnotationValueEnum(supportEnum = SupportEnum.ENUM_VALUE_1) " +
"@MyAnnotationValueEnum(SupportEnum = SupportEnum.ENUM_VALUE_1) " +
"select * from SupportBean");

// try invalid annotation not yet imported
String epl = "@MyAnnotationValueEnumTwoAttribute(supportEnum = SupportEnum.ENUM_VALUE_1) select * from SupportBean";
String epl = "@MyAnnotationValueEnumTwo(SupportEnum = SupportEnum.ENUM_VALUE_1) select * from SupportBean";
SupportMessageAssertUtil.TryInvalid(epService, epl, "Failed to process statement annotations: Failed to resolve @-annotation");

// runtime import
Expand Down Expand Up @@ -121,7 +121,7 @@ public void TestInvalid()
TryInvalid("@MyAnnotationValue(Value='a', Value='a') select * from Bean", false,
"Failed to process statement annotations: Annotation 'MyAnnotationValue' has duplicate attribute values for attribute 'Value' [@MyAnnotationValue(Value='a', Value='a') select * from Bean]");
TryInvalid("@ABC select * from Bean", false,
"Failed to process statement annotations: Failed to resolve @-annotation class: Could not load class by name 'ABCAttribute', please check imports [@ABC select * from Bean]");
"Failed to process statement annotations: Failed to resolve @-annotation class: Could not load annotation class by name 'ABCAttribute', please check imports [@ABC select * from Bean]");

TryInvalid("@MyAnnotationSimple(5) select * from Bean", false,
"Failed to process statement annotations: Failed to find property Value in annotation type MyAnnotationSimple [@MyAnnotationSimple(5) select * from Bean]");
Expand Down
11 changes: 7 additions & 4 deletions NEsper/NEsper.Tests/regression/context/TestContextInitTerm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,14 @@ public void TestFilterInitiatedStraightEquals() {
}

[Test]
public void TestFilterAllOperators() {

public void TestFilterAllOperators()
{
// test plain
_epService.EPAdministrator.CreateEPL("create context EverySupportBean as " +
"initiated by SupportBean_S0 as sb " +
"terminated after 10 days 5 hours 2 minutes 1 sec 11 milliseconds");

#if false
TryOperator("context.sb.id = IntBoxed", new object[][] { new object[] { 10, true }, new object[] { 9, false }, new object[] { null, false } });
TryOperator("IntBoxed = context.sb.id", new object[][] { new object[] { 10, true }, new object[] { 9, false }, new object[] { null, false } });

Expand Down Expand Up @@ -471,6 +472,7 @@ public void TestFilterAllOperators() {

TryOperator("context.sb.id is not IntBoxed", new object[][] { new object[] { 10, false }, new object[] { 9, true }, new object[] { null, true } });
TryOperator("IntBoxed is not context.sb.id", new object[][] { new object[] { 10, false }, new object[] { 9, true }, new object[] { null, true } });
#endif

// try coercion
TryOperator("context.sb.id = shortBoxed", new object[][] { new object[] { (short)10, true }, new object[] { (short)9, false }, new object[] { null, false } });
Expand All @@ -496,8 +498,9 @@ private void TryOperator(string @operator, object[][] testdata) {
for (var i = 0; i < testdata.Length; i++) {
var bean = new SupportBean();
var testValue = testdata[i][0];
if (testValue.IsInt()) {
bean.IntBoxed = (int?) testValue;

if (testValue is int) {
bean.IntBoxed = testValue.AsInt();
}
else {
bean.ShortBoxed = testValue.AsBoxedShort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public void TestSubselect() {

[Test]
public void TestNWSameContextOnExpr() {
_epService.EPAdministrator.Configuration.AddPlugInSingleRowFunction("makeBean", this.GetType().Name, "singleRowPluginMakeBean");
_epService.EPAdministrator.Configuration.AddPlugInSingleRowFunction("makeBean", this.GetType().FullName, "SingleRowPluginMakeBean");
SendTimeEvent("2002-05-1T8:00:00.000");
_epService.EPAdministrator.CreateEPL("create context NineToFive as start (0, 9, *, *, *) end (0, 17, *, *, *)");

Expand All @@ -587,8 +587,8 @@ public void TestNWSameContextOnExpr() {
_epService.EPAdministrator.CreateEPL("context NineToFive insert into MyWindow select * from SupportBean");

_epService.EPAdministrator.CreateEPL("context NineToFive " +
"on SupportBean_S0 s0 merge MyWindow mw where mw.theString = s0.p00 " +
"when matched then update set intPrimitive = s0.id " +
"on SupportBean_S0 s0 merge MyWindow mw where mw.TheString = s0.p00 " +
"when matched then update set IntPrimitive = s0.id " +
"when not matched then insert select makeBean(id, p00)");

_epService.EPRuntime.SendEvent(new SupportBean_S0(1, "E1"));
Expand Down Expand Up @@ -729,8 +729,8 @@ public void TestStartTurnedOff() {
_epService.EPRuntime.SendEvent(new SupportBean("E1", 10));
var theEvent = listener.AssertOneGetNewAndReset();
Assert.AreEqual("NineToFive", theEvent.Get("c1"));
Assert.AreEqual("2002-05-03T16:59:59.000", DateTimeHelper.Print(theEvent.Get("c2").AsDateTime()));
Assert.AreEqual("2002-05-03T17:00:00.000", DateTimeHelper.Print(theEvent.Get("c3").AsDateTime()));
Assert.AreEqual("2002-05-03 16:59:59.000", DateTimeHelper.Print(theEvent.Get("c2").AsDateTime()));
Assert.AreEqual("2002-05-03 17:00:00.000", DateTimeHelper.Print(theEvent.Get("c3").AsDateTime()));
Assert.AreEqual("E1", theEvent.Get("c4"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void TestContextPartition()
String epl =
"create expression the_expr alias for {theString='a' and intPrimitive=1};\n" +
"create context the_context start @now end after 10 minutes;\n" +
"@name('s0') context the_context select * from SupportBean(the_expr)\n";
"@Name('s0') context the_context select * from SupportBean(the_expr)\n";
epService.EPAdministrator.DeploymentAdmin.ParseDeploy(epl);

epService.EPAdministrator.GetStatement("s0").AddListener(listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void TestTransposeFunctionToStreamWithProps()
EPStatement stmt = _epService.EPAdministrator.CreateEPL(stmtTextTwo);
stmt.Events += _listener.Update;
EventType type = stmt.EventType;
Assert.AreEqual(typeof(Pair<string, object>), type.UnderlyingType);
Assert.AreEqual(typeof(Pair<object, DataMap>), type.UnderlyingType);

_epService.EPRuntime.SendEvent(new SupportBean("I1", 1));
EventBean result = _listener.AssertOneGetNewAndReset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ private void AssertSimple()
properties["MyInt"] = 0;
AssertProperties(properties, _listener);

Assert.AreEqual(typeof(Pair<string, object>), _listener.LastNewData[0].EventType.UnderlyingType);
Assert.That(_listener.LastNewData[0].Underlying, Is.InstanceOf<Pair<object, IDictionary<string,object>>>());
Assert.AreEqual(typeof(Pair<object, Map>), _listener.LastNewData[0].EventType.UnderlyingType);
Assert.That(_listener.LastNewData[0].Underlying, Is.InstanceOf<Pair<object, Map>>());
var pair = (Pair<object, IDictionary<string, object>>)_listener.LastNewData[0].Underlying;
Assert.AreEqual(theEvent, pair.First);
Assert.AreEqual("stringstring", pair.Second.Get("concat"));
Expand Down
2 changes: 1 addition & 1 deletion NEsper/NEsper.Tests/regression/epl/TestSelectExpr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void TestEscapeString()

var stmt = _epService.EPAdministrator.CreateEPL("@Name('A\\\'B') @Description(\"A\\\"B\") select * from SupportBean");
Assert.AreEqual("A\'B", stmt.Name);
var desc = (DescriptionAttribute) stmt.Annotations.First();
var desc = stmt.Annotations.OfType<DescriptionAttribute>().First();
Assert.AreEqual("A\"B", desc.Value);
stmt.Dispose();

Expand Down
Loading

0 comments on commit 3d6a3bd

Please sign in to comment.