sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kathl...@apache.org
Subject git commit: SQOOP-1076: Sqoop2: Introduce Boolean model type
Date Sun, 23 Jun 2013 00:49:45 GMT
Updated Branches:
  refs/heads/sqoop2 f0e8fee3e -> fd4be5f5e


SQOOP-1076: Sqoop2: Introduce Boolean model type

(Jarek Jarcec Cecho via Kate Ting)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/fd4be5f5
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/fd4be5f5
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/fd4be5f5

Branch: refs/heads/sqoop2
Commit: fd4be5f5e89189662d2f8eeb7209fc67bd70f816
Parents: f0e8fee
Author: Kate Ting <kathleen@apache.org>
Authored: Sat Jun 22 20:43:33 2013 -0400
Committer: Kate Ting <kathleen@apache.org>
Committed: Sat Jun 22 20:43:33 2013 -0400

----------------------------------------------------------------------
 .../sqoop/client/utils/FormDisplayer.java       |  13 +
 .../apache/sqoop/client/utils/FormFiller.java   |  46 +++
 .../sqoop/json/util/FormSerialization.java      |   5 +
 .../java/org/apache/sqoop/model/FormUtils.java  |   2 +
 .../org/apache/sqoop/model/MBooleanInput.java   |  82 +++++
 .../main/java/org/apache/sqoop/model/MForm.java |   4 +
 .../java/org/apache/sqoop/model/MFormList.java  |   4 +
 .../java/org/apache/sqoop/model/MInputType.java |   3 +
 .../sqoop/json/util/TestFormSerialization.java  | 105 ++++++
 .../apache/sqoop/model/TestMBooleanInput.java   |  99 +++++
 .../org/apache/sqoop/repository/Repository.java |   3 +
 dist/src/main/bin/addtowar.sh                   | 361 -------------------
 dist/src/main/server/conf/catalina.properties   |  81 +++++
 docs/src/site/sphinx/Installation.rst           |  12 +-
 .../derby/DerbyRepositoryHandler.java           |   4 +
 .../sqoop/repository/derby/TestInputTypes.java  | 146 ++++++++
 16 files changed, 600 insertions(+), 370 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java b/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
index 36509c4..0a0f319 100644
--- a/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
+++ b/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
@@ -19,6 +19,7 @@ package org.apache.sqoop.client.utils;
 
 import org.apache.sqoop.client.core.Constants;
 import org.apache.sqoop.model.MAccountableEntity;
+import org.apache.sqoop.model.MBooleanInput;
 import org.apache.sqoop.model.MConnection;
 import org.apache.sqoop.model.MEnumInput;
 import org.apache.sqoop.model.MForm;
@@ -172,6 +173,9 @@ public final class FormDisplayer {
             case INTEGER:
               displayInputInteger((MIntegerInput) input);
               break;
+            case BOOLEAN:
+              displayInputBoolean((MBooleanInput) input);
+              break;
             case MAP:
               displayInputMap((MMapInput) input);
               break;
@@ -207,6 +211,15 @@ public final class FormDisplayer {
   }
 
   /**
+   * Display content of Boolean input.
+   *
+   * @param input Boolean input
+   */
+  private static void displayInputBoolean(MBooleanInput input) {
+    print(input.getValue());
+  }
+
+  /**
    * Display content of Map input
    *
    * @param input Map input

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java b/client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java
index 95d0612..2fbf129 100644
--- a/client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java
+++ b/client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java
@@ -18,6 +18,7 @@
 package org.apache.sqoop.client.utils;
 
 import jline.ConsoleReader;
+import org.apache.sqoop.model.MBooleanInput;
 import org.apache.sqoop.model.MConnection;
 import org.apache.sqoop.model.MEnumInput;
 import org.apache.sqoop.model.MForm;
@@ -164,6 +165,8 @@ public final class FormFiller {
         return fillInputString((MStringInput) input, reader, bundle);
       case INTEGER:
         return fillInputInteger((MIntegerInput) input, reader, bundle);
+      case BOOLEAN:
+        return fillInputBoolean((MBooleanInput) input, reader, bundle);
       case MAP:
         return fillInputMap((MMapInput) input, reader, bundle);
       case ENUM:
@@ -461,6 +464,49 @@ public final class FormFiller {
     return true;
   }
 
+  /**
+   * Load boolean input from the user.
+   *
+   * @param input Input that we should load in
+   * @param reader Associated console reader
+   * @param bundle Resource bundle for this input
+   * @return
+   * @throws IOException
+   */
+  public static boolean fillInputBoolean(MBooleanInput input,
+                                         ConsoleReader reader,
+                                         ResourceBundle bundle)
+                                         throws IOException {
+    generatePrompt(reader, bundle, input);
+
+    // Fill already filled data when available
+    // However do not printout if this input contains sensitive information.
+    if(!input.isEmpty() && !input.isSensitive()) {
+      reader.putString(input.getValue().toString());
+    }
+
+    // Get the data
+    String userTyped;
+    if(input.isSensitive()) {
+       userTyped = reader.readLine('*');
+    } else {
+      userTyped = reader.readLine();
+    }
+
+    if (userTyped == null) {
+      // Propagate end of loading process
+      return false;
+    } else if (userTyped.isEmpty()) {
+      // Empty input in case that nothing was given
+      input.setEmpty();
+    } else {
+      // Set value that user has entered
+      input.setValue(Boolean.valueOf(userTyped));
+    }
+
+    return true;
+  }
+
   public static void generatePrompt(ConsoleReader reader,
                                     ResourceBundle bundle,
                                     MInput input)

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java b/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
index 048323b..05a0878 100644
--- a/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
+++ b/common/src/main/java/org/apache/sqoop/json/util/FormSerialization.java
@@ -17,6 +17,7 @@
  */
 package org.apache.sqoop.json.util;
 
+import org.apache.sqoop.model.MBooleanInput;
 import org.apache.sqoop.model.MEnumInput;
 import org.apache.sqoop.model.MForm;
 import org.apache.sqoop.model.MFormType;
@@ -168,6 +169,10 @@ public final class FormSerialization {
           mInput = new MIntegerInput(name, sensitive.booleanValue());
           break;
         }
+        case BOOLEAN: {
+          mInput = new MBooleanInput(name, sensitive.booleanValue());
+          break;
+        }
         case ENUM: {
           String values = (String) input.get(FORM_INPUT_VALUES);
           mInput = new MEnumInput(name, sensitive.booleanValue(), values.split(","));

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/common/src/main/java/org/apache/sqoop/model/FormUtils.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/model/FormUtils.java b/common/src/main/java/org/apache/sqoop/model/FormUtils.java
index 80b10c8..f3dee8e 100644
--- a/common/src/main/java/org/apache/sqoop/model/FormUtils.java
+++ b/common/src/main/java/org/apache/sqoop/model/FormUtils.java
@@ -142,6 +142,8 @@ public class FormUtils {
           input = new MMapInput(inputName, sensitive);
         } else if(type == Integer.class) {
           input = new MIntegerInput(inputName, sensitive);
+        } else if(type == Boolean.class) {
+          input = new MBooleanInput(inputName, sensitive);
         } else if(type.isEnum()) {
           input = new MEnumInput(inputName, sensitive, ClassUtils.getEnumStrings(type));
         } else {

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/common/src/main/java/org/apache/sqoop/model/MBooleanInput.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/model/MBooleanInput.java b/common/src/main/java/org/apache/sqoop/model/MBooleanInput.java
new file mode 100644
index 0000000..68142da
--- /dev/null
+++ b/common/src/main/java/org/apache/sqoop/model/MBooleanInput.java
@@ -0,0 +1,82 @@
+/**
+ * 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.sqoop.model;
+
+/**
+ * Represents a <tt>Boolean</tt> input.
+ */
+public class MBooleanInput extends MInput<Boolean> {
+
+  public MBooleanInput(String name, boolean sensitive) {
+    super(name, sensitive);
+  }
+
+  @Override
+  public String getUrlSafeValueString() {
+    return getValue() ? "true" : "false";
+  }
+
+  @Override
+  public void restoreFromUrlSafeValueString(String valueString) {
+    if("true".equals(valueString)) {
+      setValue(true);
+    } else {
+      setValue(false);
+    }
+  }
+
+  @Override
+  public MInputType getType() {
+    return MInputType.BOOLEAN;
+  }
+
+  @Override
+  public boolean equals(Object other) {
+    if (!(other instanceof MBooleanInput)) {
+      return false;
+    }
+
+    MBooleanInput mbi = (MBooleanInput)other;
+    return getName().equals(mbi.getName())
+      && (isSensitive() == mbi.isSensitive());
+  }
+
+  @Override
+  public int hashCode() {
+    return getValue().hashCode();
+  }
+
+  @Override
+  public boolean isEmpty() {
+    return getValue() == null;
+  }
+
+  @Override
+  public void setEmpty() {
+    setValue(null);
+  }
+
+  @Override
+  public Object clone(boolean cloneWithValue) {
+    MBooleanInput copy = new MBooleanInput(getName(), isSensitive());
+    if(cloneWithValue) {
+      copy.setValue(getValue());
+    }
+    return copy;
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/common/src/main/java/org/apache/sqoop/model/MForm.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/model/MForm.java b/common/src/main/java/org/apache/sqoop/model/MForm.java
index cc7d88c..ff94660 100644
--- a/common/src/main/java/org/apache/sqoop/model/MForm.java
+++ b/common/src/main/java/org/apache/sqoop/model/MForm.java
@@ -63,6 +63,10 @@ public final class MForm extends MValidatedElement implements MClonable
{
     return (MIntegerInput)getInput(inputName);
   }
 
+  public MBooleanInput getBooleanInput(String inputName) {
+    return (MBooleanInput)getInput(inputName);
+  }
+
   public MMapInput getMapInput(String inputName) {
     return (MMapInput)getInput(inputName);
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/common/src/main/java/org/apache/sqoop/model/MFormList.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/model/MFormList.java b/common/src/main/java/org/apache/sqoop/model/MFormList.java
index c1c3a41..9130ada 100644
--- a/common/src/main/java/org/apache/sqoop/model/MFormList.java
+++ b/common/src/main/java/org/apache/sqoop/model/MFormList.java
@@ -72,6 +72,10 @@ public class MFormList implements MClonable {
     return (MMapInput)getInput(name);
   }
 
+  public MBooleanInput getBooleanInput(String name) {
+    return (MBooleanInput)getInput(name);
+  }
+
   @Override
   public boolean equals(Object o) {
     if (this == o) return true;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/common/src/main/java/org/apache/sqoop/model/MInputType.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/model/MInputType.java b/common/src/main/java/org/apache/sqoop/model/MInputType.java
index 76411e3..af40054 100644
--- a/common/src/main/java/org/apache/sqoop/model/MInputType.java
+++ b/common/src/main/java/org/apache/sqoop/model/MInputType.java
@@ -34,6 +34,9 @@ public enum MInputType {
   /** Integer input type */
   INTEGER,
 
+  /** Boolean input type */
+  BOOLEAN,
+
   /** String based input that can contain only predefined values **/
   ENUM,
 

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/common/src/test/java/org/apache/sqoop/json/util/TestFormSerialization.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/sqoop/json/util/TestFormSerialization.java b/common/src/test/java/org/apache/sqoop/json/util/TestFormSerialization.java
new file mode 100644
index 0000000..98a70f1
--- /dev/null
+++ b/common/src/test/java/org/apache/sqoop/json/util/TestFormSerialization.java
@@ -0,0 +1,105 @@
+/**
+ * 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.sqoop.json.util;
+
+import org.apache.sqoop.model.MBooleanInput;
+import org.apache.sqoop.model.MEnumInput;
+import org.apache.sqoop.model.MForm;
+import org.apache.sqoop.model.MInput;
+import org.apache.sqoop.model.MIntegerInput;
+import org.apache.sqoop.model.MMapInput;
+import org.apache.sqoop.model.MStringInput;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ *
+ */
+public class TestFormSerialization {
+
+  @Test
+  public void testAllDataTypes() {
+    // Inserted values
+    Map<String, String> map = new HashMap<String, String>();
+    map.put("A", "B");
+
+    // Fill form with all values
+    MForm form = getForm();
+    form.getStringInput("String").setValue("A");
+    form.getMapInput("Map").setValue(map);
+    form.getIntegerInput("Integer").setValue(1);
+    form.getBooleanInput("Boolean").setValue(true);
+    form.getEnumInput("Enum").setValue("YES");
+
+    // Serialize that into JSON
+    JSONObject jsonObject = FormSerialization.extractForm(form, false);
+    assertNotNull(jsonObject);
+
+    // Exchange the data on string level
+    String serializedJson = jsonObject.toJSONString();
+    JSONObject retrievedJson = (JSONObject) JSONValue.parse(serializedJson);
+
+    // And retrieve back from JSON representation
+    MForm retrieved = FormSerialization.restoreForm(retrievedJson);
+
+    // Verify all expected values
+    assertEquals("A", retrieved.getStringInput("String").getValue());
+    assertEquals(map, retrieved.getMapInput("Map").getValue());
+    assertEquals(1, (int)retrieved.getIntegerInput("Integer").getValue());
+    assertEquals(true, retrieved.getBooleanInput("Boolean").getValue());
+    assertEquals("YES", retrieved.getEnumInput("Enum").getValue());
+  }
+
+  /**
+   * Return form with all data types.
+   *
+   * @return
+   */
+  protected MForm getForm() {
+    List<MInput<?>> inputs;
+    MInput input;
+
+    inputs = new LinkedList<MInput<?>>();
+
+    input = new MStringInput("String", false, (short)30);
+    inputs.add(input);
+
+    input = new MMapInput("Map", false);
+    inputs.add(input);
+
+    input = new MIntegerInput("Integer", false);
+    inputs.add(input);
+
+    input = new MBooleanInput("Boolean", false);
+    inputs.add(input);
+
+    input = new MEnumInput("Enum", false, new String[] {"YES", "NO"});
+    inputs.add(input);
+
+    return new MForm("f", inputs);
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/common/src/test/java/org/apache/sqoop/model/TestMBooleanInput.java
----------------------------------------------------------------------
diff --git a/common/src/test/java/org/apache/sqoop/model/TestMBooleanInput.java b/common/src/test/java/org/apache/sqoop/model/TestMBooleanInput.java
new file mode 100644
index 0000000..cf9cf24
--- /dev/null
+++ b/common/src/test/java/org/apache/sqoop/model/TestMBooleanInput.java
@@ -0,0 +1,99 @@
+/**
+ * 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.sqoop.model;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Test class for org.apache.sqoop.model.MBooleanInput
+ */
+public class TestMBooleanInput {
+
+  /**
+   * Test for class initialization
+   */
+  @Test
+  public void testInitialization() {
+    MBooleanInput input = new MBooleanInput("sqoopsqoop", true);
+    assertEquals("sqoopsqoop", input.getName());
+    assertEquals(true, input.isSensitive());
+    assertEquals(MInputType.BOOLEAN, input.getType());
+  }
+
+  /**
+   * Test for equals() method
+   */
+  @Test
+  public void testEquals() {
+    // Positive test
+    MBooleanInput input1 = new MBooleanInput("sqoopsqoop", true);
+    MBooleanInput input2 = new MBooleanInput("sqoopsqoop", true);
+    assertTrue(input1.equals(input2));
+
+    // Negative test
+    MBooleanInput input3 = new MBooleanInput("sqoopsqoop", false);
+    MBooleanInput input4 = new MBooleanInput("sqoopsqoop", true);
+    assertFalse(input3.equals(input4));
+
+    MBooleanInput input5 = new MBooleanInput("sqoopsqoop", false);
+    MBooleanInput input6 = new MBooleanInput("sqoop", false);
+    assertFalse(input5.equals(input6));
+  }
+
+  /**
+   * Test for value
+   */
+  @Test
+  public void testValue() {
+    MBooleanInput input1 = new MBooleanInput("sqoopsqoop", true);
+    input1.setValue(true);
+    assertEquals(true, input1.getValue());
+    input1.setEmpty();
+    assertNull(input1.getValue());
+  }
+
+  /**
+   * Test for getUrlSafeValueString() and restoreFromUrlSafeValueString()
+   */
+  @Test
+  public void testUrlSafe() {
+    MBooleanInput input1 = new MBooleanInput("sqoopsqoop", true);
+    input1.setValue(true);
+    // Getting URL safe string
+    String tmp = input1.getUrlSafeValueString();
+    // Restore to actual value
+    input1.restoreFromUrlSafeValueString(tmp);
+    assertEquals(true, input1.getValue());
+  }
+
+  /**
+   * Test case for MNamedElement.getLabelKey() and MNamedElement.getHelpKey()
+   */
+  @Test
+  public void testNamedElement() {
+    MBooleanInput input1 = new MBooleanInput("sqoopsqoop", true);
+    assertEquals("sqoopsqoop.label", input1.getLabelKey());
+    assertEquals("sqoopsqoop.help", input1.getHelpKey());
+  }
+}

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/core/src/main/java/org/apache/sqoop/repository/Repository.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/sqoop/repository/Repository.java b/core/src/main/java/org/apache/sqoop/repository/Repository.java
index 666bfc1..1ba947a 100644
--- a/core/src/main/java/org/apache/sqoop/repository/Repository.java
+++ b/core/src/main/java/org/apache/sqoop/repository/Repository.java
@@ -23,6 +23,7 @@ import org.apache.sqoop.connector.ConnectorManager;
 import org.apache.sqoop.connector.spi.MetadataUpgrader;
 import org.apache.sqoop.connector.spi.SqoopConnector;
 import org.apache.sqoop.framework.FrameworkManager;
+import org.apache.sqoop.model.MBooleanInput;
 import org.apache.sqoop.model.MConnection;
 import org.apache.sqoop.model.MConnectionForms;
 import org.apache.sqoop.model.MConnector;
@@ -483,6 +484,8 @@ public abstract class Repository {
             ((MEnumInput) input).getValues());
         } else if (input instanceof MMapInput) {
           newInput = new MMapInput(input.getName(), input.isSensitive());
+        } else if (input instanceof MBooleanInput) {
+          newInput = new MBooleanInput(input.getName(), input.isSensitive());
         } else if(input instanceof MStringInput) {
           newInput = new MStringInput(input.getName(), input.isSensitive(),
             ((MStringInput) input).getMaxLength());

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/dist/src/main/bin/addtowar.sh
----------------------------------------------------------------------
diff --git a/dist/src/main/bin/addtowar.sh b/dist/src/main/bin/addtowar.sh
deleted file mode 100644
index fd41608..0000000
--- a/dist/src/main/bin/addtowar.sh
+++ /dev/null
@@ -1,361 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# Creating temporary directory
-function prepare() {
-  tmpDir=/tmp/sqoop-war-packing-$$
-  rm -rf ${tmpDir}
-  mkdir ${tmpDir}
-  tmpWarDir=${tmpDir}/sqoop-war
-  mkdir ${tmpWarDir}
-  checkExec "Creating staging directory ${tmpDir}"
-}
-
-# Cleans up temporary directory
-function cleanUp() {
-  if [ ! "${tmpDir}" = "" ]; then
-    rm -rf ${tmpDir}
-    checkExec "Deleting staging directory ${tmpDir}"
-  fi
-}
-
-# Check execution of command
-function checkExec() {
-  if [ $? -ne 0 ]
-  then
-    echo
-    echo "Failed: $1"
-    echo
-    cleanUp
-    exit -1;
-  fi
-}
-
-# Check that a file/path exists
-function checkFileExists() {
-  if [ ! -e ${1} ]; then
-    echo
-    echo "File/Dir does no exist: ${1}"
-    echo
-    cleanUp
-    exit -1
-  fi
-}
-
-# Check that a file/path does not exist
-function checkFileDoesNotExist() {
-  if [ -e ${1} ]; then
-    echo
-    echo "File/Dir already exists: ${1}"
-    echo
-    cleanUp
-    exit -1
-  fi
-}
-
-# Finds a file under a directory any depth, file returns in variable RET
-function findFile() {
-   RET=`find -H ${1//:/$' '} -name ${2}`
-   RET=`echo ${RET} | sed "s/ .*//"`
-   if [ "${RET}" = "" ]; then
-     echo
-     echo "File '${2}' not found in '${1}'"
-     echo
-     cleanUp
-     exit -1;
-   fi
-}
-
-function checkOption() {
-  if [ "$2" = "" ]; then
-    echo
-    echo "Missing option: ${1}"
-    echo
-    printUsage
-    exit -1
-  fi
-}
-
-# Try to guess installed Hadoop version
-function guessHadoopVersion() {
-  # Runn "hadoop version" command
-  guessedVersion=`hadoop version | grep "Hadoop"`
-  if [[ $? -ne 0 ]]; then
-    echo
-    echo "Hadoop binary is not in path, can't guess Hadoop version"
-    echo
-    printUsage
-    exit -1
-  fi
-
-  # Get the version number from line in format "Hadoop 2.0.2-alpha"
-  hadoopVersion=`echo $guessedVersion | sed -re "s/^Hadoop[ ]*//"`
-}
-
-# Try to guess common hadoop paths
-function guessHadoopHome() {
-  hadoopPossiblePaths="/usr/lib/hadoop /usr/lib/hadoop-mapreduce/ /usr/lib/hadoop-yarn/ /usr/lib/hadoop-hdfs"
-
-  # Check existence of each possible path and build up final structure
-  for path in $hadoopPossiblePaths; do
-    if [ -e ${path} ]; then
-      if [ -z "$hadoopHome"] ; then
-        hadoopHome="$path"
-      else
-        hadoopHome="$hadoopHome:$path"
-      fi
-    fi
-  done
-
-  if [ -z "$hadoopHome"] ; then
-    echo
-    echo "Non of expected directories with Hadoop exists"
-    echo
-    printUsage
-    exit -1
-  fi
-}
-
-# Get the list of hadoop jars that will be injected based on the hadoop version
-function getHadoopJars() {
-  version=$1
-  # List is separated by ":"
-  suffix="[0-9a-zA-Z\.\-]*"
-  if [[ "${version}" =~ cdh4mr1 ]]; then
-    hadoopJars="hadoop-mapreduce-client-core${suffix}.jar:hadoop-mapreduce-client-common${suffix}.jar:hadoop-mapreduce-client-jobclient${suffix}.jar:hadoop-mapreduce-client-app${suffix}.jar:hadoop-yarn-common${suffix}.jar:hadoop-yarn-api${suffix}.jar:hadoop-hdfs${suffix}.jar:hadoop-common${suffix}.jar:hadoop-auth${suffix}.jar:guava*.jar:protobuf-java${suffix}.jar:jackson-core-asl${suffix}.jar:jackson-mapper-asl${suffix}.jar:commons-configuration${suffix}.jar:commons-cli${suffix}.jar:commons-logging${suffix}.jar:slf4j-api${suffix}.jar:slf4j-log4j12${suffix}.jar:avro${suffix}.jar:hadoop-core-2.0.0-mr1-[0-9.A-Za-z]*.jar"
-  elif [[ "${version}" =~ cdh3 ]]; then
-    hadoopJars="hadoop-core${suffix}-cdh*.jar:jackson-core-asl${suffix}.jar:jackson-mapper-asl${suffix}.jar:commons-logging${suffix}.jar:slf4j-api${suffix}.jar:slf4j-log4j12${suffix}.jar:guava*.jar"
-  elif [[ "${version}" =~ ^1.* ]]; then
-    hadoopJars="hadoop-core${suffix}.jar:jackson-core-asl${suffix}.jar:jackson-mapper-asl${suffix}.jar:commons-configuration${suffix}.jar:commons-logging${suffix}.jar:slf4j-api${suffix}.jar:slf4j-log4j12${suffix}.jar"
-  elif [[ "${version}" =~ ^2.* ]]; then
-    hadoopJars="hadoop-mapreduce-client-core${suffix}.jar:hadoop-mapreduce-client-common${suffix}.jar:hadoop-mapreduce-client-jobclient${suffix}.jar:hadoop-mapreduce-client-app${suffix}.jar:hadoop-yarn-common${suffix}.jar:hadoop-yarn-api${suffix}.jar:hadoop-hdfs${suffix}.jar:hadoop-common${suffix}.jar:hadoop-auth${suffix}.jar:guava*.jar:protobuf-java${suffix}.jar:jackson-core-asl${suffix}.jar:jackson-mapper-asl${suffix}.jar:commons-configuration${suffix}.jar:commons-cli${suffix}.jar:commons-logging${suffix}.jar:slf4j-api${suffix}.jar:slf4j-log4j12${suffix}.jar:avro${suffix}.jar"
-  else
-    echo
-    echo "Exiting: Unsupported Hadoop version '${version}', supported versions: 1.x, 2.x,
cdh3, cdh4mr1"
-    echo
-    cleanUp
-    exit -1;
-  fi
-}
-
-function printUsage() {
-  echo " Usage  : addtowar.sh <OPTIONS>"
-  echo " Options: -hadoop-auto Try to guess hadoop version and path"
-  echo "          -hadoop-version HADOOP_VERSION Specify used version"
-  echo "          -hadoop-path HADOOP_PATHS Where to find hadoop jars (multiple paths with
Hadoop jars separated by ':')"
-  echo "          -jars JARS_PATH Special jars that should be added (multiple JAR paths separated
by ':')"
-  echo "          -war SQOOP_WAR Target Sqoop war file where all jars should be ingested"
-  echo
-}
-
-# We need at least some arguments
-if [ $# -eq 0 ]; then
-  echo
-  echo "Missing options"
-  echo
-  printUsage
-  exit -1
-fi
-
-# Variables that will be populated by our command line arguments
-addHadoop=""
-addJars=""
-hadoopVersion=""
-hadoopHome=""
-jarsPath=""
-warPath="`dirname $0`/../server/webapps/sqoop.war"
-
-# Parse command line arguments
-while [ $# -gt 0 ]
-do
-  if [ "$1" = "-hadoop-version" ]; then
-    shift
-    if [ $# -eq 0 ]; then
-      echo
-      echo "Missing option value, Hadoop version"
-      echo
-      printUsage
-      exit -1
-    fi
-    hadoopVersion=$1
-    addHadoop=true
-  elif [ "$1" = "-hadoop-path" ]; then
-    shift
-    if [ $# -eq 0 ]; then
-      echo
-      echo "Missing option value, Hadoop path"
-      echo
-      printUsage
-      exit -1
-    fi
-    hadoopHome=$1
-    addHadoop=true
-  elif [ "$1" = "-hadoop-auto" ]; then
-    guessHadoopVersion
-    guessHadoopHome
-    addHadoop=true
-  elif [ "$1" = "-jars" ]; then
-    shift
-    if [ $# -eq 0 ]; then
-      echo
-      echo "Missing option value, JARs path"
-      echo
-      printUsage
-      exit -1
-    fi
-    jarsPath=$1
-    addJars=true
-  elif [ "$1" = "-war" ]; then
-    shift
-    if [ $# -eq 0 ]; then
-      echo
-      echo "Missing option value, Input Sqoop WAR path"
-      echo
-      printUsage
-      exit -1
-    fi
-    warPath=$1
-  else
-    echo
-    echo "Unknown argument: $1"
-    echo
-    printUsage
-    exit -1
-  fi
-
-  shift
-done
-
-# Check that we have something to do
-if [ "${addHadoop}${addJars}" == "" ]; then
-  echo
-  echo "Nothing to do"
-  echo
-  printUsage
-  exit -1
-fi
-
-prepare
-
-checkOption "-war" ${warPath}
-checkFileExists ${warPath}
-
-if [ "${addHadoop}" = "true" ]; then
-  for hadoopPath in ${hadoopHome//:/$'\n'}
-  do
-    checkFileExists ${hadoopPath}
-  done
-  getHadoopJars ${hadoopVersion}
-fi
-
-if [ "${addJars}" = "true" ]; then
-  for jarPath in ${jarsPath//:/$'\n'}
-  do
-    checkFileExists ${jarPath}
-  done
-fi
-
-# Unpacking original war
-unzip ${warPath} -d ${tmpWarDir} > /dev/null
-checkExec "Unzipping Sqoop WAR"
-
-components=""
-
-# Let's print useful information
-echo "Hadoop version: $hadoopVersion"
-echo "Hadoop path: $hadoopHome"
-echo "Extra jars: $jarsPath"
-
-# Adding hadoop binaries to WAR file
-if [ "${addHadoop}" = "true" ]; then
-  components="Hadoop JARs";
-  found=`ls ${tmpWarDir}/WEB-INF/lib/hadoop*core*jar 2> /dev/null | wc -l`
-  checkExec "Looking for Hadoop JARs in WAR file"
-  if [ ! $found = 0 ]; then
-    echo
-    echo "Specified Sqoop WAR '${warPath}' already contains Hadoop JAR files"
-    echo
-    cleanUp
-    exit -1
-  fi
-  ## adding hadoop
-  echo ""
-  echo "Injecting following Hadoop JARs"
-  echo
-  for jar in ${hadoopJars//:/$'\n'}
-  do
-    findFile ${hadoopHome} ${jar}
-    jar=${RET}
-    echo ${jar}
-    cp ${jar} ${tmpWarDir}/WEB-INF/lib/
-    checkExec "Copying jar ${jar} to staging"
-  done
-fi
-
-# Adding new jars to WAR file
-if [ "${addJars}" = "true" ]; then
-  if [ ! "${components}" = "" ];then
-    components="${components}, "
-  fi
-  components="${components}JARs"
-
-  echo ""
-  echo "Injecting following additional JARs"
-  for jarPath in ${jarsPath//:/$'\n'}
-  do
-    found=`ls ${tmpWarDir}/WEB-INF/lib/${jarPath} 2> /dev/null | wc -l`
-    checkExec "Looking for JAR ${jarPath} in WAR path"
-    if [ ! $found = 0 ]; then
-      echo
-      echo "Specified Sqoop WAR '${inputWar}' already contains JAR ${jarPath}"
-      echo
-      cleanUp
-      exit -1
-    fi
-    echo ""
-    echo "$jarPath"
-    echo ""
-    cp ${jarPath} ${tmpWarDir}/WEB-INF/lib/
-    checkExec "Copying jar ${jarPath} to staging"
-  done
-fi
-
-# Creating new Sqoop WAR
-currentDir=`pwd`
-cd ${tmpWarDir}
-zip -r sqoop.war * > /dev/null
-checkExec "Creating new Sqoop WAR"
-cd ${currentDir}
-
-# Save original WAR file as a backup in case that something went wrong
-backupPath="${warPath}_`date +%Y-%m-%d_%H:%M:%S.%N`"
-echo
-echo "Backing up original WAR file to $backupPath"
-mv $warPath $backupPath
-checkExec "Backing up original WAR file to $backupPath"
-
-# Move our jar to new position
-mv ${tmpWarDir}/sqoop.war ${warPath}
-checkExec "Moving generated WAR file to original location"
-
-echo
-echo "New Sqoop WAR file with added '${components}' at ${warPath}"
-echo
-cleanUp
-exit 0

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/dist/src/main/server/conf/catalina.properties
----------------------------------------------------------------------
diff --git a/dist/src/main/server/conf/catalina.properties b/dist/src/main/server/conf/catalina.properties
new file mode 100644
index 0000000..5a47295
--- /dev/null
+++ b/dist/src/main/server/conf/catalina.properties
@@ -0,0 +1,81 @@
+# 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.
+
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageAccess unless the
+# corresponding RuntimePermission ("accessClassInPackage."+package) has
+# been granted.
+package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans.
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageDefinition unless the
+# corresponding RuntimePermission ("defineClassInPackage."+package) has
+# been granted.
+#
+# by default, no packages are restricted for definition, and none of
+# the class loaders supplied with the JDK call checkPackageDefinition.
+#
+package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
+
+#
+#
+# List of comma-separated paths defining the contents of the "common" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
+# If left as blank,the JVM system loader will be used as Catalina's "common" 
+# loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository
+common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/../lib/*.jar,/usr/lib/hadoop/*.jar
+
+#
+# List of comma-separated paths defining the contents of the "server" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
+# If left as blank, the "common" loader will be used as Catalina's "server" 
+# loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository
+server.loader=
+
+#
+# List of comma-separated paths defining the contents of the "shared" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_BASE path or absolute. If left as blank,
+# the "common" loader will be used as Catalina's "shared" loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository 
+# Please note that for single jars, e.g. bar.jar, you need the URL form
+# starting with file:.
+shared.loader=
+
+#
+# String cache configuration.
+tomcat.util.buf.StringCache.byte.enabled=true
+#tomcat.util.buf.StringCache.char.enabled=true
+#tomcat.util.buf.StringCache.trainThreshold=500000
+#tomcat.util.buf.StringCache.cacheSize=5000

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/docs/src/site/sphinx/Installation.rst
----------------------------------------------------------------------
diff --git a/docs/src/site/sphinx/Installation.rst b/docs/src/site/sphinx/Installation.rst
index 73f8680..239f55e 100644
--- a/docs/src/site/sphinx/Installation.rst
+++ b/docs/src/site/sphinx/Installation.rst
@@ -42,17 +42,11 @@ Sqoop server supports multiple Hadoop versions. However as Hadoop major
versions
 Installing Dependencies
 -----------------------
 
-You need to install Hadoop libraries into Sqoop server war file. Sqoop provides convenience
script ``addtowar.sh`` to do so. If you have installed Hadoop in usual location in ``/usr/lib``
and executable ``hadoop`` is in your path, you can use automatic Hadoop installation procedure:
::
+Hadoop libraries must be available on node where you are planning to run Sqoop server with
proper configuration for major services - ``NameNode`` and either ``JobTracker`` or ``ResourceManager``
depending whether you are running Hadoop 1 or 2. There is no need to run any Hadoop service
on the same node as Sqoop server, just the libraries and configuration must be available.

 
-  ./bin/addtowar.sh -hadoop-auto
+Path to Hadoop libraries is stored in file ``catalina.properties`` inside directory ``server/conf``.
You need to change property called ``common.loader`` to contain all directories with your
Hadoop libraries. The default expected locations are ``/usr/lib/hadoop`` and ``/usr/lib/hadoop/lib/``.
Please check out the comments in the file for further description how to configure different
locations.
 
-In case that you have Hadoop installed in different location, you will need to manually specify
Hadoop version and path to Hadoop libraries. You can use parameter ``-hadoop-version`` for
specifying Hadoop major version, we're currently support versions 1.x and 2.x. Path to Hadoop
libraries can be specified using ``-hadoop-path`` parameter. In case that your Hadoop libraries
are in multiple different folders, you can specify all of them separated by ``:``.  Example
of manual installation: ::
-
-  ./bin/addtowar.sh -hadoop-version 2.0 -hadoop-path /usr/lib/hadoop-common:/usr/lib/hadoop-hdfs:/usr/lib/hadoop-yarn
-
-Lastly you might need to install JDBC drivers that are not bundled with Sqoop because of
incompatible licenses. You can add any arbitrary java jar file to Sqoop server using script
``addtowar.sh`` with ``-jars`` parameter. Similarly as in case of hadoop path you can enter
multiple jars separated with ``:``. Example of installing MySQL JDBC driver to Sqoop server:
::
-
-  ./bin/addtowar.sh -jars /path/to/jar/mysql-connector-java-*-bin.jar
+Lastly you might need to install JDBC drivers that are not bundled with Sqoop because of
incompatible licenses. You can add any arbitrary Java jar file to Sqoop server by copying
it into ``lib/`` directory. You can create this directory if it do not exists already.
 
 Configuring Server
 ------------------

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
index 0ea7bac..0ec4da1 100644
--- a/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
+++ b/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
@@ -38,6 +38,7 @@ import javax.sql.DataSource;
 
 import org.apache.log4j.Logger;
 import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.model.MBooleanInput;
 import org.apache.sqoop.model.MConnection;
 import org.apache.sqoop.model.MConnectionForms;
 import org.apache.sqoop.model.MEnumInput;
@@ -1760,6 +1761,9 @@ public class DerbyRepositoryHandler extends JdbcRepositoryHandler {
         case MAP:
           input = new MMapInput(inputName, inputSensitivity);
           break;
+        case BOOLEAN:
+          input = new MBooleanInput(inputName, inputSensitivity);
+          break;
         case INTEGER:
           input = new MIntegerInput(inputName, inputSensitivity);
           break;

http://git-wip-us.apache.org/repos/asf/sqoop/blob/fd4be5f5/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestInputTypes.java
----------------------------------------------------------------------
diff --git a/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestInputTypes.java
b/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestInputTypes.java
new file mode 100644
index 0000000..15f9539
--- /dev/null
+++ b/repository/repository-derby/src/test/java/org/apache/sqoop/repository/derby/TestInputTypes.java
@@ -0,0 +1,146 @@
+/**
+ * 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.sqoop.repository.derby;
+
+import org.apache.sqoop.model.MBooleanInput;
+import org.apache.sqoop.model.MConnection;
+import org.apache.sqoop.model.MConnectionForms;
+import org.apache.sqoop.model.MConnector;
+import org.apache.sqoop.model.MEnumInput;
+import org.apache.sqoop.model.MForm;
+import org.apache.sqoop.model.MFramework;
+import org.apache.sqoop.model.MInput;
+import org.apache.sqoop.model.MIntegerInput;
+import org.apache.sqoop.model.MMapInput;
+import org.apache.sqoop.model.MPersistableEntity;
+import org.apache.sqoop.model.MStringInput;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Test proper support of all available model types.
+ */
+public class TestInputTypes extends DerbyTestCase {
+
+  DerbyRepositoryHandler handler;
+
+  @Override
+  public void setUp() throws Exception {
+    super.setUp();
+
+    handler = new DerbyRepositoryHandler();
+
+    // We always needs schema for this test case
+    createSchema();
+  }
+
+  /**
+   * Ensure that metadata with all various data types can be successfully
+   * serialized into repository and retrieved back.
+   */
+  public void testMetadataSerialization() throws Exception {
+    MConnector connector = getConnector();
+
+    // Serialize the connector with all data types into repository
+    handler.registerConnector(connector, getDerbyConnection());
+
+    // Successful serialization should update the ID
+    assertNotSame(connector.getPersistenceId(), MPersistableEntity.PERSISTANCE_ID_DEFAULT);
+
+    // Retrieve registered connector
+    MConnector retrieved = handler.findConnector(connector.getUniqueName(), getDerbyConnection());
+    assertNotNull(retrieved);
+
+    // Original and retrieved connectors should be the same
+    assertEquals(connector, retrieved);
+  }
+
+  /**
+   * Test that serializing actual data is not an issue.
+   */
+  public void testDataSerialization() throws Exception {
+    MConnector connector = getConnector();
+    MFramework framework = getFramework();
+
+    // Register metadata for everything and our new connector
+    handler.registerConnector(connector, getDerbyConnection());
+    handler.registerFramework(framework, getDerbyConnection());
+
+    // Inserted values
+    Map<String, String> map = new HashMap<String, String>();
+    map.put("A", "B");
+
+    // Connection object with all various values
+    MConnection connection = new MConnection(connector.getPersistenceId(), connector.getConnectionForms(),
framework.getConnectionForms());
+    MConnectionForms forms = connection.getConnectorPart();
+    forms.getStringInput("f.String").setValue("A");
+    forms.getMapInput("f.Map").setValue(map);
+    forms.getIntegerInput("f.Integer").setValue(1);
+    forms.getBooleanInput("f.Boolean").setValue(true);
+    forms.getEnumInput("f.Enum").setValue("YES");
+
+    // Create the connection in repository
+    handler.createConnection(connection, getDerbyConnection());
+    assertNotSame(connection.getPersistenceId(), MPersistableEntity.PERSISTANCE_ID_DEFAULT);
+
+    // Retrieve created connection
+    MConnection retrieved = handler.findConnection(connection.getPersistenceId(), getDerbyConnection());
+    forms = retrieved.getConnectorPart();
+    assertEquals("A", forms.getStringInput("f.String").getValue());
+    assertEquals(map, forms.getMapInput("f.Map").getValue());
+    assertEquals(1, (int)forms.getIntegerInput("f.Integer").getValue());
+    assertEquals(true, (boolean)forms.getBooleanInput("f.Boolean").getValue());
+    assertEquals("YES", forms.getEnumInput("f.Enum").getValue());
+  }
+
+  /**
+   * Overriding parent method to get forms with all supported data types.
+   *
+   * @return Forms with all data types
+   */
+  @Override
+  protected List<MForm> getForms() {
+    List<MForm> forms = new LinkedList<MForm>();
+
+    List<MInput<?>> inputs;
+    MInput input;
+
+    inputs = new LinkedList<MInput<?>>();
+
+    input = new MStringInput("f.String", false, (short)30);
+    inputs.add(input);
+
+    input = new MMapInput("f.Map", false);
+    inputs.add(input);
+
+    input = new MIntegerInput("f.Integer", false);
+    inputs.add(input);
+
+    input = new MBooleanInput("f.Boolean", false);
+    inputs.add(input);
+
+    input = new MEnumInput("f.Enum", false, new String[] {"YES", "NO"});
+    inputs.add(input);
+
+    forms.add(new MForm("f", inputs));
+    return forms;
+  }
+}


Mime
View raw message