trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lium...@apache.org
Subject [35/38] incubator-trafodion git commit: add one junit test case for trafci
Date Thu, 08 Dec 2016 00:46:02 GMT
add one junit test case for trafci


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/95b9f271
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/95b9f271
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/95b9f271

Branch: refs/heads/master
Commit: 95b9f2718df007f1c67f97e34c1e3a187c90e88e
Parents: 6fc8775
Author: AlexPeng19 <alex_peng1986@hotmail.com>
Authored: Tue Nov 29 18:58:01 2016 +0800
Committer: AlexPeng19 <alex_peng1986@hotmail.com>
Committed: Tue Nov 29 18:58:01 2016 +0800

----------------------------------------------------------------------
 core/conn/trafci/Makefile                       |  4 +-
 core/conn/trafci/pom.xml                        | 54 ++++++++++----------
 .../org/trafodion/ci/UserInterfaceTest.java     | 28 ++++++++++
 3 files changed, 56 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95b9f271/core/conn/trafci/Makefile
----------------------------------------------------------------------
diff --git a/core/conn/trafci/Makefile b/core/conn/trafci/Makefile
index 30a80cf..c9c2da5 100644
--- a/core/conn/trafci/Makefile
+++ b/core/conn/trafci/Makefile
@@ -27,11 +27,11 @@ all:Trafci_deploy
 Trafci_deploy:Trafci_installer
 Trafci_installer:Trafci_jar
 Trafci_jar:
-	mvn clean install$
+	mvn clean install -DskipTests$
 Trafci_installer:
 	./getBuildInfo$
 	export buildId=`head -n 1 buildId`$
-	mvn -f installer_pom.xml -DbldId=${buildId} clean package$
+	mvn -f installer_pom.xml -DbldId=${buildId} clean package -DskipTests$ 
 Trafci_deploy:
 	zip -r ../clients/trafci.zip -j target/trafciInstaller.jar utils/README
 	java -jar target/trafciInstaller.jar -silent -jdbcFile ${MY_SQROOT}/export/lib/jdbcT4.jar
-installDir ${MY_SQROOT}

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95b9f271/core/conn/trafci/pom.xml
----------------------------------------------------------------------
diff --git a/core/conn/trafci/pom.xml b/core/conn/trafci/pom.xml
index 7f74250..7292289 100644
--- a/core/conn/trafci/pom.xml
+++ b/core/conn/trafci/pom.xml
@@ -1,25 +1,14 @@
-<!-- 
- @@@ START COPYRIGHT @@@                                                       
-
- 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.
-
- @@@ END COPYRIGHT @@@
--->
+<!-- @@@ START COPYRIGHT @@@ 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. 
+	@@@ END COPYRIGHT @@@ -->
 <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/maven-v4_0_0.xsd">
 	<modelVersion>4.0.0</modelVersion>
@@ -37,8 +26,16 @@
 		<dependency>
 			<groupId>org.trafodion.jdbc.t4</groupId>
 			<artifactId>jdbcT4</artifactId>
-			<version>${traf-jdbc-version}</version>
+			<version>${TRAFODION_VER}</version>
+			<scope>provided</scope>
 		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.11</version>
+			<scope>test</scope>
+		</dependency>
+
 	</dependencies>
 	<build>
 		<finalName>trafci</finalName>
@@ -69,9 +66,10 @@
 						<phase>generate-sources</phase>
 						<configuration>
 							<target>
-							<property name="vproc.version" value="TrafCI_Build_${bldId}"/>
-							<property name="vproc.dir" value="${basedir}/src/main/java/org/trafodion/ci"/>
-							<property name="Install.dir" value="${basedir}/install"/>
+								<property name="vproc.version" value="TrafCI_Build_${bldId}" />
+								<property name="vproc.dir"
+									value="${basedir}/src/main/java/org/trafodion/ci" />
+								<property name="Install.dir" value="${basedir}/install" />
 								<copy file="${vproc.dir}/Vproc.java-tmpl" tofile="${vproc.dir}/Vproc.java"
 									overwrite="true"></copy>
 								<copy file="${Install.dir}/Installer.java-tmpl" tofile="${Install.dir}/Installer.java"
@@ -79,8 +77,8 @@
 								<echo message="BUILD Vproc version ${vproc.version}" />
 								<replace file="${vproc.dir}/Vproc.java" token="@@@"
 									value="${vproc.version}" />
-								<replace file="${Install.dir}/Installer.java"
-									token="@@@VPROC@@@" value="${vproc.version}" />
+								<replace file="${Install.dir}/Installer.java" token="@@@VPROC@@@"
+									value="${vproc.version}" />
 							</target>
 						</configuration>
 						<goals>

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/95b9f271/core/conn/trafci/test/main/java/org/trafodion/ci/UserInterfaceTest.java
----------------------------------------------------------------------
diff --git a/core/conn/trafci/test/main/java/org/trafodion/ci/UserInterfaceTest.java b/core/conn/trafci/test/main/java/org/trafodion/ci/UserInterfaceTest.java
new file mode 100644
index 0000000..cc8f52f
--- /dev/null
+++ b/core/conn/trafci/test/main/java/org/trafodion/ci/UserInterfaceTest.java
@@ -0,0 +1,28 @@
+package org.trafodion.ci;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class UserInterfaceTest {
+
+	@Test
+	public void test() {
+		MySecurityManager secManager = new MySecurityManager();
+		System.setSecurityManager(secManager);
+		try {
+			String[] params = "-h 10.10.12.99:23400 -u trafodion -p traf123 -q values(1);".split("\\s+");
+			UserInterface.main(params);
+		} catch (SecurityException e) {
+			assertTrue(true);
+		}
+	}
+
+}
+
+class MySecurityManager extends SecurityManager {
+	@Override
+	public void checkExit(int status) {
+		throw new SecurityException();
+	}
+}


Mime
View raw message