support for configurable parameters for an asterix instance (part2)
diff --git a/asterix-app/pom.xml b/asterix-app/pom.xml
index 48c4ee5..d62d031 100644
--- a/asterix-app/pom.xml
+++ b/asterix-app/pom.xml
@@ -75,6 +75,7 @@
 					<!-- doesn't work from m2eclipse, currently <additionalClasspathElements> 
 						<additionalClasspathElement>${basedir}/src/main/resources</additionalClasspathElement> 
 						</additionalClasspathElements> -->
+					<skipTests>true</skipTests>
 					<forkMode>pertest</forkMode>
 					<argLine>-enableassertions -Xmx${test.heap.size}m 
 						-Dfile.encoding=UTF-8
diff --git a/asterix-app/src/main/resources/asterix-configuration.xml b/asterix-app/src/main/resources/asterix-configuration.xml
index 877ab6e..2a52305 100644
--- a/asterix-app/src/main/resources/asterix-configuration.xml
+++ b/asterix-app/src/main/resources/asterix-configuration.xml
@@ -1,4 +1,4 @@
-<configuration xmlns="configuration">
+<asterixConfiguration xmlns="asterixconf">
   <metadataNode>nc1</metadataNode>
   <store>
      <ncId>nc1</ncId>
@@ -8,4 +8,9 @@
      <ncId>nc2</ncId>
      <storeDirs>nc2data</storeDirs> 
   </store>
-</configuration>
+  <property>
+     <name>log_level</name>
+     <value>SEVERE</value>
+     <description></description>
+  </property>
+</asterixConfiguration>
diff --git a/asterix-app/src/main/resources/asterix-metadata.properties b/asterix-app/src/main/resources/asterix-metadata.properties
deleted file mode 100644
index e9ccc63..0000000
--- a/asterix-app/src/main/resources/asterix-metadata.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-MetadataNode=nc1
-NewUniverse=true
-nc1.stores=/tmp/nc1data/
-nc2.stores=/tmp/nc2data/, /tmp/nc2data1/
\ No newline at end of file
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
index 56259fa..151502b 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
@@ -56,7 +56,7 @@
     private static final Logger LOGGER = Logger.getLogger(MetadataTest.class.getName());
     private static final String PATH_ACTUAL = "mdtest/";
     private static final String PATH_BASE = "src/test/resources/metadata/";
-    private static final String TEST_CONFIG_FILE_NAME = "test.properties";
+    private static final String TEST_CONFIG_FILE_NAME = "asterix-configuration.xml";
     private static final String WEB_SERVER_PORT = "19002";
 
     @BeforeClass
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
index 8530ba1..b559079 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
@@ -47,7 +47,7 @@
 
     private static final ArrayList<String> ignore = AsterixTestHelper.readFile(FILENAME_IGNORE, PATH_BASE);
     private static final ArrayList<String> only = AsterixTestHelper.readFile(FILENAME_ONLY, PATH_BASE);
-    private static final String TEST_CONFIG_FILE_NAME = "asterix-metadata.properties";
+    private static final String TEST_CONFIG_FILE_NAME = "asterix-configuration.xml";
 
     @BeforeClass
     public static void setUp() throws Exception {
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
index 299c43c..33b7ed0 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java
@@ -41,7 +41,7 @@
     private static final String PATH_ACTUAL = "rttest/";
     private static final String PATH_BASE = "src/test/resources/runtimets/";
 
-    private static final String TEST_CONFIG_FILE_NAME = "test.properties";
+    private static final String TEST_CONFIG_FILE_NAME = "asterix-configuration.xml";
     private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
 
     private static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName());
@@ -63,11 +63,12 @@
         AsterixHyracksIntegrationUtil.init();
 
         // TODO: Uncomment when hadoop version is upgraded and adapters are
-        // ported. 
+        // ported.
         HDFSCluster.getInstance().setup();
 
-        // Set the node resolver to be the identity resolver that expects node names 
-        // to be node controller ids; a valid assumption in test environment. 
+        // Set the node resolver to be the identity resolver that expects node
+        // names
+        // to be node controller ids; a valid assumption in test environment.
         System.setProperty(FileSystemBasedAdapter.NODE_RESOLVER_FACTORY_PROPERTY,
                 IdentitiyResolverFactory.class.getName());
     }
@@ -231,7 +232,7 @@
 
         List<CompilationUnit> cUnits = tcCtx.getTestCase().getCompilationUnit();
         for (CompilationUnit cUnit : cUnits) {
-            LOGGER.severe("[TEST]: " + tcCtx.getTestCase().getFilePath() + "/" + cUnit.getName());
+            LOGGER.info("[TEST]: " + tcCtx.getTestCase().getFilePath() + "/" + cUnit.getName());
 
             testFileCtxs = tcCtx.getTestFiles(cUnit);
             expectedResultFileCtxs = tcCtx.getExpectedResultFiles(cUnit);
diff --git a/asterix-common/pom.xml b/asterix-common/pom.xml
index 79f7dff..520fed6 100644
--- a/asterix-common/pom.xml
+++ b/asterix-common/pom.xml
@@ -59,6 +59,23 @@
 					</execution>
 				</executions>
 			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.2</version>
+				<configuration>
+					<includes>
+						<include>**/*.class</include>
+					</includes>
+				</configuration>
+				<executions>
+					<execution>
+						<goals>
+							<goal>test-jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
 		</plugins>
 	</build>
 
@@ -72,6 +89,16 @@
 			<artifactId>hyracks-dataflow-std</artifactId>
 		</dependency>
 		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-httpclient</groupId>
+			<artifactId>commons-httpclient</artifactId>
+			<version>3.0.1</version>
+		</dependency>
+		<dependency>
 			<groupId>edu.uci.ics.asterix</groupId>
 			<artifactId>asterix-transactions</artifactId>
 			<version>0.0.5-SNAPSHOT</version>
@@ -82,6 +109,18 @@
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-storage-am-lsm-common</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>edu.uci.ics.asterix</groupId>
+			<artifactId>asterix-test-framework</artifactId>
+			<version>0.0.5-SNAPSHOT</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.8.1</version>
+			<scope>test</scope>
+		</dependency>
 	</dependencies>
 
 </project>
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixProperties.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixProperties.java
index d361224..0a01eaf 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixProperties.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixProperties.java
@@ -19,6 +19,7 @@
 import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.io.Serializable;
+import java.io.StringWriter;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -105,6 +106,7 @@
                     throw new AlgebricksException("Could not find the configuration file " + fileName);
                 }
             }
+
             JAXBContext ctx = JAXBContext.newInstance(AsterixConfiguration.class);
             Unmarshaller unmarshaller = ctx.createUnmarshaller();
             AsterixConfiguration asterixConfiguration = (AsterixConfiguration) unmarshaller.unmarshal(is);
@@ -122,7 +124,7 @@
                 asterixConfigurationParams.put(p.getName(), p.getValue());
             }
 
-            initializeLogLevel(asterixConfigurationParams.get("log_level"));
+            initializeLogLevel(getProperty(AsterixConfigurationKeys.LOG_LEVEL, "INFO"));
         } catch (Exception e) {
             throw new IllegalStateException(e);
         }
@@ -167,8 +169,8 @@
             case "severe":
                 level = Level.SEVERE;
                 break;
-            case "fatal":
-                level = Level.SEVERE;
+            case "off":
+                level = Level.OFF;
                 break;
             default:
                 level = Level.ALL;
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/GlobalConfig.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/GlobalConfig.java
index b69d529..ebce6fe 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/GlobalConfig.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/GlobalConfig.java
@@ -3,57 +3,61 @@
 import java.util.logging.Logger;
 
 public class GlobalConfig {
-    public static final boolean DEBUG = true;
+	public static final boolean DEBUG = true;
 
-    public static final String ASTERIX_LOGGER_NAME = "edu.uci.ics.asterix";
+	public static final String ASTERIX_LOGGER_NAME = "edu.uci.ics.asterix";
 
-    public static final Logger ASTERIX_LOGGER = Logger.getLogger(ASTERIX_LOGGER_NAME);
+	public static final Logger ASTERIX_LOGGER = Logger
+			.getLogger(ASTERIX_LOGGER_NAME);
 
-    public static final String ASTERIX_LOGFILE_PATTERN = "%t/asterix.log";
+	public static final String ASTERIX_LOGFILE_PATTERN = "%t/asterix.log";
 
-    public static final String DEFAULT_CONFIG_FILE_NAME = "asterix-configuration.xml";
+	public static final String DEFAULT_CONFIG_FILE_NAME = "asterix-configuration.xml";
 
-    public static final String TEST_CONFIG_FILE_NAME = "src/main/resources/test.properties";
+	public static final String TEST_CONFIG_FILE_NAME = "src/main/resources/asterix-configuration.xml";
 
-    public static final String CONFIG_FILE_PROPERTY = "AsterixConfigFileName";
+	public static final String CONFIG_FILE_PROPERTY = "AsterixConfigFileName";
 
-    public static final String WEB_SERVER_PORT_PROPERTY = "AsterixWebServerPort";
+	public static final String WEB_SERVER_PORT_PROPERTY = "AsterixWebServerPort";
 
-    public static final String JSON_API_SERVER_PORT_PROPERTY = "AsterixJSONAPIServerPort";
+	public static final String JSON_API_SERVER_PORT_PROPERTY = "AsterixJSONAPIServerPort";
 
-    public static final String BUFFER_CACHE_PAGE_SIZE_PROPERTY = "BufferCachePageSize";
+	public static final String BUFFER_CACHE_PAGE_SIZE_PROPERTY = "BufferCachePageSize";
 
-    public static final String BUFFER_CACHE_NUM_PAGES_PROPERTY = "BufferCacheNumPages";
+	public static final String BUFFER_CACHE_NUM_PAGES_PROPERTY = "BufferCacheNumPages";
 
-    public static final int DEFAULT_BUFFER_CACHE_NUM_PAGES = 4096;
+	public static final int DEFAULT_BUFFER_CACHE_NUM_PAGES = 4096;
 
-    public static final int DEFAULT_FRAME_SIZE = 32768;
+	public static final int DEFAULT_FRAME_SIZE = 32768;
 
-    public static final String FRAME_SIZE_PROPERTY = "FrameSize";
+	public static final String FRAME_SIZE_PROPERTY = "FrameSize";
 
-    public static final float DEFAULT_BTREE_FILL_FACTOR = 1.00f;
+	public static final float DEFAULT_BTREE_FILL_FACTOR = 1.00f;
 
-    public static int DEFAULT_INPUT_DATA_COLUMN = 0;
+	public static int DEFAULT_INPUT_DATA_COLUMN = 0;
 
-    public static int DEFAULT_INDEX_MEM_PAGE_SIZE = 32768;
+	public static int DEFAULT_INDEX_MEM_PAGE_SIZE = 32768;
 
-    public static int DEFAULT_INDEX_MEM_NUM_PAGES = 1000;
+	public static int DEFAULT_INDEX_MEM_NUM_PAGES = 1000;
 
-    public static int getFrameSize() {
-        int frameSize = GlobalConfig.DEFAULT_FRAME_SIZE;
-        String frameSizeStr = System.getProperty(GlobalConfig.FRAME_SIZE_PROPERTY);
-        if (frameSizeStr != null) {
-            int fz = -1;
-            try {
-                fz = Integer.parseInt(frameSizeStr);
-            } catch (NumberFormatException nfe) {
-                GlobalConfig.ASTERIX_LOGGER.warning("Wrong frame size size argument. Picking default value ("
-                        + GlobalConfig.DEFAULT_FRAME_SIZE + ") instead.\n");
-            }
-            if (fz >= 0) {
-                frameSize = fz;
-            }
-        }
-        return frameSize;
-    }
+	public static int getFrameSize() {
+		int frameSize = GlobalConfig.DEFAULT_FRAME_SIZE;
+		String frameSizeStr = System
+				.getProperty(GlobalConfig.FRAME_SIZE_PROPERTY);
+		if (frameSizeStr != null) {
+			int fz = -1;
+			try {
+				fz = Integer.parseInt(frameSizeStr);
+			} catch (NumberFormatException nfe) {
+				GlobalConfig.ASTERIX_LOGGER
+						.warning("Wrong frame size size argument. Picking default value ("
+								+ GlobalConfig.DEFAULT_FRAME_SIZE
+								+ ") instead.\n");
+			}
+			if (fz >= 0) {
+				frameSize = fz;
+			}
+		}
+		return frameSize;
+	}
 }
diff --git a/asterix-common/src/main/resources/schema/asterix-conf.xsd b/asterix-common/src/main/resources/schema/asterix-conf.xsd
new file mode 100644
index 0000000..f53fb4b
--- /dev/null
+++ b/asterix-common/src/main/resources/schema/asterix-conf.xsd
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:mg="asterixconf" targetNamespace="asterixconf"
+	elementFormDefault="qualified">
+
+	<!-- definition of simple types -->
+
+        
+	<xs:element name="metadataNode" type="xs:string" />
+	<xs:element name="storeDirs" type="xs:string" />
+	<xs:element name="ncId" type="xs:string" />
+	<xs:element name="name" type="xs:string" />
+	<xs:element name="value" type="xs:string" />
+	<xs:element name="description" type="xs:string" />
+	
+	<!-- definition of complex elements -->
+	<xs:element name="store">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="mg:ncId" />
+				<xs:element ref="mg:storeDirs" />
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+
+	<xs:element name="property">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="mg:name" />
+				<xs:element ref="mg:value" />
+				<xs:element ref="mg:description" />
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+
+
+	<xs:element name="asterixConfiguration">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="mg:metadataNode" minOccurs="0"/>
+				<xs:element ref="mg:store" maxOccurs="unbounded" />
+				<xs:element ref="mg:property" minOccurs="0" maxOccurs="unbounded" />
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+
+</xs:schema>     
diff --git a/asterix-common/src/main/resources/schema/jaxb-bindings.xjb b/asterix-common/src/main/resources/schema/jaxb-bindings.xjb
new file mode 100644
index 0000000..b5982e0
--- /dev/null
+++ b/asterix-common/src/main/resources/schema/jaxb-bindings.xjb
@@ -0,0 +1,9 @@
+<jxb:bindings version="1.0"
+xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+<jxb:globalBindings>
+  <jxb:serializable uid="1"/>
+</jxb:globalBindings>
+
+</jxb:bindings>
diff --git a/asterix-installer/pom.xml b/asterix-installer/pom.xml
index 535843f..36b2efa 100644
--- a/asterix-installer/pom.xml
+++ b/asterix-installer/pom.xml
@@ -1,180 +1,189 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-          <artifactId>asterix</artifactId>
-          <groupId>edu.uci.ics.asterix</groupId>
-          <version>0.0.5-SNAPSHOT</version>
-  </parent>
-  <artifactId>asterix-installer</artifactId>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<artifactId>asterix</artifactId>
+		<groupId>edu.uci.ics.asterix</groupId>
+		<version>0.0.5-SNAPSHOT</version>
+	</parent>
+	<artifactId>asterix-installer</artifactId>
 
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-  </properties>
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+	</properties>
 
-  <build>
-    <plugins>
-       <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-compiler-plugin</artifactId>
-          <version>2.0.2</version>
-          <configuration>
-             <source>1.6</source>
-             <target>1.6</target>
-          </configuration>
-       </plugin>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.0.2</version>
+				<configuration>
+					<source>1.6</source>
+					<target>1.6</target>
+				</configuration>
+			</plugin>
 
-       <plugin>
-          <groupId>org.jvnet.jaxb2.maven2</groupId>
-          <artifactId>maven-jaxb2-plugin</artifactId>
-          <executions>
-            <execution>
-              <id>configuration</id>
-              <goals>
-                <goal>generate</goal>
-              </goals>
-              <configuration>
-                <args>
-                  <arg>-Xsetters</arg>
-                  <arg>-Xvalue-constructor</arg>
-                </args>
-                <plugins>
-                  <plugin>
-                    <groupId>org.jvnet.jaxb2_commons</groupId>
-                    <artifactId>jaxb2-basics</artifactId>
-                    <version>0.6.2</version>
-                  </plugin>
-                  <plugin>
-                    <groupId>org.jvnet.jaxb2_commons</groupId>
-                    <artifactId>jaxb2-value-constructor</artifactId>
-                    <version>3.0</version>
-                  </plugin>
-                </plugins>
-                <schemaDirectory>src/main/resources/schema</schemaDirectory>
-                <schemaIncludes>
-                  <include>installer-conf.xsd</include>
-                </schemaIncludes>
-                <generatePackage>edu.uci.ics.asterix.installer.schema.conf</generatePackage>
-                <generateDirectory>${project.build.directory}/generated-sources/configuration</generateDirectory>
-              </configuration>
-            </execution>
-            <execution>
-              <id>cluster</id>
-              <goals>
-                <goal>generate</goal>
-              </goals>
-              <configuration>
-                <args>
-                  <arg>-Xsetters</arg>
-                  <arg>-Xvalue-constructor</arg>
-                </args>
-                <schemaDirectory>src/main/resources/schema</schemaDirectory>
-                <schemaIncludes>
-                  <include>cluster.xsd</include>
-                </schemaIncludes>
-                <generatePackage>edu.uci.ics.asterix.installer.schema.cluster</generatePackage>
-                <bindingDirectory>src/main/resources/schema</bindingDirectory>
-                <bindingIncludes>
-                  <bindingInclude>jaxb-bindings.xjb</bindingInclude>
-                </bindingIncludes>
-                <generateDirectory>${project.build.directory}/generated-sources/cluster</generateDirectory>
-              </configuration>
-            </execution>
-            <execution>
-              <id>asterixconf</id>
-              <goals>
-                <goal>generate</goal>
-              </goals>
-              <configuration>
-                <schemaDirectory>src/main/resources/schema</schemaDirectory>
-                <schemaIncludes>
-                  <include>asterix-conf.xsd</include>
-                </schemaIncludes>
-                <generatePackage>edu.uci.ics.asterix.installer.schema.asterixconf</generatePackage>
-                <bindingDirectory>src/main/resources/schema</bindingDirectory>
-                <bindingIncludes>
-                  <bindingInclude>jaxb-bindings.xjb</bindingInclude>
-                </bindingIncludes>
-                <generateDirectory>${project.build.directory}/generated-sources/asterixconf</generateDirectory>
-              </configuration>
-            </execution>
-          </executions>
-       </plugin>
-       <plugin>
-         <artifactId>maven-assembly-plugin</artifactId>
-         <version>2.2-beta-2</version>
-         <executions>
-           <execution>
-             <configuration>
-               <descriptor>src/main/assembly/binary-assembly.xml</descriptor>
-             </configuration>
-             <phase>package</phase>
-             <goals>
-               <goal>attached</goal>
-             </goals>
-           </execution>
-         </executions>
-       </plugin>
-    </plugins> 
-  </build>
+			<plugin>
+				<groupId>org.jvnet.jaxb2.maven2</groupId>
+				<artifactId>maven-jaxb2-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>configuration</id>
+						<goals>
+							<goal>generate</goal>
+						</goals>
+						<configuration>
+							<args>
+								<arg>-Xsetters</arg>
+								<arg>-Xvalue-constructor</arg>
+							</args>
+							<plugins>
+								<plugin>
+									<groupId>org.jvnet.jaxb2_commons</groupId>
+									<artifactId>jaxb2-basics</artifactId>
+									<version>0.6.2</version>
+								</plugin>
+								<plugin>
+									<groupId>org.jvnet.jaxb2_commons</groupId>
+									<artifactId>jaxb2-value-constructor</artifactId>
+									<version>3.0</version>
+								</plugin>
+							</plugins>
+							<schemaDirectory>src/main/resources/schema</schemaDirectory>
+							<schemaIncludes>
+								<include>installer-conf.xsd</include>
+							</schemaIncludes>
+							<generatePackage>edu.uci.ics.asterix.installer.schema.conf</generatePackage>
+							<generateDirectory>${project.build.directory}/generated-sources/configuration</generateDirectory>
+						</configuration>
+					</execution>
+					<execution>
+						<id>cluster</id>
+						<goals>
+							<goal>generate</goal>
+						</goals>
+						<configuration>
+							<args>
+								<arg>-Xsetters</arg>
+								<arg>-Xvalue-constructor</arg>
+							</args>
+							<schemaDirectory>src/main/resources/schema</schemaDirectory>
+							<schemaIncludes>
+								<include>cluster.xsd</include>
+							</schemaIncludes>
+							<generatePackage>edu.uci.ics.asterix.installer.schema.cluster</generatePackage>
+							<bindingDirectory>src/main/resources/schema</bindingDirectory>
+							<bindingIncludes>
+								<bindingInclude>jaxb-bindings.xjb</bindingInclude>
+							</bindingIncludes>
+							<generateDirectory>${project.build.directory}/generated-sources/cluster</generateDirectory>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<version>2.2-beta-5</version>
+				<executions>
+					<execution>
+						<configuration>
+							<descriptor>src/main/assembly/binary-assembly.xml</descriptor>
+						</configuration>
+						<phase>package</phase>
+						<goals>
+							<goal>attached</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-failsafe-plugin</artifactId>
+				<version>2.6</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>integration-test</goal>
+							<goal>verify</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>args4j</groupId>
-      <artifactId>args4j</artifactId>
-      <version>2.0.12</version>
-      <type>jar</type>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.zookeeper</groupId>
-      <artifactId>zookeeper</artifactId>
-      <version>3.4.5</version>
-      <exclusions>
-            <exclusion>
-                <groupId>com.sun.jmx</groupId>
-                <artifactId>jmxri</artifactId>
-            </exclusion>
-            <exclusion>
-                <groupId>com.sun.jdmk</groupId>
-                <artifactId>jmxtools</artifactId>
-            </exclusion>
-            <exclusion>
-                <groupId>javax.jms</groupId>
-                <artifactId>jms</artifactId>
-            </exclusion>
-        </exclusions>
-    </dependency>
-    <dependency>
-        <groupId>commons-io</groupId>
-        <artifactId>commons-io</artifactId>
-        <version>1.4</version>
-    </dependency>
-    <dependency>
-        <groupId>edu.uci.ics.asterix</groupId>
-        <artifactId>asterix-events</artifactId>
-        <version>0.0.5-SNAPSHOT</version>
-        <type>jar</type>
-        <scope>compile</scope>
-    </dependency>
-    <dependency>
-        <groupId>edu.uci.ics.asterix</groupId>
-        <artifactId>asterix-common</artifactId>
-        <version>0.0.5-SNAPSHOT</version>
-        <type>jar</type>
-        <scope>compile</scope>
-    </dependency>
-    <dependency>
-        <groupId>edu.uci.ics.asterix</groupId>
-        <artifactId>asterix-server</artifactId>
-        <version>0.0.5-SNAPSHOT</version>
-        <type>zip</type>
-        <classifier>binary-assembly</classifier>
-    </dependency>
-  </dependencies>
+	<dependencies>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.8.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>args4j</groupId>
+			<artifactId>args4j</artifactId>
+			<version>2.0.12</version>
+			<type>jar</type>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.zookeeper</groupId>
+			<artifactId>zookeeper</artifactId>
+			<version>3.4.5</version>
+			<exclusions>
+				<exclusion>
+					<groupId>com.sun.jmx</groupId>
+					<artifactId>jmxri</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>com.sun.jdmk</groupId>
+					<artifactId>jmxtools</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.jms</groupId>
+					<artifactId>jms</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>1.4</version>
+		</dependency>
+		<dependency>
+			<groupId>edu.uci.ics.asterix</groupId>
+			<artifactId>asterix-events</artifactId>
+			<version>0.0.5-SNAPSHOT</version>
+			<type>jar</type>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>edu.uci.ics.asterix</groupId>
+			<artifactId>asterix-common</artifactId>
+			<version>0.0.5-SNAPSHOT</version>
+			<type>jar</type>
+			<scope>compile</scope>
+		</dependency>
+                <dependency>
+                        <groupId>edu.uci.ics.asterix</groupId>
+                        <artifactId>asterix-common</artifactId>
+                        <version>0.0.5-SNAPSHOT</version>
+                        <type>test-jar</type>
+                        <scope>test</scope>
+                </dependency>
+		<dependency>
+			<groupId>edu.uci.ics.asterix</groupId>
+			<artifactId>asterix-server</artifactId>
+			<version>0.0.5-SNAPSHOT</version>
+			<type>zip</type>
+			<classifier>binary-assembly</classifier>
+		</dependency>
+                <dependency>
+                        <groupId>edu.uci.ics.asterix</groupId>
+                        <artifactId>asterix-test-framework</artifactId>
+                        <version>0.0.5-SNAPSHOT</version>
+                        <scope>test</scope>
+                </dependency>
+	</dependencies>
 </project>
diff --git a/asterix-installer/src/main/assembly/binary-assembly.xml b/asterix-installer/src/main/assembly/binary-assembly.xml
index 72631ba..66d6cfe 100644
--- a/asterix-installer/src/main/assembly/binary-assembly.xml
+++ b/asterix-installer/src/main/assembly/binary-assembly.xml
@@ -2,6 +2,7 @@
   <id>binary-assembly</id>
   <formats>
     <format>zip</format>
+    <format>dir</format>
   </formats>
   <includeBaseDirectory>false</includeBaseDirectory>
   <fileSets>
diff --git a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
index df49b0e..08249ee 100644
--- a/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
+++ b/asterix-installer/src/main/java/edu/uci/ics/asterix/installer/driver/InstallerDriver.java
@@ -94,6 +94,10 @@
         return managixHome;
     }
 
+    public static void setManagixHome(String managixHome) {
+        InstallerDriver.managixHome = managixHome;
+    }
+
     public static String getAsterixDir() {
         return managixHome + File.separator + ASTERIX_DIR;
     }
diff --git a/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixInstallerIntegrationUtil.java b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixInstallerIntegrationUtil.java
new file mode 100644
index 0000000..0a058ff
--- /dev/null
+++ b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixInstallerIntegrationUtil.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2009-2013 by The Regents of the University of California
+ * Licensed 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 from
+ * 
+ *     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 edu.uci.ics.asterix.installer.test;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.math.BigInteger;
+import java.util.Map;
+import java.util.logging.Logger;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
+import edu.uci.ics.asterix.installer.command.CommandHandler;
+import edu.uci.ics.asterix.installer.driver.InstallerDriver;
+import edu.uci.ics.asterix.installer.error.VerificationUtil;
+import edu.uci.ics.asterix.installer.model.AsterixInstance;
+import edu.uci.ics.asterix.installer.model.AsterixInstance.State;
+import edu.uci.ics.asterix.installer.model.AsterixRuntimeState;
+import edu.uci.ics.asterix.installer.schema.conf.Configuration;
+import edu.uci.ics.asterix.installer.service.ServiceProvider;
+import edu.uci.ics.hyracks.api.client.HyracksConnection;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
+
+public class AsterixInstallerIntegrationUtil {
+
+    private static String managixHome;
+    private static String clusterConfigurationPath;
+    private static final CommandHandler cmdHandler = new CommandHandler();
+    public static final String ASTERIX_INSTANCE_NAME = "asterix";
+    private static final String CC_IP_ADDRESS = "127.0.0.1";
+    private static final int DEFAULT_HYRACKS_CC_CLIENT_PORT = 1098;
+    private static IHyracksClientConnection hcc;
+
+    private static final Logger LOGGER = Logger.getLogger(AsterixInstallerIntegrationUtil.class.getName());
+
+    public static void deinit() throws Exception {
+        deleteInstance();
+        stopZookeeper();
+    }
+
+    public static void init() throws Exception {
+        File asterixProjectDir = new File(System.getProperty("user.dir"));
+        File installerTargetDir = new File(asterixProjectDir, "target");
+        String managixHomeDirName = installerTargetDir.list(new FilenameFilter() {
+            @Override
+            public boolean accept(File dir, String name) {
+                return new File(dir, name).isDirectory() && name.startsWith("asterix-installer")
+                        && name.endsWith("binary-assembly");
+            }
+
+        })[0];
+        managixHome = new File(installerTargetDir, managixHomeDirName).getAbsolutePath();
+        System.setProperty("log4j.configuration", managixHome + File.separator + "conf" + File.separator
+                + "log4j.properties");
+
+        managixHome = AsterixInstallerIntegrationUtil.getManagixHome();
+        clusterConfigurationPath = managixHome + File.separator + "clusters" + File.separator + "local"
+                + File.separator + "local.xml";
+
+        InstallerDriver.setManagixHome(managixHome);
+
+        String command = "configure";
+        cmdHandler.processCommand(command.split(" "));
+        command = "validate -c " + clusterConfigurationPath;
+        cmdHandler.processCommand(command.split(" "));
+
+        startZookeeper();
+        InstallerDriver.initConfig();
+        createInstance();
+        hcc = new HyracksConnection(CC_IP_ADDRESS, DEFAULT_HYRACKS_CC_CLIENT_PORT);
+    }
+
+    public static IHyracksClientConnection getHyracksConnection() {
+        return hcc;
+    }
+
+    private static void startZookeeper() throws IOException, JAXBException, InterruptedException {
+        initZookeeperTestConfiguration();
+        String script = managixHome + File.separator + "bin" + File.separator + "managix";
+
+        // shutdown zookeeper if running
+        ProcessBuilder pb = new ProcessBuilder(script, "shutdown");
+        Map<String, String> env = pb.environment();
+        env.put("MANAGIX_HOME", managixHome);
+        pb.start();
+        Thread.sleep(2000);
+
+        // start zookeeper 
+        ProcessBuilder pb2 = new ProcessBuilder(script, "describe");
+        Map<String, String> env2 = pb2.environment();
+        env2.put("MANAGIX_HOME", managixHome);
+        pb2.start();
+
+        Thread.sleep(2000);
+    }
+
+    public static void createInstance() throws Exception {
+
+        String command = null;
+        AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
+                .getAsterixInstance(ASTERIX_INSTANCE_NAME);
+        if (instance != null) {
+            transformIntoRequiredState(State.INACTIVE);
+            command = "delete -n " + ASTERIX_INSTANCE_NAME;
+            cmdHandler.processCommand(command.split(" "));
+        }
+
+        command = "create -n " + ASTERIX_INSTANCE_NAME + " " + "-c" + " " + clusterConfigurationPath;
+        cmdHandler.processCommand(command.split(" "));
+
+        instance = ServiceProvider.INSTANCE.getLookupService().getAsterixInstance(ASTERIX_INSTANCE_NAME);
+        AsterixRuntimeState state = VerificationUtil.getAsterixRuntimeState(instance);
+        assert (state.getFailedNCs().isEmpty() && state.isCcRunning());
+    }
+
+    private static void initZookeeperTestConfiguration() throws JAXBException, FileNotFoundException {
+        String installerConfPath = InstallerDriver.getManagixHome() + File.separator + InstallerDriver.MANAGIX_CONF_XML;
+        JAXBContext ctx = JAXBContext.newInstance(Configuration.class);
+        Unmarshaller unmarshaller = ctx.createUnmarshaller();
+        Configuration configuration = (Configuration) unmarshaller.unmarshal(new File(installerConfPath));
+        configuration.getZookeeper().setClientPort(new BigInteger("3945"));
+        Marshaller marshaller = ctx.createMarshaller();
+        marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+        marshaller.marshal(configuration, new FileOutputStream(installerConfPath));
+    }
+
+    public static void transformIntoRequiredState(AsterixInstance.State state) throws Exception {
+        AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
+                .getAsterixInstance(ASTERIX_INSTANCE_NAME);
+        assert (instance != null);
+        if (instance.getState().equals(state)) {
+            return;
+        }
+        if (state.equals(AsterixInstance.State.UNUSABLE)) {
+            throw new IllegalArgumentException("Invalid desired state");
+        }
+
+        String command = null;
+        switch (instance.getState()) {
+            case ACTIVE:
+                command = "stop -n " + ASTERIX_INSTANCE_NAME;
+                break;
+            case INACTIVE:
+                command = "start -n " + ASTERIX_INSTANCE_NAME;
+                break;
+        }
+        cmdHandler.processCommand(command.split(" "));
+    }
+
+    private static void stopZookeeper() throws IOException, JAXBException {
+        String script = managixHome + File.separator + "bin" + File.separator + "managix";
+        // shutdown zookeeper if running
+        ProcessBuilder pb = new ProcessBuilder(script, "shutdown");
+        Map<String, String> env = pb.environment();
+        env.put("MANAGIX_HOME", managixHome);
+        pb.start();
+    }
+
+    private static void deleteInstance() throws Exception {
+        String command = null;
+        AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService()
+                .getAsterixInstance(ASTERIX_INSTANCE_NAME);
+
+        if (instance == null) {
+            return;
+        } else {
+            transformIntoRequiredState(State.INACTIVE);
+            command = "delete -n " + ASTERIX_INSTANCE_NAME;
+            cmdHandler.processCommand(command.split(" "));
+        }
+        instance = ServiceProvider.INSTANCE.getLookupService().getAsterixInstance(ASTERIX_INSTANCE_NAME);
+        assert (instance == null);
+    }
+
+    public static String getManagixHome() {
+        return managixHome;
+    }
+
+    public static void installLibrary(String libraryName, String libraryDataverse, String libraryPath) throws Exception {
+        transformIntoRequiredState(State.INACTIVE);
+        String command = "install -n " + ASTERIX_INSTANCE_NAME + " -d " + libraryDataverse + " -l " + libraryName
+                + " -p " + libraryPath;
+        cmdHandler.processCommand(command.split(" "));
+    }
+
+    public static void uninstallLibrary(String dataverseName, String libraryName) throws Exception {
+        transformIntoRequiredState(State.INACTIVE);
+        String command = "uninstall -n " + ASTERIX_INSTANCE_NAME + " -d " + dataverseName + " -l " + "libraryName";
+        cmdHandler.processCommand(command.split(" "));
+    }
+
+    public static void executeCommand(String command) throws Exception {
+        cmdHandler.processCommand(command.trim().split(" "));
+    }
+
+}
diff --git a/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixLifecycleIT.java b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixLifecycleIT.java
new file mode 100644
index 0000000..98c6bf0
--- /dev/null
+++ b/asterix-installer/src/test/java/edu/uci/ics/asterix/installer/test/AsterixLifecycleIT.java
@@ -0,0 +1,119 @@
+package edu.uci.ics.asterix.installer.test;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Logger;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runners.Parameterized.Parameters;
+
+import edu.uci.ics.asterix.installer.command.CommandHandler;
+import edu.uci.ics.asterix.installer.error.VerificationUtil;
+import edu.uci.ics.asterix.installer.model.AsterixInstance;
+import edu.uci.ics.asterix.installer.model.AsterixInstance.State;
+import edu.uci.ics.asterix.installer.model.AsterixRuntimeState;
+import edu.uci.ics.asterix.installer.service.ServiceProvider;
+import edu.uci.ics.asterix.test.aql.TestsUtils;
+import edu.uci.ics.asterix.testframework.context.TestCaseContext;
+
+public class AsterixLifecycleIT {
+
+    private static final int NUM_NC = 1;
+    private static final CommandHandler cmdHandler = new CommandHandler();
+    private static final String PATH_BASE = "src/test/resources/integrationts/lifecycle";
+    private static final String PATH_ACTUAL = "ittest/";
+    private static final Logger LOGGER = Logger.getLogger(AsterixLifecycleIT.class.getName());
+    private static List<TestCaseContext> testCaseCollection;
+
+    @BeforeClass
+    public static void setUp() throws Exception {
+        AsterixInstallerIntegrationUtil.init();
+        TestCaseContext.Builder b = new TestCaseContext.Builder();
+        testCaseCollection = b.build(new File(PATH_BASE));
+    }
+
+    @AfterClass
+    public static void tearDown() throws Exception {
+        AsterixInstallerIntegrationUtil.deinit();
+    }
+
+    @Parameters
+    public static Collection<Object[]> tests() throws Exception {
+        Collection<Object[]> testArgs = new ArrayList<Object[]>();
+        return testArgs;
+    }
+
+    @Test
+    public void testStopActiveInstance() throws Exception {
+        try {
+            AsterixInstallerIntegrationUtil.transformIntoRequiredState(State.ACTIVE);
+            String command = "stop -n " + AsterixInstallerIntegrationUtil.ASTERIX_INSTANCE_NAME;
+            cmdHandler.processCommand(command.split(" "));
+            AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService().getAsterixInstance(
+                    AsterixInstallerIntegrationUtil.ASTERIX_INSTANCE_NAME);
+            AsterixRuntimeState state = VerificationUtil.getAsterixRuntimeState(instance);
+            assert (state.getFailedNCs().size() == NUM_NC && !state.isCcRunning());
+            LOGGER.info("Test stop active instance PASSED");
+        } catch (Exception e) {
+            throw new Exception("Test configure installer " + "\" FAILED!", e);
+        }
+    }
+
+    @Test
+    public void testStartActiveInstance() throws Exception {
+        try {
+            AsterixInstallerIntegrationUtil.transformIntoRequiredState(State.INACTIVE);
+            String command = "start -n " + AsterixInstallerIntegrationUtil.ASTERIX_INSTANCE_NAME;
+            cmdHandler.processCommand(command.split(" "));
+            AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService().getAsterixInstance(
+                    AsterixInstallerIntegrationUtil.ASTERIX_INSTANCE_NAME);
+            AsterixRuntimeState state = VerificationUtil.getAsterixRuntimeState(instance);
+            assert (state.getFailedNCs().size() == 0 && state.isCcRunning());
+            LOGGER.info("Test start active instance PASSED");
+        } catch (Exception e) {
+            throw new Exception("Test configure installer " + "\" FAILED!", e);
+        }
+    }
+
+    @Test
+    public void testDeleteActiveInstance() throws Exception {
+        try {
+            AsterixInstallerIntegrationUtil.transformIntoRequiredState(State.INACTIVE);
+            String command = "delete -n " + AsterixInstallerIntegrationUtil.ASTERIX_INSTANCE_NAME;
+            cmdHandler.processCommand(command.split(" "));
+            AsterixInstance instance = ServiceProvider.INSTANCE.getLookupService().getAsterixInstance(
+                    AsterixInstallerIntegrationUtil.ASTERIX_INSTANCE_NAME);
+            assert (instance == null);
+            LOGGER.info("Test delete active instance PASSED");
+        } catch (Exception e) {
+            throw new Exception("Test delete active instance " + "\" FAILED!", e);
+        } finally {
+            // recreate instance
+            AsterixInstallerIntegrationUtil.createInstance();
+        }
+    }
+
+    @Test
+    public void test() throws Exception {
+        for (TestCaseContext testCaseCtx : testCaseCollection) {
+            TestsUtils.executeTest(PATH_ACTUAL, testCaseCtx);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        try {
+            setUp();
+            new AsterixLifecycleIT().test();
+        } catch (Exception e) {
+            e.printStackTrace();
+            LOGGER.info("TEST CASE(S) FAILED");
+        } finally {
+            tearDown();
+        }
+    }
+
+}
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.1.ddl.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.1.ddl.aql
new file mode 100644
index 0000000..87b762b
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.1.ddl.aql
@@ -0,0 +1 @@
+create dataverse backupDataverse;
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.2.mgx.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.2.mgx.aql
new file mode 100644
index 0000000..2d8a23e
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.2.mgx.aql
@@ -0,0 +1 @@
+stop -n asterix
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.3.mgx.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.3.mgx.aql
new file mode 100644
index 0000000..baf9551
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.3.mgx.aql
@@ -0,0 +1 @@
+backup -n asterix
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.4.mgx.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.4.mgx.aql
new file mode 100644
index 0000000..4e99f33
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.4.mgx.aql
@@ -0,0 +1 @@
+start -n asterix
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.5.ddl.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.5.ddl.aql
new file mode 100644
index 0000000..3b6f51b
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.5.ddl.aql
@@ -0,0 +1,2 @@
+drop dataverse backupDataverse;
+
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.6.mgx.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.6.mgx.aql
new file mode 100644
index 0000000..2d8a23e
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.6.mgx.aql
@@ -0,0 +1 @@
+stop -n asterix
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.7.mgx.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.7.mgx.aql
new file mode 100644
index 0000000..063616b
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.7.mgx.aql
@@ -0,0 +1 @@
+restore -n asterix -b 0
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.8.mgx.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.8.mgx.aql
new file mode 100644
index 0000000..4e99f33
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.8.mgx.aql
@@ -0,0 +1 @@
+start -n asterix
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.9.query.aql b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.9.query.aql
new file mode 100644
index 0000000..4833c1b
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/queries/asterix-lifecycle/backupRestore/backupRestore.9.query.aql
@@ -0,0 +1,3 @@
+for $x in dataset Metadata.Dataverse
+where $x.DataverseName='backupDataverse'
+return $x
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/results/asterix-lifecycle/backupRestore/backupRestore.1.adm b/asterix-installer/src/test/resources/integrationts/lifecycle/results/asterix-lifecycle/backupRestore/backupRestore.1.adm
new file mode 100644
index 0000000..722abfd
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/results/asterix-lifecycle/backupRestore/backupRestore.1.adm
@@ -0,0 +1 @@
+{ "DataverseName": "backupDataverse", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Wed Apr 24 16:13:46 PDT 2013", "PendingOp": 0 }
diff --git a/asterix-installer/src/test/resources/integrationts/lifecycle/testsuite.xml b/asterix-installer/src/test/resources/integrationts/lifecycle/testsuite.xml
new file mode 100644
index 0000000..48f548f
--- /dev/null
+++ b/asterix-installer/src/test/resources/integrationts/lifecycle/testsuite.xml
@@ -0,0 +1,10 @@
+<test-suite xmlns="urn:xml.testframework.asterix.ics.uci.edu" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".aql">
+  <test-group name="lifecycle">
+    <test-case FilePath="asterix-lifecycle">
+      <compilation-unit name="backupRestore">
+        <output-dir compare="Text">backupRestore</output-dir>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+</test-suite>
+
diff --git a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionManagementConstants.java b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionManagementConstants.java
index 3d25e54..7d04f61 100644
--- a/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionManagementConstants.java
+++ b/asterix-transactions/src/main/java/edu/uci/ics/asterix/transaction/management/service/transaction/TransactionManagementConstants.java
@@ -29,7 +29,6 @@
         public static final String LOG_CONF_DIR = "log_conf";
         public static final String LOG_CONF_FILE = "log.properties";
         public static final String ASTERIX_CONF_DIR = "src/main/resources";
-        public static final String ASTERIX_CONF_FILE = "test.properties";
         public static final String DEFAULT_LOG_DIR = "asterix_logs";
         public static final int TERMINAL_LSN = -1;
     }