pdxcodemonkey commented on a change in pull request #823:
URL: https://github.com/apache/geode-native/pull/823#discussion_r659917215
##########
File path: netcore/NetCore/NetCore.csproj
##########
@@ -0,0 +1,10 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>netcoreapp3.1</TargetFramework>
+ <RootNamespace>Apache.Geode.NetCore</RootNamespace>
+ <AssemblyName>Apache.Geode.NetCore</AssemblyName>
+ <Platforms>AnyCPU;x64</Platforms>
Review comment:
Fixed.
##########
File path: netcore/NetCore/Constants.cs
##########
@@ -0,0 +1,30 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+namespace Apache
+{
+ namespace Geode
+ {
+ namespace NetCore
+ {
+
+ public class Constants
+ {
+ public const string libPath = "apache-geode-c";
Review comment:
Handy (and probably necessary) feature :).
##########
File path: netcore/NetCore.Test/CacheFactoryUnitTest.cs
##########
@@ -0,0 +1,97 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+using System;
+using Apache.Geode.NetCore;
Review comment:
I've been leaning that way too. It will make porting ever-so-slightly
easier, if nothing else.
##########
File path: netcore/NetCore.Test/CacheFactoryUnitTest.cs
##########
@@ -0,0 +1,97 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+using System;
+using Apache.Geode.NetCore;
+using Xunit;
+
+namespace GemfireDotNetTest
+{
+ [Collection("Geode .net Core Collection")]
+ public class CacheFactoryUnitTests
+ {
Review comment:
Works for me, though it does lend more urgency to the task to find a
!@#$)*(&!@^$ version of `clang-format` that's consistent across platforms.
##########
File path: netcore/NetCore.Test/CacheFactoryUnitTest.cs
##########
@@ -0,0 +1,97 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements. See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+using System;
+using Apache.Geode.NetCore;
+using Xunit;
+
+namespace GemfireDotNetTest
+{
+ [Collection("Geode .net Core Collection")]
+ public class CacheFactoryUnitTests
+ {
+ [Fact]
+ public void TestCreateFactory()
+ {
+ using (var cacheFactory = CacheFactory.Create())
+ {
+ Assert.NotNull(cacheFactory);
+ }
+ }
+
+ [Fact]
+ public void TestCacheFactoryGetVersion()
+ {
+ using (var cacheFactory = CacheFactory.Create())
+ {
+ var version = cacheFactory.Version;
+ Assert.NotEqual(version, String.Empty);
+ }
+ }
+
+ [Fact]
+ public void TestCacheFactoryGetProductDescription()
+ {
+ using (var cacheFactory = CacheFactory.Create())
+ {
+ var description = cacheFactory.ProductDescription;
+ Assert.NotEqual(description, String.Empty);
+ }
+ }
+
+ [Fact]
+ public void TestCacheFactorySetPdxIgnoreUnreadFields()
+ {
+ using (var cacheFactory = CacheFactory.Create())
+ {
+ cacheFactory.PdxIgnoreUnreadFields = true;
+ cacheFactory.PdxIgnoreUnreadFields = false;
+ }
+ }
+
+ [Fact]
+ public void TestCacheFactorySetPdxReadSerialized()
+ {
+ using (var cacheFactory = CacheFactory.Create())
+ {
+ cacheFactory.PdxReadSerialized = true;
+ cacheFactory.PdxReadSerialized = false;
+ }
+ }
+
+ [Fact]
+ public void TestCacheFactoryCreateCache()
+ {
+ using (var cacheFactory = CacheFactory.Create())
+ {
+ using (var cache = cacheFactory.CreateCache()) // lgtm[cs /
useless - assignment - to - local]
+ {
+ ;
+ }
+ }
+ }
+
+ [Fact]
+ public void TestCacheFactorySetProperty()
+ {
+ using (var cacheFactory = CacheFactory.Create())
+ {
+ cacheFactory.SetProperty("log-level", "none")
+ .SetProperty("log-file", "geode_native.log");
+ }
+ }
+ }
+}
Review comment:
So much better if I can just rely on a formatter to fix stuff like this
for me :).
##########
File path: netcore/geode-dotnet-core.sln
##########
@@ -0,0 +1,31 @@
+
Review comment:
cmake can't, as far as we can tell, generate the "new, improved" .sln
and .csproj files to target .net core. Quite a bit of online chatter about it,
but nothing conclusive, and our investigation of it has not yielded any working
solution. Since the new files are _insanely_ simple, we decided not to spend
further cycles on it.
##########
File path: netcore/geode-dotnet-core.sln
##########
@@ -0,0 +1,31 @@
+
Review comment:
Yeah, it's weird, esp given that the new format is so darned simplified.
What we know so far about the new solution/project format:
* Mac and Linux platforms can be a little "grumpy" about the ones created in
VS2019, though they ostensibly read em. We haven't characterized the issue(s)
yet, but for right now I would avoid messing with project files in VS2019.
* VS2019, JetBrains Rider, and VS Code can read, build, and test with them,
on all platforms
* The preferred way to edit them appears to be `dotnet` command from the
command line. This is actually awesome.
##########
File path: netcore/geode-dotnet-core.sln
##########
@@ -0,0 +1,31 @@
+
Review comment:
Sorry, forgot to answer your question: Yes, you should be able to build
and run tests on Mac without any IDE, just an install of the .net 5.0 SDK.
I'm working on a BUILDING.md for .net core, but the short version is:
* Install .net 5.0 SDK and set up PATH to tools
* From $GeodeNative_ROOT/netcore:
`dotnet build`
`startserver.sh`
`dotnet test`
`stopserver.sh`
##########
File path: netcore/utility/SimpleSecurityManager.java
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javaobject;
+
+import org.apache.geode.security.AuthenticationFailedException;
+import org.apache.geode.security.SecurityManager;
+
+import java.util.Properties;
+
+import javaobject.UserPasswordAuthInit;
+import javaobject.UsernamePrincipal;
+
+/**
+ * This Security manager only Authenticates - and allows any operations.
+ */
+public class SimpleSecurityManager implements SecurityManager {
Review comment:
Copied this from the main repo, because the earlier procedure was clumsy:
* Build NC
* Build installer
* Build examples (this builds the .jar file)
* set environment variable to root of the example build, so that
`startserver.sh/startserver.ps1` can set CLASSPATH in `gfsh` command
I'm open to suggestions for improvement, but not a fan of tying .net core
build to the main build, especially not (ugh!) the examples.
##########
File path: netcore/utility/UserPasswordAuthInit.java
##########
@@ -0,0 +1,81 @@
+/*
Review comment:
Will look into this. I just copied in the minimal amount to build the
existing fake `SecurityManager` class without editing Java code. We're
probably just being lazy in the Java code and referring to something we
shouldn't be. May want to fix this in the main tree as well, same for the
required `cmake` version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]