Skip to content
Permalink
Browse files

Test cases

  • Loading branch information...
gquerret committed May 31, 2019
1 parent 2b6411e commit 1cad40c87eb3230ce7751e76a6add791c6bbcddc
@@ -16,6 +16,10 @@
*/
package com.phenix.pct;

import static org.testng.Assert.assertTrue;

import java.io.File;

import org.testng.annotations.Test;

/**
@@ -34,4 +38,14 @@ public void test1() {
executeTarget("check");
}

@Test(groups = {"v10"})
public void test2() {
configureProject("IndexRebuild/test2/build.xml");
executeTarget("init");
expectBuildException("test1", "No index node");
executeTarget("test2");
File log = new File("IndexRebuild/test2/test.log");
assertTrue(log.exists());
expectBuildException("test3", "Invalid cpinternal");
}
}
@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<project name="IndexRebuild-test2">
<taskdef resource="PCT.properties" />

<target name="init">
<mkdir dir="db" />
<sports2000 destDir="db" dbName="sp2k" dlcHome="${DLC}" />
<PCTLoadSchema dlcHome="${DLC}" srcFile="index.df">
<DBConnection dbName="sp2k" dbDir="db" singleUser="true" />
</PCTLoadSchema>
</target>

<target name="test1">
<IndexRebuild dbDir="db" dbName="sp2k" dlcHome="${DLC}" />
</target>

<target name="test2">
<IndexRebuild dbDir="db" dbName="sp2k" dlcHome="${DLC}" outputLog="test.log">
<Index table="customer" index="CustomerNew1" />
<Index table="employee" index="EmployeeNew1" />
</IndexRebuild>
</target>

<target name="test3">
<IndexRebuild dbDir="db" dbName="sp2k" dlcHome="${DLC}" cpInternal="utf-8">
<Index table="customer" index="CustomerNew1" />
<Index table="employee" index="EmployeeNew1" />
</IndexRebuild>
</target>

</project>
@@ -0,0 +1,10 @@
ADD INDEX "CustomerNew1" ON "customer"
INACTIVE
DESCRIPTION "XXX"
INDEX-FIELD "name" ASCENDING

ADD INDEX "EmployeeNew1" ON "employee"
INACTIVE
DESCRIPTION "XXX"
INDEX-FIELD "lastname" ASCENDING

0 comments on commit 1cad40c

Please sign in to comment.
You can’t perform that action at this time.