--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2010- Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ * \r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.databoard.tests;\r
+\r
+import java.io.File;\r
+\r
+import org.simantics.databoard.Bindings;\r
+import org.simantics.databoard.Datatypes;\r
+import org.simantics.databoard.Files;\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.databoard.type.Datatype;\r
+\r
+public class Jotakin4 {\r
+\r
+ \r
+ \r
+ /**\r
+ * @param args\r
+ */\r
+ public static void main(String[] args) throws Exception {\r
+ //Binding b = Bindings.getBinding(MapEntryAdded.class);\r
+ \r
+ \r
+ Datatype type = Datatypes.getDatatype("RecordingSessionHeader");\r
+ Binding binding = Bindings.getMutableBinding(type);\r
+ Object value = binding.createDefault();\r
+ File file = new File("D:/temp/file.txt");\r
+ Files.createTextFile(file, binding, value);\r
+ \r
+ value = Files.readTextFile(file, binding);\r
+ System.out.println(binding.printValueDefinition(value, false));\r
+ \r
+ /*\r
+ MutableByte b = new MutableByte();\r
+ Accessor a = Accessors.getAccessor(MutableByteBinding.INSTANCE, b);\r
+ WireServer wireServer = new WireServer(a);\r
+ Server server = new Server(0, wireServer.getMethodInterface());\r
+ WireClient wireClient = new WireClient();\r
+ Client client = new Client(InetAddress.getByName("localhost"), server.getPort(), wireClient.getClientMethodInterface());\r
+ wireClient.setServerMethodInterface(client.getConnection().getRemoteMethodInterface());\r
+ ByteAccessor ba = (ByteAccessor) wireClient.getAccessor(null);\r
+ b.value = 5;\r
+ \r
+ assertEquals(b.value, ba.getValue()); \r
+ System.out.println( ba.getValue() );\r
+ \r
+ ba.setValue( (byte)10 );\r
+ assertEquals(b.value, ba.getValue()); \r
+ System.out.println(b.byteValue()); \r
+*/ \r
+ }\r
+\r
+}\r
+\r