Skip to content
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
15e64ae
IGNITE-10075: Test to reproduce issue
nizhikov Nov 29, 2020
ee27b97
IGNITE-10075: Test to reproduce issue
nizhikov Nov 29, 2020
af665b4
IGNITE-10075: Test + patch.
nizhikov Nov 30, 2020
d8d4590
IGNITE-10075: Test + patch.
nizhikov Nov 30, 2020
c82b4f8
IGNITE-10075: Test + patch.
nizhikov Nov 30, 2020
59defd1
IGNITE-10075: Compilation error fix.
nizhikov Nov 30, 2020
f7275d3
IGNITE-10075: Tests fix
nizhikov Nov 30, 2020
f01ffdf
IGNITE-10075: Tests fix
nizhikov Nov 30, 2020
7f3429b
IGNITE-10075: Tests fix
nizhikov Nov 30, 2020
6ba6af0
IGNITE-10075: Tests fix
nizhikov Nov 30, 2020
18e1e16
IGNITE-10075: Inspection fix.
nizhikov Dec 1, 2020
ea5c209
IGNITE-10075: Tests fix
nizhikov Dec 1, 2020
c8e40b9
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
a0e3d50
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
9ba075c
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
68ff425
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
41b5e42
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
f561572
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
0e4f4ec
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
22ab566
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
cca4b98
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
96b7866
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
73df4f8
IGNITE-10075: Code review fix.
nizhikov Dec 1, 2020
9df3e3d
Merge branch 'master' into IGNITE-10075
nizhikov Dec 1, 2020
15d376a
IGNITE-10075: Fix tests.
nizhikov Dec 1, 2020
dc068e3
IGNITE-10075: Fix tests.
nizhikov Dec 2, 2020
9af231f
IGNITE-10075: Fix tests.
nizhikov Dec 2, 2020
a547023
Merge branch 'master' into IGNITE-10075
nizhikov Dec 2, 2020
b92eb31
IGNITE-10075: Fix reworked.
nizhikov Dec 3, 2020
8d7f4bb
IGNITE-10075: Fix reworked.
nizhikov Dec 3, 2020
d71e15f
IGNITE-10075: Fix reworked.
nizhikov Dec 3, 2020
6ce6490
IGNITE-10075: Fix reworked.
nizhikov Dec 3, 2020
6c528c8
IGNITE-10075: Fix reworked.
nizhikov Dec 3, 2020
91c9553
IGNITE-10075: WIP
nizhikov Dec 4, 2020
d9df160
IGNITE-10075: WIP
nizhikov Dec 4, 2020
96373c9
IGNITE-10075: WIP
nizhikov Dec 4, 2020
c31749e
IGNITE-10075: Code review fix.
nizhikov Dec 7, 2020
c17528d
IGNITE-10075: Code review fix.
nizhikov Dec 7, 2020
6d9ecb2
IGNITE-10075: Code review fix.
nizhikov Dec 7, 2020
3b3199f
IGNITE-10075: Code review fix.
nizhikov Dec 7, 2020
38fb925
IGNITE-10075: Code review fix.
nizhikov Dec 7, 2020
c1f94c1
IGNITE-10075: Code review fix.
nizhikov Dec 7, 2020
24b51a7
IGNITE-10075: Compilation fix.
nizhikov Dec 7, 2020
52ffd39
IGNITE-10075: Compilation fix.
nizhikov Dec 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,19 @@ public PlatformBinaryProcessor(PlatformContext platformCtx) {
case OP_REGISTER_TYPE: {
int typeId = reader.readInt();
String typeName = reader.readString();
boolean registerSameJavaType = reader.readBoolean();

return platformContext().kernalContext().marshallerContext()
int res = platformContext().kernalContext().marshallerContext()
.registerClassName(MarshallerPlatformIds.DOTNET_ID, typeId, typeName, false)
? TRUE : FALSE;

if (registerSameJavaType && res == TRUE) {
res = platformContext().kernalContext().marshallerContext()
.registerClassName(MarshallerPlatformIds.JAVA_ID, typeId, typeName, false)
? TRUE : FALSE;
}

return res;
}
}

Expand Down
47 changes: 47 additions & 0 deletions modules/core/src/test/java/org/apache/ignite/platform/Address.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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 org.apache.ignite.platform;

/** Test value object. */
public class Address {
/** */
private String zip;

/** */
private String addr;

/** */
public String getZip() {
return zip;
}

/** */
public void setZip(String zip) {
this.zip = zip;
}

/** */
public String getAddr() {
return addr;
}

/** */
public void setAddr(String addr) {
this.addr = addr;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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 org.apache.ignite.platform;

/** Test value object. */
public class Department {
/** */
private String name;

/** */
public String getName() {
return name;
}

/** */
public void setName(String name) {
this.name = name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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 org.apache.ignite.platform;

/** Test value object. */
public class Employee {
/** */
private String fio;

/** */
private long salary;

/** */
public String getFio() {
return fio;
}

/** */
public void setFio(String fio) {
this.fio = fio;
}

/** */
public long getSalary() {
return salary;
}

/** */
public void setSalary(long salary) {
this.salary = salary;
}
}
51 changes: 51 additions & 0 deletions modules/core/src/test/java/org/apache/ignite/platform/Key.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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 org.apache.ignite.platform;

import java.util.Objects;

/** Test key object. */
public class Key {
/** */
private long id;

/** */
public Key(long id) {
this.id = id;
}

/** */
public long getId() {
return id;
}

/** {@inheritDoc} */
@Override public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Key key = (Key)o;
return id == key.id;
}

/** {@inheritDoc} */
@Override public int hashCode() {
return Objects.hash(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand All @@ -41,6 +43,8 @@
import org.jetbrains.annotations.Nullable;

import static java.util.Calendar.JANUARY;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
* Task that deploys a Java service.
Expand Down Expand Up @@ -414,6 +418,82 @@ public BinaryObject testBinaryObject(BinaryObject o) {
return o.toBuilder().setField("field", 15).build();
}

/** */
public Address testAddress(Address addr) {
if (addr == null)
return null;

assertEquals("000", addr.getZip());
assertEquals("Moscow", addr.getAddr());

addr.setZip("127000");
addr.setAddr("Moscow Akademika Koroleva 12");

return addr;
}

/** */
public Employee[] testEmployees(Employee[] emps) {
if (emps == null)
return null;

assertEquals(2, emps.length);

assertEquals("Sarah Connor", emps[0].getFio());
assertEquals(1, emps[0].getSalary());

assertEquals("John Connor", emps[1].getFio());
assertEquals(2, emps[1].getSalary());

Employee kyle = new Employee();

kyle.setFio("Kyle Reese");
kyle.setSalary(3);

return new Employee[] { kyle };
}

/** */
public Collection testDepartments(Collection deps) {
if (deps == null)
return null;

assertEquals(2, deps.size());

Iterator<Department> iter = deps.iterator();

assertEquals("HR", iter.next().getName());
assertEquals("IT", iter.next().getName());

Collection<Department> res = new ArrayList<>();

Department d = new Department();

d.setName("Executive");

res.add(d);

return res;
}

/** */
public Map testMap(Map map) {
if (map == null)
return null;

assertTrue(map.containsKey(new Key(1)));
assertTrue(map.containsKey(new Key(2)));

assertEquals("value1", ((Value)map.get(new Key(1))).getVal());
assertEquals("value2", ((Value)map.get(new Key(2))).getVal());

Map m = new HashMap();

m.put(new Key(3), new Value("value3"));

return m;
}

/** */
public void sleep(long delayMs) {
try {
Expand Down
51 changes: 51 additions & 0 deletions modules/core/src/test/java/org/apache/ignite/platform/Value.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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 org.apache.ignite.platform;

import java.util.Objects;

/** Test value object. */
public class Value {
/** */
private String val;

/** */
public Value(String val) {
this.val = val;
}

/** */
public String getVal() {
return val;
}

/** {@inheritDoc} */
@Override public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Value value = (Value)o;
return Objects.equals(val, value.val);
}

/** {@inheritDoc} */
@Override public int hashCode() {
return Objects.hash(val);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@
<Compile Include="Plugin\TestIgnitePluginConfiguration.cs" />
<Compile Include="Plugin\TestIgnitePluginException.cs" />
<Compile Include="Plugin\TestIgnitePluginProvider.cs" />
<Compile Include="Services\Model.cs" />
<Compile Include="Services\IJavaService.cs" />
<Compile Include="Services\JavaServiceDynamicProxy.cs" />
<Compile Include="Ssl\SslConfigurationTest.cs" />
<Compile Include="TaskExtensions.cs" />
<Compile Include="TestAppConfig.cs" />
Expand Down Expand Up @@ -397,6 +399,7 @@
<Compile Include="Services\ServicesTestAsync.cs" />
<Compile Include="Services\ServiceProxyTest.cs" />
<Compile Include="Services\ServicesAsyncWrapper.cs" />
<Compile Include="Services\ServiceTypeAutoResolveTest.cs" />
<Compile Include="TestRunner.cs" />
<Compile Include="TestUtils.cs" />
<Compile Include="TestUtilsJni.cs" />
Expand Down Expand Up @@ -617,4 +620,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void PutBinaryTypes(ICollection<BinaryType> types)
}

/** <inheritdoc /> */
public bool RegisterType(int id, string typeName)
public bool RegisterType(int id, string typeName, bool registerSameJavaType = false)
{
return false;
}
Expand Down
Loading