Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
SessionStateCache tests pass with latest C bindings changes
  • Loading branch information
Blake Bender committed May 28, 2021
1 parent abda656 commit 65ab67f73b797099f3f4a22cdd7e5b2ea18cbd28
Showing 11 changed files with 174 additions and 216 deletions.
@@ -321,10 +321,9 @@ private void Connect()
}

_connectLock.Wait();
RegionFactory regionFactory = null;
try
{
regionFactory = _cache.CreateRegionFactory(RegionShortcut.Proxy);
using var regionFactory = _cache.CreateRegionFactory(RegionShortcut.Proxy);
try
{
_logger?.LogTrace("Create CacheRegion");
@@ -16,7 +16,7 @@ public void TestCreateFactory()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
Assert.IsNotNull(cacheFactory);
}
@@ -28,7 +28,7 @@ public void TestCacheFactoryGetVersion()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
var version = cacheFactory.Version;
Assert.AreNotEqual(version, String.Empty);
@@ -43,7 +43,7 @@ public void TestCacheFactoryGetProductDescription()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
var description = cacheFactory.ProductDescription;
Assert.AreNotEqual(description, String.Empty);
@@ -58,7 +58,7 @@ public void TestCacheFactorySetPdxIgnoreUnreadFields()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
cacheFactory.PdxIgnoreUnreadFields = true;
cacheFactory.PdxIgnoreUnreadFields = false;
@@ -73,7 +73,7 @@ public void TestCacheFactorySetPdxReadSerialized()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
cacheFactory.PdxReadSerialized = true;
cacheFactory.PdxReadSerialized = false;
@@ -88,7 +88,7 @@ public void TestCacheFactoryCreateCache()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
using (var cache = cacheFactory.CreateCache())
{
@@ -105,7 +105,7 @@ public void TestCacheFactorySetProperty()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
cacheFactory.SetProperty("log-level", "none")
.SetProperty("log-file", "geode_native.log");
@@ -17,7 +17,7 @@ public void TestClientCacheGetPdxReadSerialized()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "debug")
.SetProperty("log-file", "TestClientCacheGetPdxReadSerialized.log"))
{
@@ -51,7 +51,7 @@ public void TestClientCacheGetPdxIgnoreUnreadFields()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none")
.SetProperty("log-file", "geode_native.log"))
{
@@ -77,7 +77,7 @@ public void TestClientCacheGetPoolManager()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none")
.SetProperty("log-file", "geode_native.log"))
{
@@ -98,7 +98,7 @@ public void TestClientCacheCreateRegionFactory()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none")
.SetProperty("log-file", "geode_native.log"))
{
@@ -121,7 +121,7 @@ public void TestClientCacheGetName()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none"))
{
cacheFactory.PdxIgnoreUnreadFields = true;
@@ -141,7 +141,7 @@ public void TestClientCacheClose()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none"))
{
cacheFactory.PdxIgnoreUnreadFields = true;
@@ -162,7 +162,7 @@ public void TestClientCacheCloseWithKeepalive()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none"))
{
cacheFactory.PdxIgnoreUnreadFields = true;
@@ -16,7 +16,7 @@ public void TestLeakCacheFactory()
{
var client = new Client();

using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
Assert.Throws<InvalidOperationException>(() => client.Dispose());
}
@@ -16,7 +16,7 @@ public void TestPoolFactoryAddLocator()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none")
.SetProperty("log-file", "geode_native.log"))
{
@@ -40,7 +40,7 @@ public void TestPoolFactoryCreatePool()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none")
.SetProperty("log-file", "geode_native.log"))
{
@@ -68,7 +68,7 @@ public void TestCreatePoolWithoutPoolManager()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
using (var cache = cacheFactory.CreateCache())
{
@@ -16,7 +16,7 @@ public void TestPoolManagerCreatePoolFactory()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client))
using (var cacheFactory = CacheFactory.Create())
{
using (var cache = cacheFactory.CreateCache())
{
@@ -92,7 +92,7 @@ public void TestRegionFactoryCreateProxyRegion()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "none")
.SetProperty("log-file", "geode_native.log"))
{
@@ -111,7 +111,7 @@ public void TestRegionFactoryCreateRegionWithAuthentication()
{
using (var client = new Client())
{
using (var cacheFactory = CacheFactory.Create(client)
using (var cacheFactory = CacheFactory.Create()
.SetProperty("log-level", "debug")
.SetProperty("log-file", "geode_native_with_auth.log"))
{
@@ -14,7 +14,7 @@ public class CacheFactory : GeodeNativeObject, ICacheFactory
private IAuthInitialize _authInitialize;

[DllImport(Constants.libPath, CharSet = CharSet.Auto)]
private static extern IntPtr apache_geode_CreateCacheFactory(IntPtr client);
private static extern IntPtr apache_geode_CreateCacheFactory();

[DllImport(Constants.libPath, CharSet = CharSet.Auto)]
private static extern void apache_geode_DestroyCacheFactory(IntPtr factory);
@@ -35,14 +35,14 @@ public class CacheFactory : GeodeNativeObject, ICacheFactory
[DllImport(Constants.libPath, CharSet = CharSet.Auto)]
private static extern void apache_geode_CacheFactory_SetProperty(IntPtr factory, IntPtr key, IntPtr value);

public static ICacheFactory Create(Client client)
public static ICacheFactory Create()
{
return new CacheFactory(client);
return new CacheFactory();
}

public CacheFactory(GeodeNativeObject client)
public CacheFactory()
{
_containedObject = apache_geode_CreateCacheFactory(client.ContainedObject);
_containedObject = apache_geode_CreateCacheFactory();
}

public string Version
@@ -7,9 +7,9 @@ namespace NetCore

public class Constants
{
public const string libPath =
//"/Users/matthewreddington/workspace/apache/geode-native/cppcache/shared/libapache-geode.dylib";
"c:/geode-native-dotnetcore/build/c_bindings/Debug/apache-geode-c.dll";
public const string libPath =
//"/Users/matthewreddington/workspace/apache/geode-native/cppcache/shared/libapache-geode.dylib";
"c:/Users/bblake/src/nc_install/bin/apache-geode-c.dll";
}
}
}

0 comments on commit 65ab67f

Please sign in to comment.