|
From: <de...@us...> - 2003-03-18 14:47:01
|
Update of /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac
In directory sc8-pr-cvs1:/tmp/cvs-serv31756/dodico/src/org/fudaa/dodico/test/telemac
Modified Files:
simple.sx exemple.res
Added Files:
TestCL.java
Log Message:
ajout des classes io pour telemac
--- NEW FILE: TestCL.java ---
/*
* @file TestSerafin.java
* @creation 2002-11-20
* @modification $Date: 2003/03/18 14:46:56 $
* @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 java.io.FileReader;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import junit.framework.TestCase;
import org.fudaa.dodico.commun.DodicoIOAnalyze;
import org.fudaa.dodico.commun.DodicoLib;
import org.fudaa.dodico.commun.ProgressionBuAdapter;
import org.fudaa.dodico.telemac.io.TelemacCLInterface;
import org.fudaa.dodico.telemac.io.TelemacCLReader;
import com.memoire.bu.BuTask;
/**
* @version $Id: TestCL.java,v 1.1 2003/03/18 14:46:56 deniger Exp $
* @author Fred Deniger
*/
public class TestCL extends TestCase
{
double eps_;
TelemacCLInterface t_;
/** */
public TestCL()
{
eps_ = 1E-15;
// t_ = lecture(getFile("exemple.res"),NativeBinaryInputStream.SPARC);
// assertNotNull(t_);
}
/**
* @param _f
* @return File
*/
private File getFile(String _f)
{
URL url = getClass().getResource(_f);
if (url == null)
return null;
return new File(url.getPath());
}
/**
* Lit le fichier passe en argument.
*
* @param args
*/
public static void main(String[] args)
{
HashMap arg = DodicoLib.parseArgs(args);
String fileName = (String) arg.get("-f");
if (fileName == null)
fileName = (String) arg.get("-file");
if (fileName == null)
{
System.err.println("Usage: -file=monFichier.mail -out=monFichierReecrit");
return;
}
File f=new File(fileName);
if (!f.exists())
{
System.err.println("Fichier inexistant " + f.getAbsolutePath());
return;
}
TelemacCLReader r = null;
TelemacCLInterface inter = null;
ProgressionBuAdapter progress = new ProgressionBuAdapter(new BuTask());
try
{
r=new TelemacCLReader();
r.setIn(new FileReader(f));
r.setProgressReceiver(progress);
r.read();
DodicoIOAnalyze a=r.getAnalyze();
if(a!=null)
{
System.out.println("prob lecture");
a.printResume();
}
inter=r.getTelemacCLInterface();
}
catch(IOException e)
{
e.printStackTrace();
}
if(inter==null)
{
System.out.println("interface nulle");
}
else
{
inter.getLine()[136].printResume();
}
}
private final static synchronized TelemacCLInterface lecture(File _f,String _type)
{
// SerafinInterface t = null;
// try
// {
// assertNotNull(_f);
// InputStream in = new FileInputStream(_f);
// SerafinReader re=new SerafinReader();
// re.setMachineId(_type);
// re.setIn(in);
// re.read();
// assertNull(re.getAnalyze());
// t = re.getSerafinInterface();
// in.close();
// }
// catch (IOException _e)
// {
// _e.printStackTrace();
// }
// return t;
return null;
}
public void testLecture()
{
}
/**A unit test for JUnit */
public void testEcriture()
{
File f = null;
try
{
// f = File.createTempFile("testSerafin", ".ser");
// assertNotNull(f);
// OutputStream out = new FileOutputStream(f);
// SerafinWriter w = new SerafinWriter();
// w.setMachineID(NativeBinaryInputStream.X86);
// w.setSerafinInterface(t_);
// w.setOut(out);
// w.write();
// assertNull(w.getAnalyze());
// t_ = lecture(f,NativeBinaryInputStream.X86);
// testLecture();
}
catch (Exception _e)
{
_e.printStackTrace();
fail(_e.toString());
}
finally
{
if (f != null)
f.delete();
}
}
}
Index: simple.sx
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/simple.sx,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** simple.sx 29 Jan 2003 12:14:44 -0000 1.1
--- simple.sx 18 Mar 2003 14:46:56 -0000 1.2
***************
*** 1,42 ****
! C simple.sx
! C 10/11/2002
! C Semis de point
! B S
! CN semis
! C Les points
! 0 0 0
! 1 1 1
! 2 2 2
! 3 3 3
!
!
! C courbe X Y Z
! B C
! CN courbe
! CP 0 1
! CP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
! CP 0
! C les points
! 0 0 0
! 5 5 5
! 10 10 10
! 15 15 15
!
!
! C Courbe de niveau
! B N
! CN niveau
! CP 0 1
! C L'indication CP est ignore
! CP 15
! CP O
! C les points
! 100 100 100
! 200 200 200
!
! C Semis de point 2
! B S
! CN semis2
! C Les points
! 4 4 4
!
--- 1,42 ----
! C simple.sx
! C 10/11/2002
! C Semis de point
! B S
! CN semis
! C Les points
! 0 0 0
! 1 1 1
! 2 2 2
! 3 3 3
!
!
! C courbe X Y Z
! B C
! CN courbe
! CP 0 1
! CP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
! CP 0
! C les points
! 0 0 0
! 5 5 5
! 10 10 10
! 15 15 15
!
!
! C Courbe de niveau
! B N
! CN niveau
! CP 0 1
! C L'indication CP est ignore
! CP 15
! CP O
! C les points
! 100 100 100
! 200 200 200
!
! C Semis de point 2
! B S
! CN semis2
! C Les points
! 4 4 4
!
Index: exemple.res
===================================================================
RCS file: /cvsroot/fudaa/fudaa_devel/dodico/src/org/fudaa/dodico/test/telemac/exemple.res,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
Binary files /tmp/cvsZQpmZJ and /tmp/cvsatr9el differ
|