|
From: <de...@us...> - 2003-10-29 11:41:31
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv13994/test/telemac
Modified Files:
TestCL.java TestClMng.java testClMng.cli
Log Message:
Ajout du pattern command pour annuler des operations
Index: TestCL.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestCL.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** TestCL.java 8 Oct 2003 11:54:19 -0000 1.9
--- TestCL.java 29 Oct 2003 11:41:28 -0000 1.10
***************
*** 1 ****
! /*
* @file TestSerafin.java
* @creation 2002-11-20
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.test.telemac;
import java.io.File;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
import org.fudaa.dodico.telemac.io.TelemacCLInterface;
import org.fudaa.dodico.test.TestIO;
/**
* @version $Id$
* @author Fred Deniger
*/
public class TestCL extends TestIO {
/** */
public TestCL() {
super("test.cli");
}
public synchronized void _interfaceTest(TelemacCLInterface _inter) {
assertNotNull(_inter);
int idx=0;
H2dTelemacConditionLimite cls= _inter.getLine(idx);
assertEquals(_inter.getBordType(idx), H2dBordType.LIQUIDE_ONDE_INCIDENCE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx), H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx), H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(cls.getTraceurType(), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(cls.getTraceurType(), H2dClType.PERMANENT);
int l= _inter.getNbLines();
for (int i= 0; i < l; i++) {
cls= _inter.getLine(i);
//les valeurs
assertEquals(cls.getH(), 100 + i, eps_);
if ((i == 1)
|| (i == 6)
|| (i == 9)
|| (i == 14)
|| (i == 15)
|| (i == 16)) {
assertEquals(cls.getU(), 0, eps_);
} else {
assertEquals(cls.getU(), 200 + i, eps_);
}
if ((i == 2) || (i == 5) || (i == 8) || (i == 13) || (i == 15)) {
assertEquals(cls.getV(), 0, eps_);
} else {
assertEquals(cls.getV(), 300 + i, eps_);
}
assertEquals(cls.getStrickler(), 400 + i, eps_);
assertEquals(cls.getTraceur(), 500 + i, eps_);
assertEquals(cls.getTraceurCoefA(), 600 + i, eps_);
assertEquals(cls.getTraceurCoefB(), 700 + i, eps_);
//les indices commencent a 0.
assertEquals(cls.getIndexPt(), 799 + i, eps_);
}
}
/**
*
*/
public void testEcriture() {
TelemacCLInterface inter= getInter(fic_);
File tmpFile= createTempFile();
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().writeMaillage(
tmpFile,
inter,
null);
assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
}
public TelemacCLInterface getInter(File _f) {
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().read(_f, null);
TelemacCLInterface r= (TelemacCLInterface)syntheseR.getSource();
assertFalse(syntheseR.containsMessages());
return r;
}
/**
*
*/
public void testLecture() {
_interfaceTest(getInter(fic_));
}
}
\ No newline at end of file
--- 1 ----
! /*
* @file TestSerafin.java
* @creation 2002-11-20
* @modification $Date$
* @license GNU General Public License 2
* @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne
* @mail de...@fu...
*/
package org.fudaa.dodico.test.telemac;
import java.io.File;
import org.fudaa.dodico.fichiers.FileOperationSynthese;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
import org.fudaa.dodico.test.TestIO;
/**
* @version $Id$
* @author Fred Deniger
*/
public class TestCL extends TestIO {
/** */
public TestCL() {
super("test.cli");
}
public synchronized void _interfaceTest(H2dTelemacCLSourceInterface _inter) {
assertNotNull(_inter);
int idx=0;
H2dTelemacConditionLimite cls= _inter.getLine(idx);
assertEquals(_inter.getBordType(idx), H2dBordType.LIQUIDE_ONDE_INCIDENCE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx), H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx), H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.LIBRE);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_HAUTEUR_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_VITESSES_IMPOSEES);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.SOLIDE);
assertEquals(cls.getHType(), H2dClType.LIBRE);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.PERMANENT);
assertEquals(cls.getV(), 0, eps_);
assertEquals(_inter.getTracerType(idx), H2dClType.LIBRE);
cls= _inter.getLine(++idx);
assertEquals(_inter.getBordType(idx),H2dBordType.LIQUIDE_DEBIT_IMPOSE);
assertEquals(cls.getHType(), H2dClType.PERMANENT);
assertEquals(cls.getUType(), H2dClType.PERMANENT);
assertEquals(cls.getU(), 0, eps_);
assertEquals(cls.getVType(), H2dClType.LIBRE);
assertEquals(_inter.getTracerType(idx), H2dClType.PERMANENT);
int l= _inter.getNbLines();
for (int i= 0; i < l; i++) {
cls= _inter.getLine(i);
//les valeurs
assertEquals(cls.getH(), 100 + i, eps_);
if ((i == 1)
|| (i == 6)
|| (i == 9)
|| (i == 14)
|| (i == 15)
|| (i == 16)) {
assertEquals(cls.getU(), 0, eps_);
} else {
assertEquals(cls.getU(), 200 + i, eps_);
}
if ((i == 2) || (i == 5) || (i == 8) || (i == 13) || (i == 15)) {
assertEquals(cls.getV(), 0, eps_);
} else {
assertEquals(cls.getV(), 300 + i, eps_);
}
assertEquals(cls.getFrottementParoi(), 400 + i, eps_);
assertEquals(cls.getTraceur(), 500 + i, eps_);
assertEquals(cls.getTraceurCoefA(), 600 + i, eps_);
assertEquals(cls.getTraceurCoefB(), 700 + i, eps_);
//les indices commencent a 0.
assertEquals(cls.getIndexPt(), 799 + i, eps_);
}
}
/**
*
*/
public void testEcriture() {
H2dTelemacCLSourceInterface inter= getInter(fic_);
File tmpFile= createTempFile();
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().writeMaillage(
tmpFile,
inter,
null);
assertFalse(syntheseR.containsMessages());
_interfaceTest(getInter(tmpFile));
}
public H2dTelemacCLSourceInterface getInter(File _f) {
FileOperationSynthese syntheseR=
TelemacCLFileFormat.getInstance().getLastVersionImpl().read(_f, null);
H2dTelemacCLSourceInterface r= (H2dTelemacCLSourceInterface)syntheseR.getSource();
assertFalse(syntheseR.containsMessages());
return r;
}
/**
*
*/
public void testLecture() {
_interfaceTest(getInter(fic_));
}
}
\ No newline at end of file
Index: TestClMng.java
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/TestClMng.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TestClMng.java 8 Oct 2003 11:54:19 -0000 1.2
--- TestClMng.java 29 Oct 2003 11:41:28 -0000 1.3
***************
*** 8,12 ****
*/
package org.fudaa.dodico.test.telemac;
-
import java.io.File;
--- 8,11 ----
***************
*** 18,33 ****
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
- import org.fudaa.dodico.h2d.telemac.H2dTelemacConditionLimite;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
- import org.fudaa.dodico.telemac.io.Telemac2dFileFormat;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
- import org.fudaa.dodico.telemac.io.TelemacCLInterface;
import org.fudaa.dodico.test.TestIO;
-
/**
* @author deniger
--- 17,29 ----
import org.fudaa.dodico.h2d.H2dMaillage;
import org.fudaa.dodico.h2d.H2dMaillageFrontiere;
+ import org.fudaa.dodico.h2d.telemac.H2dTelemacBord;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLManager;
import org.fudaa.dodico.h2d.telemac.H2dTelemacCLSourceInterface;
import org.fudaa.dodico.h2d.type.H2dBordType;
import org.fudaa.dodico.h2d.type.H2dClType;
import org.fudaa.dodico.telemac.io.SerafinFileFormat;
import org.fudaa.dodico.telemac.io.SerafinInterface;
import org.fudaa.dodico.telemac.io.TelemacCLFileFormat;
import org.fudaa.dodico.test.TestIO;
/**
* @author deniger
***************
*** 35,42 ****
*/
public class TestClMng extends TestCase {
-
H2dMaillage m_;
H2dTelemacCLSourceInterface cl_;
-
public TestClMng() {
Class c= getClass();
--- 31,36 ----
***************
*** 54,60 ****
null);
assertFalse(op.containsFatalError());
! cl_= ((TelemacCLInterface)op.getSource());
}
-
public void testMaillage() {
assertNotNull(m_);
--- 48,53 ----
null);
assertFalse(op.containsFatalError());
! cl_= ((H2dTelemacCLSourceInterface)op.getSource());
}
public void testMaillage() {
assertNotNull(m_);
***************
*** 62,139 ****
H2dMaillageFrontiere frontiere= m_.getPtsFrontiere();
assertEquals(2, frontiere.getNbFrontier());
-
//test extern frontier
assertEquals(282, frontiere.getNbPt(0));
assertEquals(13, frontiere.getBordPrincPointIdx(0));
assertEquals(28, frontiere.getBordPrincPointIdx(281));
-
//test intern frontier
assertEquals(16, frontiere.getNbPt(1));
assertEquals(232, frontiere.getIdx(1, 0));
assertEquals(23, frontiere.getIdx(1, 15));
-
}
-
public void testCl() {
! assertEquals(298, cl_.getNbLines());
!
! /**extern frontier**/
! //bord 0
! for (int i= 270; i < 282; i++) {
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, cl_.getBordType(i));
! }
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, cl_.getBordType(0));
!
! // bord 1
! for (int i= 1; i < 138; i++) {
! assertEquals(H2dBordType.SOLIDE, cl_.getBordType(i));
! }
! // bord 2
! for (int i= 138; i < 149; i++) {
! assertEquals(H2dBordType.LIQUIDE, cl_.getBordType(i));
! }
! // bord 3
! for (int i= 149; i < 270; i++) {
! assertEquals(H2dBordType.SOLIDE, cl_.getBordType(i));
! }
!
! /**intern frontier**/
! for (int i= 282; i < 298; i++) {
! assertEquals(H2dBordType.SOLIDE, cl_.getBordType(i));
! }
}
-
public void testClMng() {
H2dTelemacCLManager clMng= H2dTelemacCLManager.init(m_, cl_, null, null);
assertNotNull(clMng);
assertEquals(2, clMng.getNbFrontiere());
-
/**extern frontier**/
H2dBorderPerFrontierInterface bord= clMng.getBordPerFrontier(0);
assertEquals(4, bord.getNbBord());
//bord 0
! H2dBord b= bord.getBord(0);
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, b.getType());
! assertEquals(270, b.getIdxDeb());
! assertEquals(0, b.getIdxFin());
!
! // bord 1
! b= bord.getBord(1);
assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(0, b.getIdxDeb());
assertEquals(138, b.getIdxFin());
!
! // bord 2
! b= bord.getBord(2);
! assertEquals(H2dBordType.LIQUIDE, b.getType());
assertEquals(138, b.getIdxDeb());
assertEquals(148, b.getIdxFin());
!
! // bord 3
! b= bord.getBord(3);
assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(148, b.getIdxDeb());
assertEquals(270, b.getIdxFin());
!
//intern frontier
bord= clMng.getBordPerFrontier(1);
--- 55,127 ----
H2dMaillageFrontiere frontiere= m_.getPtsFrontiere();
assertEquals(2, frontiere.getNbFrontier());
//test extern frontier
assertEquals(282, frontiere.getNbPt(0));
assertEquals(13, frontiere.getBordPrincPointIdx(0));
assertEquals(28, frontiere.getBordPrincPointIdx(281));
//test intern frontier
assertEquals(16, frontiere.getNbPt(1));
assertEquals(232, frontiere.getIdx(1, 0));
assertEquals(23, frontiere.getIdx(1, 15));
}
public void testCl() {
! _testCl(cl_);
! }
!
! private static void _testCl(H2dTelemacCLSourceInterface _cl){
! assertEquals(298, _cl.getNbLines());
! /**extern frontier**/
! //bord 0
! for (int i= 270; i < 282; i++) {
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, _cl.getBordType(i));
! }
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, _cl.getBordType(0));
! // bord 1
! for (int i= 1; i < 138; i++) {
! assertEquals(H2dBordType.SOLIDE, _cl.getBordType(i));
! }
! // bord 2
! for (int i= 138; i < 149; i++) {
! assertEquals(H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE, _cl.getBordType(i));
! }
! // bord 3
! for (int i= 149; i < 270; i++) {
! assertEquals(H2dBordType.SOLIDE, _cl.getBordType(i));
! }
! /**intern frontier**/
! for (int i= 282; i < 298; i++) {
! assertEquals(H2dBordType.SOLIDE, _cl.getBordType(i));
! }
!
}
public void testClMng() {
H2dTelemacCLManager clMng= H2dTelemacCLManager.init(m_, cl_, null, null);
assertNotNull(clMng);
assertEquals(2, clMng.getNbFrontiere());
/**extern frontier**/
H2dBorderPerFrontierInterface bord= clMng.getBordPerFrontier(0);
assertEquals(4, bord.getNbBord());
//bord 0
! H2dTelemacBord b= (H2dTelemacBord)bord.getBord(0);
assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(0, b.getIdxDeb());
assertEquals(138, b.getIdxFin());
! assertEquals(H2dClType.LIBRE, b.getTracerType());
! // bord 1
! b= (H2dTelemacBord)bord.getBord(1);
! assertEquals(H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE, b.getType());
assertEquals(138, b.getIdxDeb());
assertEquals(148, b.getIdxFin());
! // bord 2
! b=(H2dTelemacBord) bord.getBord(2);
assertEquals(H2dBordType.SOLIDE, b.getType());
assertEquals(148, b.getIdxDeb());
assertEquals(270, b.getIdxFin());
! // bord 3
! b= (H2dTelemacBord)bord.getBord(3);
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, b.getType());
! assertEquals(270, b.getIdxDeb());
! assertEquals(0, b.getIdxFin());
! assertEquals(H2dClType.PERMANENT, b.getTracerType());
!
//intern frontier
bord= clMng.getBordPerFrontier(1);
***************
*** 142,146 ****
assertEquals(0, bord.getBord(0).getIdxDeb());
assertEquals(0, bord.getBord(0).getIdxFin());
!
}
}
--- 130,156 ----
assertEquals(0, bord.getBord(0).getIdxDeb());
assertEquals(0, bord.getBord(0).getIdxFin());
! assertEquals(H2dClType.LIBRE, ((H2dTelemacBord)bord.getBord(0)).getTracerType());
!
! for (int i= 270; i < 282; i++) {
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! assertEquals(H2dBordType.LIQUIDE_DEBIT_IMPOSE, cl_.getBordType(0));
! // bord 1
! for (int i= 1; i < 138; i++) {
! assertEquals(H2dBordType.SOLIDE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! // bord 2
! for (int i= 138; i < 149; i++) {
! assertEquals(H2dBordType.LIQUIDE_HAUTEUR_IMPOSEE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! // bord 3
! for (int i= 149; i < 270; i++) {
! assertEquals(H2dBordType.SOLIDE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! /**intern frontier**/
! for (int i= 282; i < 298; i++) {
! assertEquals(H2dBordType.SOLIDE, clMng.getBordFromIdxOnFrontier(i).getType());
! }
! _testCl(clMng.createCLSourceInterface());
}
}
Index: testClMng.cli
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/testClMng.cli,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** testClMng.cli 23 Sep 2003 20:22:12 -0000 1.1
--- testClMng.cli 29 Oct 2003 11:41:28 -0000 1.2
***************
*** 1,27 ****
! 4 5 5 0.000000 0.000000 0.000000 0.000000 5 0.000000 0.000000 0.000000 14 1
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 10 2
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 124 3
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 246 4
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 210 5
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 31 6
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 147 7
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 247 8
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 49 9
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 169 10
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 77 11
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 57 12
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 178 13
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 254 14
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 28 15
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 199 16
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 219 17
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 101 18
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 234 19
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 69 20
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 264 21
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 212 22
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 261 23
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 64 24
! 2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 226 25
2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 86 26
2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 78 27
--- 1,27 ----
! 4 5 5 1.000000 0.000000 0.000000 0.000000 5 0.000000 0.000000 0.000000 14 1
! 2 2 2 2.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 10 2
! 2 2 2 3.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 124 3
! 2 2 2 4.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 246 4
! 2 2 2 5.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 210 5
! 2 2 2 6.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 31 6
! 2 2 2 7.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 147 7
! 2 2 2 8.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 247 8
! 2 2 2 9.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 49 9
! 2 2 2 10.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 169 10
! 2 2 2 11.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 77 11
! 2 2 2 12.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 57 12
! 2 2 2 13.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 178 13
! 2 2 2 14.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 254 14
! 2 2 2 15.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 28 15
! 2 2 2 16.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 199 16
! 2 2 2 17.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 219 17
! 2 2 2 18.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 101 18
! 2 2 2 19.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 234 19
! 2 2 2 20.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 69 20
! 2 2 2 21.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 264 21
! 2 2 2 22.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 212 22
! 2 2 2 23.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 261 23
! 2 2 2 24.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 64 24
! 2 2 2 25.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 226 25
2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 86 26
2 2 2 0.000000 0.000000 0.000000 0.000000 2 0.000000 0.000000 0.000000 78 27
|