Isis-fish-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- 3175 discussions
r1789 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input
by sletellier@users.labs.libre-entreprise.org 04 Feb '09
by sletellier@users.labs.libre-entreprise.org 04 Feb '09
04 Feb '09
Author: sletellier
Date: 2009-02-04 15:41:06 +0000 (Wed, 04 Feb 2009)
New Revision: 1789
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
Log:
Utilisation d'un de saisie par d?\195?\169fault
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2009-02-04 15:39:12 UTC (rev 1788)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputAction.java 2009-02-04 15:41:06 UTC (rev 1789)
@@ -321,7 +321,7 @@
*
* @param name name of region
*/
- public void loadRegion(InputUI ui, String name) {
+ public FisheryRegion loadRegion(InputUI ui, String name) {
if (log.isTraceEnabled()) {
log.trace("loadRegion called");
}
@@ -335,16 +335,18 @@
fisheryRegion = RegionStorage.getFisheryRegion(isisContext);
ui.setContextValue(regionStorage);
ui.setContextValue(isisContext);
- ui.setContextValue(fisheryRegion);
+ return fisheryRegion;
// FIXME session shoul be closed
// but make lazy init later
//isisContext.rollbackTransaction();
//isisContext.closeContext();
}
+ return null;
} catch (Exception eee) {
log.error("Can't load region", eee);
showMsgBox(eee);
}
+ return null;
}
/**
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-02-04 15:39:12 UTC (rev 1788)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputSaveVerifier.java 2009-02-04 15:41:06 UTC (rev 1789)
@@ -294,6 +294,9 @@
currentEntity.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
+ if (log.isDebugEnabled()){
+ log.debug("PropetyChanged : " + evt.getPropertyName() + " New Value : " + evt.getNewValue());
+ }
topiaChanged();
}
});
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2009-02-04 15:39:12 UTC (rev 1788)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/InputUI.jaxx 2009-02-04 15:41:06 UTC (rev 1789)
@@ -36,6 +36,10 @@
<jaxx.runtime.swing.CardLayout2 id='cardlayout'/>
+ <java.awt.CardLayout id='cardlayoutPrincipal'/>
+
+ <fr.ifremer.isisfish.entities.FisheryRegionImpl id='region' javaBean='null'/>
+
<script><![CDATA[
import fr.ifremer.isisfish.ui.Common;
import fr.ifremer.isisfish.ui.WelcomeSaveVerifier;
@@ -68,6 +72,7 @@
import jaxx.runtime.swing.navigation.NavigationTreeModelBuilder;
import jaxx.runtime.swing.navigation.NavigationUtil;
import fr.ifremer.isisfish.entities.FisheryRegion;
+import fr.ifremer.isisfish.entities.FisheryRegionImpl;
import jaxx.runtime.swing.navigation.NavigationTreeCellRenderer;
import jaxx.runtime.swing.navigation.NavigationTreeModel;
import jaxx.runtime.Decorator;
@@ -77,9 +82,7 @@
import fr.ifremer.isisfish.datastore.RegionStorage;
getContextValue(WelcomeSaveVerifier.class).addSaveVerifier(getVerifier());
-protected FisheryRegion getRegion(){
- return getContextValue(FisheryRegion.class);
-}
+
protected InputAction getAction(){
return getContextValue(InputAction.class);
}
@@ -108,7 +111,14 @@
});
}
protected void loadRegion(String name){
- getAction().loadRegion(this, name);
+ setRegion((FisheryRegionImpl)getAction().loadRegion(this, name));
+ if (getRegion() == null){
+ regionNull();
+ }
+ else{
+ setTreeModel();
+ getCardlayoutPrincipal().show(inputPanePrincipal,"normale");
+ }
}
protected void setTreeModel(){
if (getRegion() != null){
@@ -148,8 +158,14 @@
setFieldCurrentRegionModel();
fieldCurrentRegion.setSelectedItem(name);
JButtonNewRegion.setEnabled(false);
+ fieldNewRegion.setText("");
setInfoText(_("isisfish.message.creation.finished"));
}
+protected void regionNull(){
+ getCardlayoutPrincipal().show(inputPanePrincipal,"none");
+ DefaultTreeModel model = new DefaultTreeModel(null);
+ navigation.setModel(model);
+}
protected void newChanged(){
JButtonNewRegion.setEnabled(true);
}
@@ -183,8 +199,9 @@
}
protected void removeRegion(){
setInfoText(_("isisfish.message.removing.region" + getRegionStorage().getName()));
+ setInfoText(getContextValue(InputAction.class).removeRegion(getRegionStorage(), false));
setFieldCurrentRegionModel();
- setInfoText(getContextValue(InputAction.class).removeRegion(getRegionStorage(), false));
+ regionNull();
}
protected void commitRegionInCVS(){
setInfoText(_("isisfish.message.commiting.region" + getRegionStorage().getName()));
@@ -237,6 +254,9 @@
</JScrollPane>
</JPanel>
</JPanel>
- <JPanel id="inputPane" layout='{cardlayout}'/>
+ <JPanel id='inputPanePrincipal' layout='{getCardlayoutPrincipal()}'>
+ <NoneUI id='noneUI' constraints='{"none"}'/>
+ <JPanel id="inputPane" layout='{getCardlayout()}' constraints='{"normale"}'/>
+ </JPanel>
</JSplitPane>
</JPanel>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx 2009-02-04 15:39:12 UTC (rev 1788)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/NoneUI.jaxx 2009-02-04 15:41:06 UTC (rev 1789)
@@ -1,3 +1,3 @@
<JPanel layout='{new BorderLayout()}'>
- <JLabel id='none' horizontalAlignment="0" text="isisfish.input.selectNodeTree" constraints='BorderLayout.CENTER'/>
+ <JLabel id='none' horizontalAlignment="0" text="isisfish.input.selectRegion" constraints='BorderLayout.CENTER'/>
</JPanel>
\ No newline at end of file
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2009-02-04 15:39:12 UTC (rev 1788)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/PortUI.jaxx 2009-02-04 15:41:06 UTC (rev 1789)
@@ -58,6 +58,14 @@
protected OMToolSet toolSet = new OMToolSet();
protected OpenMapEvents mapListener = null;
+boolean portChanged = true;
+
+portMap.setFisheryRegion(getRegion());
+portMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
+portMap.setActiveMouseMode(new SelectMouseMode());
+toolSet.setupListeners(portMap);
+toolMap.add((Component)toolSet);
+setMapListener();
setButtonTitle(_("isisfish.input.continueSpecies"));
setNextPath("$root/$species");
addPropertyChangeListener("bean", new PropertyChangeListener() {
@@ -81,24 +89,16 @@
getVerifier().setDeleteButton(remove);
Port port = getVerifier().getEntity(Port.class);
setBean((PortImpl) port);
- portMap.setFisheryRegion(getRegion());
- if(mapListener == null){
- portMap.setSelectionMode(CellSelectionLayer.SINGLE_SELECTION);
- portMap.setActiveMouseMode(new SelectMouseMode());
- toolSet.setupListeners(portMap);
- toolMap.add((Component)toolSet);
- setMapListener();
- }
+ fillList();
+}
+protected void fillList(){
if (getBean() != null){
+ portChanged = false;
portCell.fillList(getRegion().getCell(), getBean().getCell());
+ portCell.setSelectedValue(getBean().getCell());
+ portChanged = true;
}
- refreshMap();
}
-protected void refreshMap(){
- java.util.List<Cell> cells = new ArrayList<Cell>();
- cells.add((Cell)portCell.getSelectedValue());
- portMap.setSelectedCells(cells);
-}
protected void setMapListener(){
if (mapListener == null){
mapListener = new OpenMapEvents(portMap, new SelectMouseMode(false), CellSelectionLayer.SINGLE_SELECTION) {
@@ -110,12 +110,16 @@
getBean().setCell(c);
}
}
- refresh();
return true;
}
};
}
}
+protected void portChanged(){
+ if (portChanged){
+ getBean().setCell((Cell)portCell.getSelectedValue());
+ }
+}
]]>
</script>
<Table id='body'>
@@ -143,7 +147,7 @@
<row>
<cell columns='2' fill='both' weighty='0.7' weightx='1.0'>
<JScrollPane>
- <JList id="portCell" selectionMode="0" onMouseClicked='getBean().setCell((Cell)portCell.getSelectedValue());refreshMap();' enabled='{isActif()}'/>
+ <JList id="portCell" selectedValue='{getBean().getCell()}' selectionMode="0" onMouseClicked='portChanged()' enabled='{isActif()}'/>
</JScrollPane>
</cell>
</row>
@@ -178,7 +182,7 @@
</Table>
<JPanel id='map' layout='{new BorderLayout()}'>
<fr.ifremer.isisfish.map.OpenMapToolPanel id='toolMap' javaBean='new fr.ifremer.isisfish.map.OpenMapToolPanel()' constraints='BorderLayout.NORTH'/>
- <fr.ifremer.isisfish.map.IsisMapBean id='portMap' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()' constraints='BorderLayout.CENTER'/>
+ <fr.ifremer.isisfish.map.IsisMapBean id='portMap' selectedCells='{getBean().getCell()}' javaBean='new fr.ifremer.isisfish.map.IsisMapBean()' constraints='BorderLayout.CENTER'/>
</JPanel>
</JSplitPane>
</cell>
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2009-02-04 15:39:12 UTC (rev 1788)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/ui/input/VesselTypeUI.jaxx 2009-02-04 15:41:06 UTC (rev 1789)
@@ -42,6 +42,8 @@
import fr.ifremer.isisfish.entities.TripType;
import fr.ifremer.isisfish.types.TimeUnit;
+boolean tripTypeChanged = true;
+
setButtonTitle(_("isisfish.input.continueSetOfVessels"));
setNextPath("$root/$setOfVessels");
addPropertyChangeListener("bean", new PropertyChangeListener() {
@@ -73,16 +75,20 @@
VesselType vesselType = getVerifier().getEntity(VesselType.class);
setBean((VesselTypeImpl) vesselType);
if (getBean() != null){
+ tripTypeChanged = false;
vesselTypeTripType.fillList(getRegion().getTripType(), getBean().getTripType() == null ? null : getBean().getTripType());
+ tripTypeChanged = true;
}
}
protected void tripTypeChanged(){
- Object[] values = vesselTypeTripType.getSelectedValues();
- Collection<TripType> tripTypes = new LinkedList<TripType>();
- for (Object o : values){
- tripTypes.add((TripType)o);
+ if (tripTypeChanged){
+ Object[] values = vesselTypeTripType.getSelectedValues();
+ Collection<TripType> tripTypes = new LinkedList<TripType>();
+ for (Object o : values){
+ tripTypes.add((TripType)o);
+ }
+ getBean().setTripType(tripTypes);
}
- getBean().setTripType(tripTypes);
}
]]></script>
<Table id='body' constraints='BorderLayout.CENTER'>
1
0
r1788 - isis-fish/trunk/src/main/resources/i18n
by sletellier@users.labs.libre-entreprise.org 04 Feb '09
by sletellier@users.labs.libre-entreprise.org 04 Feb '09
04 Feb '09
Author: sletellier
Date: 2009-02-04 15:39:12 +0000 (Wed, 04 Feb 2009)
New Revision: 1788
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Debug traduction
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-02-04 14:58:44 UTC (rev 1787)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-02-04 15:39:12 UTC (rev 1788)
@@ -472,6 +472,7 @@
isisfish.input.menu.server=Server
isisfish.input.newRegion=New region
isisfish.input.selectNodeTree=Select node in tree
+isisfish.input.selectRegion=Select region
isisfish.input.title=Fishery input
isisfish.launch.anonymous=read only
isisfish.launch.debugMode=debug mode
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-02-04 14:58:44 UTC (rev 1787)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-02-04 15:39:12 UTC (rev 1788)
@@ -472,6 +472,7 @@
isisfish.input.menu.server=Serveur
isisfish.input.newRegion=Nouvelle r\u00E9gion
isisfish.input.selectNodeTree=S\u00E9lectionnez un noeud de l'arbre
+isisfish.input.selectRegion=S\u00E9lectionnez une r\u00E9gion
isisfish.input.title=Saisie de la p\u00EAcherie
isisfish.launch.anonymous=lecture seule
isisfish.launch.debugMode=debug mode
@@ -568,7 +569,7 @@
isisfish.message.remove.canceled=Suppression annul\u00E9e
isisfish.message.remove.finished=Suppresison termin\u00E9
isisfish.message.remove.unnecessary.cells=
-isisfish.message.removing.region=Suppression de lar\u00E9gion %1$s ...
+isisfish.message.removing.region=Suppression de la r\u00E9gion %1$s ...
isisfish.message.result.verif.region=R\u00E9sultat de la v\u00E9rification de la r\u00E9gion
isisfish.message.save.finished=Sauvegarde termin\u00E9e
isisfish.message.saveModel.dialog=Nom du model \u00E0 sauvegarder
1
0
r1787 - in isis-fish/trunk/src: main/java/fr/ifremer/isisfish/vcs test/java/fr/ifremer/isisfish/vcs
by chatellier@users.labs.libre-entreprise.org 04 Feb '09
by chatellier@users.labs.libre-entreprise.org 04 Feb '09
04 Feb '09
Author: chatellier
Date: 2009-02-04 14:58:44 +0000 (Wed, 04 Feb 2009)
New Revision: 1787
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/vcs/VCSSVNTest.java
Log:
MOdification de certains parametres, pour pesser les lock...
Ajout de tests.
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2009-02-04 10:31:59 UTC (rev 1786)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/vcs/VCSSVN.java 2009-02-04 14:58:44 UTC (rev 1787)
@@ -962,7 +962,7 @@
long newRevision = updateClient.doUpdate(localFile, // File file
SVNRevision.HEAD, // SVNRevision revision
recurse ? SVNDepth.INFINITY : SVNDepth.FILES, // SVNDepth depth
- false, // boolean allowUnversionedObstructions
+ true, // boolean allowUnversionedObstructions
false); // boolean depthIsSticky
if (log.isInfoEnabled()) {
@@ -1097,7 +1097,7 @@
//getSVNManager().getUpdateClient().doSwitch(
// localRoot, newUrl, SVNRevision.HEAD, true);
- // svnkit 1.3 code
+ // svnkit 1.2 code
SVNUpdateClient updateClient = getSVNManager()
.getUpdateClient();
long newRevision = updateClient.doSwitch(localRoot, // File path
@@ -1105,9 +1105,13 @@
SVNRevision.HEAD, // SVNRevision pegRevision
SVNRevision.HEAD, // SVNRevision revision
SVNDepth.INFINITY, // SVNDepth depth
- false, // boolean allowUnversionedObstructions
- true);// boolean depthIsSticky
+ true, // boolean allowUnversionedObstructions
+ false);// boolean depthIsSticky
+ // chatellier: allowUnversionedObstructions must be true
+ // if there is unversionned file or folder in repo, update will fail
+ // with org.tmatesoft.svn.core.SVNException: svn: Unable to lock 'xxx'
+
if (log.isInfoEnabled()) {
log.info(_("isisfish.vcs.vcssvn.global.torevision", newRevision));
}
Modified: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/vcs/VCSSVNTest.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/vcs/VCSSVNTest.java 2009-02-04 10:31:59 UTC (rev 1786)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/vcs/VCSSVNTest.java 2009-02-04 14:58:44 UTC (rev 1787)
@@ -35,6 +35,7 @@
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
+import org.tmatesoft.svn.core.SVNCommitInfo;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNURL;
@@ -43,8 +44,11 @@
import org.tmatesoft.svn.core.wc.SVNCopySource;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNStatus;
+import org.tmatesoft.svn.core.wc.SVNUpdateClient;
import org.tmatesoft.svn.core.wc.SVNWCClient;
+import fr.ifremer.isisfish.IsisFish;
+
/**
* Class de test VCS.
*
@@ -60,35 +64,38 @@
/** Class logger */
private static Log log = LogFactory.getLog(VCSSVNTest.class);
-
+
public static final String TMPDIR = System.getProperty("java.io.tmpdir");
-
+
public static final String FILECONTENTTAG = "Version 3.1.0";
public static final String FILECONTENTTRUNK = "Version 3.2.0";
-
+
protected static File template;
protected static File remoteRepo;
protected static File localRepo;
protected static File localRepoTrunk;
-
+
protected VCSSVN vcs = null;
-
+
/**
* Constructor.
*/
public VCSSVNTest() {
-
+
}
-
+
/**
* Static test init.
+ * @throws Exception
*/
@BeforeClass
- public static void init() {
- template = new File(TMPDIR + "/testsvn-template");
- remoteRepo = new File(TMPDIR + "/testsvn-repo");
- localRepo = new File(TMPDIR + "/testsvn-local");
- localRepoTrunk = new File(TMPDIR + "/testsvn-localTrunk");
+ public static void init() throws Exception {
+ IsisFish.init();
+
+ template = new File(TMPDIR, "testsvn-template");
+ remoteRepo = new File(TMPDIR, "testsvn-repo");
+ localRepo = new File(TMPDIR, "testsvn-local");
+ localRepoTrunk = new File(TMPDIR, "testsvn-localTrunk");
}
/**
@@ -110,7 +117,7 @@
FileUtil.deleteRecursively(localRepoTrunk);
}
}
-
+
/**
* Init call before each test.
* @throws IOException
@@ -118,62 +125,61 @@
*/
@Before
public void setUp() throws IOException, SVNException {
-
+
// un peu de nettoyage
clean();
-
+
// creation de l'instance de notre VCS pour les tests
// on le fait au debut pour que la l'init de la lib svn soit fait
// par la classe elle meme et ainsi tester que ca marche
- vcs = new VCSSVN(
- localRepo,
- "file",
- "",
- remoteRepo.getAbsolutePath() + "/isis-fish-data",
- null,
- "", "");
-
+ vcs = new VCSSVN(localRepo, "file", "", remoteRepo.getAbsolutePath()
+ + "/isis-fish-data", null, "", "");
+
// Creation d'un repo local avec un trunk et un tag
// durant le test, on modifie version.txt pour utiliser
// fileContentTrunk et modifier le contenu. On peut alors tester
// le changement de tag en fonction du contenu du fichier
-
+
// creation d'un template de directory
- new File(template, "regions" + File.separator + "DemoRegion" + File.separator + "data").mkdirs();
- new File(template, "simulations" + File.separator + "simu1" + File.separator + "data").mkdirs();
+ new File(template, "regions" + File.separator + "DemoRegion"
+ + File.separator + "data").mkdirs();
+ new File(template, "simulations" + File.separator + "simu1"
+ + File.separator + "data").mkdirs();
new File(template, "scripts").mkdirs();
- FileUtil.writeString(new File(template, "scripts" + File.separator + "version.txt"), FILECONTENTTAG);
+ FileUtil.writeString(new File(template, "scripts" + File.separator
+ + "version.txt"), FILECONTENTTAG);
// creation du repo pour les tests
SVNRepositoryFactory.createLocalRepository(remoteRepo, false, true);
-
+
// ajout de source dans le repo
- SVNURL svnURL = SVNURL.parseURIDecoded("file://" + remoteRepo.getAbsolutePath());
+ SVNURL svnURL = SVNURL.parseURIDecoded("file://"
+ + remoteRepo.getAbsolutePath());
SVNURL svnRoot = svnURL.appendPath("isis-fish-data", false);
SVNURL svnTrunk = svnRoot.appendPath("trunk", false);
SVNURL svnTags = svnRoot.appendPath("tags", false);
-
+
SVNClientManager svnManager = SVNClientManager.newInstance();
// creation de l'arborescence
- svnManager.getCommitClient().doMkDir(new SVNURL[]{svnRoot, svnTrunk, svnTags}, "add dir");
+ svnManager.getCommitClient().doMkDir(
+ new SVNURL[] { svnRoot, svnTrunk, svnTags }, "add dir");
//svnManager.getCommitClient().doImport(template, svnTrunk, "initial import", true, true);
- svnManager.getCommitClient().doImport(template, svnTrunk, "initial import", null, true, true, SVNDepth.INFINITY);
+ svnManager.getCommitClient().doImport(template, svnTrunk,
+ "initial import", null, true, true, SVNDepth.INFINITY);
// 1.1.x svnManager.getCopyClient().doCopy(svnTrunk, SVNRevision.HEAD, svnTags.appendPath("3.1.0", false), false, true, "Create tag");
- SVNCopySource source = new SVNCopySource(SVNRevision.HEAD, SVNRevision.HEAD, svnTrunk);
-
- svnManager.getCopyClient().doCopy(
- new SVNCopySource[]{source},
- svnTags.appendPath("3.1.0", false),
- false, /*isMove*/
+ SVNCopySource source = new SVNCopySource(SVNRevision.HEAD,
+ SVNRevision.HEAD, svnTrunk);
+
+ svnManager.getCopyClient().doCopy(new SVNCopySource[] { source },
+ svnTags.appendPath("3.1.0", false), false, /*isMove*/
true, /*makeParents*/
true, /*failWhenDstExists*/
- "Create tag",
- null);
+ "Create tag", null);
}
-
+
/**
* After each test.
*/
@@ -182,57 +188,58 @@
// un peu de nettoyage
//clean();
}
-
+
/**
* Test of getSVNManager method, of class VCSSVN.
*/
@Test
public void testgetSVNManager() {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testgetSVNManager()");
}
-
+
SVNClientManager result = vcs.getSVNManager();
Assert.assertNotNull(result);
}
-
+
/**
* Test of getRemoteURL method, of class VCSSVN.
* @throws SVNException
*/
@Test
public void testgetRemoteURL() throws SVNException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testgetRemoteURL()");
}
-
- SVNURL expResult = SVNURL.create("file", null, "", -1,
- remoteRepo.getAbsolutePath() + "/" + "isis-fish-data", true);
+
+ SVNURL expResult = SVNURL.create("file", null, "", -1, remoteRepo
+ .getAbsolutePath()
+ + "/" + "isis-fish-data", true);
SVNURL result = vcs.getRemoteURL();
Assert.assertEquals(expResult, result);
}
-
+
/**
* Test of isVersionnableAbleFile method, of class VCSSVN.
*/
@Test
public void testIsVersionnableAbleFile() {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsVersionnableAbleFile()");
}
-
+
// un fichier special, on refuse
File file = new File(".svn");
boolean result = vcs.isVersionnableAbleFile(file);
Assert.assertFalse(result);
-
+
// Pas dans le repository local, on refuse
file = new File("Toto.java");
result = vcs.isVersionnableAbleFile(file);
@@ -242,33 +249,33 @@
file = new File(vcs.getLocalRepository(), "Toto.java");
result = vcs.isVersionnableAbleFile(file);
Assert.assertEquals(true, result);
-
+
// match pas (svn ignore)
file = new File(vcs.getLocalRepository(), "libaudio.la");
result = vcs.isVersionnableAbleFile(file);
Assert.assertFalse(result);
-
+
// match pas (svn ignore)
file = new File(vcs.getLocalRepository(), "libaudio.lo");
result = vcs.isVersionnableAbleFile(file);
Assert.assertFalse(result);
-
+
// match (svn ignore)
file = new File(vcs.getLocalRepository(), "libaudio.lads");
result = vcs.isVersionnableAbleFile(file);
Assert.assertTrue(result);
-
+
// match pas (svn ignore)
file = new File(vcs.getLocalRepository(), "libaudio.lads~");
result = vcs.isVersionnableAbleFile(file);
Assert.assertFalse(result);
-
+
// match pas (svn ignore)
file = new File(vcs.getLocalRepository(), "commit.rev1234.rej");
result = vcs.isVersionnableAbleFile(file);
Assert.assertFalse(result);
}
-
+
/**
* Test of checkout method, of class VCSSVN.
* @throws IOException
@@ -276,133 +283,140 @@
*/
@Test
public void testAll() throws IOException, VCSException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsVersionnableAbleFile()");
}
-
+
// trunk contient une copie complete de trunk, elle permet de test
// status lors que l'on fait des commits sur le trunk sur instance
- VCSSVN trunk = new VCSSVN(
- localRepoTrunk,
- "file",
- "",
- remoteRepo.getAbsolutePath() + "/" + "isis-fish-data",
- null,
- "", "");
-
+ VCSSVN trunk = new VCSSVN(localRepoTrunk, "file", "", remoteRepo
+ .getAbsolutePath()
+ + "/" + "isis-fish-data", null, "", "");
+
trunk.checkout(null, true);
// on ne checkout rien juste le .svn dans le repertoire racine
vcs.checkout(null, false);
Assert.assertTrue(vcs.getLocalRepository().exists());
Assert.assertTrue(vcs.getTag().startsWith("/trunk"));
-
+
// update scripts dir
vcs.update(new File(vcs.getLocalRepository(), "scripts"), true);
- File version = new File(vcs.getLocalRepository(), "scripts" + File.separator + "version.txt");
+ File version = new File(vcs.getLocalRepository(), "scripts"
+ + File.separator + "version.txt");
Assert.assertTrue(version.exists());
Assert.assertEquals(FILECONTENTTAG, FileUtil.readAsString(version));
-
+
// modification du fichier version.txt
FileUtil.writeString(version, FILECONTENTTRUNK);
vcs.commit(null, "modif du fichier version");
Assert.assertEquals(FILECONTENTTRUNK, FileUtil.readAsString(version));
-
+
// recuperation de DemoRegion
- File demo = new File(vcs.getLocalRepository(), "regions" + File.separator + "DemoRegion");
+ File demo = new File(vcs.getLocalRepository(), "regions"
+ + File.separator + "DemoRegion");
vcs.update(demo, true);
Assert.assertTrue(demo.exists());
-
+
// suppression de DemoRegion
vcs.delete(Arrays.asList(demo), "suppression d'une region");
Assert.assertFalse(demo.exists());
-
+
// ajout d'un fichier sur le trunk avant passage sur le tag
File fileToAdd = new File(vcs.getLocalRepository(), "newfile.txt");
String lecontent = "Le nouveau fichier";
FileUtil.writeString(fileToAdd, lecontent);
vcs.add(Arrays.asList(fileToAdd), "ajout d'un fichier");
-
+
// test switchTag
vcs.setTag(new VersionNumber(3, 1, 0));
Assert.assertTrue(vcs.getTag().startsWith("/tags/3.1.0"));
Assert.assertEquals(FILECONTENTTAG, FileUtil.readAsString(version));
Assert.assertTrue(demo.exists());
-
+
// recherche du status des fichiers
- File fileVersion = new File(trunk.getLocalRepository(), "scripts" + File.separator + "version.txt");
- File fileDeleted = new File(trunk.getLocalRepository(), "regions" + File.separator + "DemoRegion");
- Map<File, SVNStatus> map = trunk.getRemoteStatus(trunk.getLocalRepository(), true);
+ File fileVersion = new File(trunk.getLocalRepository(), "scripts"
+ + File.separator + "version.txt");
+ File fileDeleted = new File(trunk.getLocalRepository(), "regions"
+ + File.separator + "DemoRegion");
+ Map<File, SVNStatus> map = trunk.getRemoteStatus(trunk
+ .getLocalRepository(), true);
Assert.assertEquals(2, map.size()); // version.txt modifie, DemoRegion supprimee
Assert.assertTrue(map.containsKey(fileVersion));
Assert.assertTrue(map.containsKey(fileDeleted));
-
+
// modif dans repo trunk de version pour qu'il y ait un conflit
FileUtil.writeString(fileVersion, "Le nouveau content de version");
-
+
// update global du repo trunk
List<File> conflictFile = trunk.update(null, true);
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("conflictFile: " + conflictFile.toString());
}
Assert.assertEquals(1, conflictFile.size());
Assert.assertTrue(conflictFile.contains(fileVersion));
-
+
File fileAdded = new File(trunk.getLocalRepository(), "newfile.txt");
Assert.assertEquals(lecontent, FileUtil.readAsString(fileAdded));
Assert.assertFalse(fileDeleted.exists());
// recherche du status des fichiers en remote, il ne doit plus y avoir de diff
- Map<File, SVNStatus> map2 = trunk.getRemoteStatus(trunk.getLocalRepository(), true);
+ Map<File, SVNStatus> map2 = trunk.getRemoteStatus(trunk
+ .getLocalRepository(), true);
Assert.assertEquals(0, map2.size());
// il doit toujours y avoir version.txt qui est modifier localement
- Map<File, SVNStatus> map3 = trunk.getLocalStatus(trunk.getLocalRepository(), true);
+ Map<File, SVNStatus> map3 = trunk.getLocalStatus(trunk
+ .getLocalRepository(), true);
Assert.assertEquals(1, map3.size());
Assert.assertTrue(map3.containsKey(fileVersion));
-
+
// on commit le fichier version.txt pour verifier qu'en local et remote
// il n'y a plus de modif
- trunk.commit(Arrays.asList(fileVersion), "Commit fichier version, avec les conflits");
- Map<File, SVNStatus> map4 = trunk.getRemoteStatus(trunk.getLocalRepository(), true);
+ trunk.commit(Arrays.asList(fileVersion),
+ "Commit fichier version, avec les conflits");
+ Map<File, SVNStatus> map4 = trunk.getRemoteStatus(trunk
+ .getLocalRepository(), true);
Assert.assertEquals(0, map4.size());
- Map<File, SVNStatus> map5 = trunk.getLocalStatus(trunk.getLocalRepository(), true);
+ Map<File, SVNStatus> map5 = trunk.getLocalStatus(trunk
+ .getLocalRepository(), true);
Assert.assertEquals(0, map5.size());
}
-
+
/**
* Test of add method, of class VCSSVN.
* @throws VCSException
*/
@Test
public void testAdd() throws VCSException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testAdd()");
}
-
+
List<File> files = new ArrayList<File>();
String msg = "";
// checkout a TAG
- vcs.checkout(new VersionNumber(3, 1, 0),false);
+ vcs.checkout(new VersionNumber(3, 1, 0), false);
try {
vcs.add(files, msg);
-
- Assert.fail("Une exception aurait du etre leve, car instance est" +
- " sur un tag, donc en readonly");
+
+ Assert.fail("Une exception aurait du etre leve, car instance est"
+ + " sur un tag, donc en readonly");
} catch (VCSException e) {
// l'exception est normal et fait partie du test
- if(log.isDebugEnabled()) {
- log.debug("VCSException has normally been thrown : " + e.getMessage());
+ if (log.isDebugEnabled()) {
+ log.debug("VCSException has normally been thrown : "
+ + e.getMessage());
}
}
}
-
+
/**
* Verifie la connexion et si le protocole a change, switch le repository
* pour utiliser le nouveau protocole. Si on est en mode interface (mode
@@ -412,12 +426,12 @@
*/
@Test
public void testCheckProtocol() throws VCSException {
-
+
vcs.checkout(null, false);
-
+
vcs.checkProtocol();
}
-
+
/**
* Return all changelog between local file version and remote repository
* file version.
@@ -427,40 +441,45 @@
*
*/
@Ignore
- public void testGetChanglog() throws VCSException, IOException, SVNException {
-
+ public void testGetChanglog() throws VCSException, IOException,
+ SVNException {
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testGetChanglog()");
}
-
- File firstFile = new File(vcs.getLocalRepository() + File.separator + "scripts" + File.separator + "version.txt");
- File secondFile = new File(vcs.getLocalRepository() + File.separator + "simulations" + File.separator + "simu1" + File.separator + "simulation.properties");
+
+ File firstFile = new File(vcs.getLocalRepository() + File.separator
+ + "scripts" + File.separator + "version.txt");
+ File secondFile = new File(vcs.getLocalRepository() + File.separator
+ + "simulations" + File.separator + "simu1" + File.separator
+ + "simulation.properties");
List<File> files = new ArrayList<File>();
files.add(firstFile);
files.add(secondFile);
-
+
Map<File, String> expResult = new HashMap<File, String>();
expResult.put(new File("ooo"), "eee");
-
+
// first, checkout trunk
vcs.checkout(null, true);
-
+
// now, make a modification, on LOCAL repo
FileUtil.writeString(firstFile, "version 3.2.1");
FileUtil.writeString(secondFile, "name = test1");
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getWCClient().doAdd(
- secondFile, // File path
+ svnManager.getWCClient().doAdd(secondFile, // File path
true, // boolean force
false, // boolean mkdir
true, // boolean climbUnversionedParents
SVNDepth.FILES, // SVNDepth depth
false, // boolean includeIgnored
true); // boolean makeParents
- svnManager.getCommitClient().doCommit(new File[]{firstFile, secondFile}, false,
- "mise a jour de la version", null, null, false, true, SVNDepth.INFINITY);
-
+ svnManager.getCommitClient().doCommit(
+ new File[] { firstFile, secondFile }, false,
+ "mise a jour de la version", null, null, false, true,
+ SVNDepth.INFINITY);
+
Map<File, String> result = vcs.getChanglog(files);
Assert.assertEquals(expResult, result);
}
@@ -472,21 +491,22 @@
*/
@Test
public void testGetDiff() throws VCSException, IOException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testGetDiff()");
}
-
- File firstFile = new File(vcs.getLocalRepository() + File.separator + "scripts" + File.separator + "version.txt");
-
+
+ File firstFile = new File(vcs.getLocalRepository() + File.separator
+ + "scripts" + File.separator + "version.txt");
+
vcs.checkout(null, true);
-
+
// now, make a modification, on LOCAL repo
FileUtil.writeString(firstFile, "Version 3.2.1");
String result = vcs.getDiff(firstFile);
-
+
// quelques tests sur la sortie, pas
// d'égalité parfaite
Assert.assertTrue(result.indexOf("version.txt") > 0);
@@ -501,14 +521,14 @@
*/
@Test
public void testGetFileList() throws VCSException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testGetFileList()");
}
vcs.checkout(null, true);
-
+
File directory = null;
List<String> expResult = new ArrayList<String>(3);
expResult.add("regions");
@@ -517,7 +537,7 @@
List<String> result = vcs.getFileList(directory);
Assert.assertEquals(expResult, result);
}
-
+
/**
* Test of getFileList method, of class VCSSVN.
* @throws VCSException
@@ -525,28 +545,27 @@
*/
@Test
public void testGetFileList2() throws VCSException, SVNException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testGetFileList2()");
}
vcs.checkout(null, true);
-
+
// add new directory
File newDir = new File(vcs.getLocalRepository() + "/testadddir");
newDir.mkdir();
-
+
SVNWCClient wcClient = vcs.getSVNManager().getWCClient();
- wcClient.doAdd(
- newDir, // File path
+ wcClient.doAdd(newDir, // File path
true, // boolean force
false, // boolean mkdir
true, // boolean climbUnversionedParents
SVNDepth.FILES, // SVNDepth depth
false, // boolean includeIgnored
true); // boolean makeParents
-
+
// previous added dir, should not appear in list
File directory = null;
List<String> expResult = new ArrayList<String>(3);
@@ -567,22 +586,23 @@
*/
@Test
public void testGetFileList3() throws VCSException, SVNException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testGetFileList3()");
}
-
+
// checkout current trunk
vcs.checkout(null, true);
// now, make a modification, on REMOTE repo
- SVNURL svnURL = SVNURL.parseURIDecoded("file://" + remoteRepo.getAbsolutePath());
+ SVNURL svnURL = SVNURL.parseURIDecoded("file://"
+ + remoteRepo.getAbsolutePath());
SVNURL svnURLNewDir = svnURL.appendPath("isis-fish-data", false)
- .appendPath("trunk", false)
- .appendPath("test", false);
+ .appendPath("trunk", false).appendPath("test", false);
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getCommitClient().doMkDir(new SVNURL[]{svnURLNewDir}, "add test dir");
+ svnManager.getCommitClient().doMkDir(new SVNURL[] { svnURLNewDir },
+ "add test dir");
// previous added dir, should appear in list
File directory = null;
@@ -594,7 +614,7 @@
List<String> result = vcs.getFileList(directory);
Assert.assertEquals(expResult, result);
}
-
+
/**
* Test of getUpdatedFile method, of class VCSSVN.
* @throws VCSException
@@ -602,32 +622,35 @@
* @throws SVNException
*/
@Test
- public void testGetUpdatedFile() throws VCSException, IOException, SVNException {
-
+ public void testGetUpdatedFile() throws VCSException, IOException,
+ SVNException {
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testGetUpdatedFile()");
}
-
+
List<File> expResult = new ArrayList<File>();
- expResult.add(new File(vcs.getLocalRepository().getAbsolutePath() + File.separator + "test"));
+ expResult.add(new File(vcs.getLocalRepository().getAbsolutePath()
+ + File.separator + "test"));
expResult.add(vcs.getLocalRepository());
-
+
// checkout current trunk
vcs.checkout(null, true);
-
+
// now, make a modification, on REMOTE repo
- SVNURL svnURL = SVNURL.parseURIDecoded("file://" + remoteRepo.getAbsolutePath());
+ SVNURL svnURL = SVNURL.parseURIDecoded("file://"
+ + remoteRepo.getAbsolutePath());
SVNURL svnURLNewDir = svnURL.appendPath("isis-fish-data", false)
- .appendPath("trunk", false)
- .appendPath("test", false);
+ .appendPath("trunk", false).appendPath("test", false);
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getCommitClient().doMkDir(new SVNURL[]{svnURLNewDir}, "add test dir");
-
+ svnManager.getCommitClient().doMkDir(new SVNURL[] { svnURLNewDir },
+ "add test dir");
+
List<File> result = vcs.getUpdatedFile();
Assert.assertEquals(expResult, result);
}
-
+
/**
* Test of getUpdatedFile method, of class VCSSVN.
* @throws VCSException
@@ -635,21 +658,22 @@
* @throws SVNException
*/
@Test
- public void testGetUpdatedFileEmptyResult() throws VCSException, IOException, SVNException {
-
+ public void testGetUpdatedFileEmptyResult() throws VCSException,
+ IOException, SVNException {
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testGetUpdatedFile()");
}
List<File> expResult = new ArrayList<File>();
-
+
// checkout current trunk
vcs.checkout(null, true);
-
+
List<File> result = vcs.getUpdatedFile();
Assert.assertEquals(expResult, result);
-
+
}
/**
@@ -660,27 +684,28 @@
*/
@Test
public void testHaveUpdate() throws VCSException, SVNException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testHaveUpdate()");
}
// checkout current trunk
vcs.checkout(null, true);
-
+
// now, make a modification, on REMOTE repo
- SVNURL svnURL = SVNURL.parseURIDecoded("file://" + remoteRepo.getAbsolutePath());
+ SVNURL svnURL = SVNURL.parseURIDecoded("file://"
+ + remoteRepo.getAbsolutePath());
SVNURL svnURLNewDir = svnURL.appendPath("isis-fish-data", false)
- .appendPath("trunk", false)
- .appendPath("test", false);
+ .appendPath("trunk", false).appendPath("test", false);
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getCommitClient().doMkDir(new SVNURL[]{svnURLNewDir}, "add test dir");
-
+ svnManager.getCommitClient().doMkDir(new SVNURL[] { svnURLNewDir },
+ "add test dir");
+
boolean result = vcs.haveUpdate();
Assert.assertTrue(result);
}
-
+
/**
* Ask if there are some new or modified files on server.
*
@@ -689,15 +714,15 @@
*/
@Test
public void testHaveNoUpdate() throws VCSException, SVNException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testHaveNoUpdate()");
}
// checkout current trunk
vcs.checkout(null, true);
-
+
boolean result = vcs.haveUpdate();
Assert.assertFalse(result);
}
@@ -707,9 +732,9 @@
*/
@Test
public void testIsConnected() {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsConnected()");
}
@@ -723,38 +748,39 @@
*/
@Test
public void testIsOnRemote() throws VCSException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsOnRemote()");
}
vcs.checkout(null, false);
-
+
File file = null;
boolean result = vcs.isOnRemote(file);
Assert.assertTrue(result);
}
-
+
/**
* Test of isOnRemote method, of class VCSSVN.
* @throws VCSException
*/
@Test
public void testIsOnRemote2() throws VCSException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsOnRemote2()");
}
vcs.checkout(null, false);
-
- File file = new File(vcs.getLocalRepository() + File.separator + "scripts" + File.separator + "version.txt");
+
+ File file = new File(vcs.getLocalRepository() + File.separator
+ + "scripts" + File.separator + "version.txt");
boolean result = vcs.isOnRemote(file);
Assert.assertTrue(result);
}
-
+
/**
* Test of isOnRemote method, of class VCSSVN.
* @throws VCSException
@@ -762,27 +788,28 @@
*/
@Test
public void testIsOnRemote3() throws VCSException, SVNException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsOnRemote3()");
}
vcs.checkout(null, false);
-
+
// now, make a modification, on REMOTE repo
- SVNURL svnURL = SVNURL.parseURIDecoded("file://" + remoteRepo.getAbsolutePath());
+ SVNURL svnURL = SVNURL.parseURIDecoded("file://"
+ + remoteRepo.getAbsolutePath());
SVNURL svnURLNewDir = svnURL.appendPath("isis-fish-data", false)
- .appendPath("trunk", false)
- .appendPath("test", false);
+ .appendPath("trunk", false).appendPath("test", false);
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getCommitClient().doMkDir(new SVNURL[]{svnURLNewDir}, "add test dir");
-
+ svnManager.getCommitClient().doMkDir(new SVNURL[] { svnURLNewDir },
+ "add test dir");
+
File file = new File(vcs.getLocalRepository() + File.separator + "test");
boolean result = vcs.isOnRemote(file);
Assert.assertTrue(result);
}
-
+
/**
* Test of isOnRemote method, of class VCSSVN.
* @throws VCSException
@@ -790,27 +817,29 @@
*/
@Test
public void testIsOnRemote4() throws VCSException, SVNException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsOnRemote4()");
}
vcs.checkout(null, false);
-
+
// now, make a modification, on REMOTE repo
- SVNURL svnURL = SVNURL.parseURIDecoded("file://" + remoteRepo.getAbsolutePath());
+ SVNURL svnURL = SVNURL.parseURIDecoded("file://"
+ + remoteRepo.getAbsolutePath());
SVNURL svnURLNewDir = svnURL.appendPath("isis-fish-data", false)
- .appendPath("trunk", false)
- .appendPath("scripts", false);
+ .appendPath("trunk", false).appendPath("scripts", false);
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getCommitClient().doDelete(new SVNURL[]{svnURLNewDir}, "del scripts dir");
-
- File file = new File(vcs.getLocalRepository() + File.separator + "scripts");
+ svnManager.getCommitClient().doDelete(new SVNURL[] { svnURLNewDir },
+ "del scripts dir");
+
+ File file = new File(vcs.getLocalRepository() + File.separator
+ + "scripts");
boolean result = vcs.isOnRemote(file);
Assert.assertFalse(result);
}
-
+
/**
* Test of isOnRemote method, of class VCSSVN.
* @throws VCSException
@@ -818,21 +847,22 @@
* @throws IOException
*/
@Test
- public void testIsOnRemote5() throws VCSException, SVNException, IOException {
-
+ public void testIsOnRemote5() throws VCSException, SVNException,
+ IOException {
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsOnRemote5()");
}
vcs.checkout(null, false);
-
+
// modif on local repo
- File file = new File(vcs.getLocalRepository() + File.separator + "test.txt");
+ File file = new File(vcs.getLocalRepository() + File.separator
+ + "test.txt");
FileUtil.writeString(file, "name = test1");
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getWCClient().doAdd(
- file, // File path
+ svnManager.getWCClient().doAdd(file, // File path
true, // boolean force
false, // boolean mkdir
true, // boolean climbUnversionedParents
@@ -850,18 +880,18 @@
*/
@Test
public void testIsTag() throws VCSException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testGetDiff()");
}
- VersionNumber version = new VersionNumber(3,1,0);
+ VersionNumber version = new VersionNumber(3, 1, 0);
boolean expResult = true;
boolean result = vcs.isTag(version);
Assert.assertEquals(expResult, result);
- version = new VersionNumber(3,2,0);
+ version = new VersionNumber(3, 2, 0);
expResult = false;
result = vcs.isTag(version);
Assert.assertEquals(expResult, result);
@@ -873,20 +903,20 @@
*/
@Test
public void testIsUpToDate() throws VCSException {
-
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsUpToDate()");
}
vcs.checkout(null, false);
-
+
File file = null;
boolean result = vcs.isUpToDate(file);
Assert.assertTrue(result);
-
+
}
-
+
/**
* Test of isUpToDate method, of class VCSSVN.
* @throws VCSException
@@ -894,22 +924,23 @@
* @throws SVNException
*/
@Test
- public void testIsUpToDate2() throws VCSException, IOException, SVNException {
-
+ public void testIsUpToDate2() throws VCSException, IOException,
+ SVNException {
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsUpToDate2()");
}
// chechout
vcs.checkout(null, false);
-
+
// modif on local repo
- File file = new File(vcs.getLocalRepository() + File.separator + "test.txt");
+ File file = new File(vcs.getLocalRepository() + File.separator
+ + "test.txt");
FileUtil.writeString(file, "name = test1");
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getWCClient().doAdd(
- file, // File path
+ svnManager.getWCClient().doAdd(file, // File path
true, // boolean force
false, // boolean mkdir
true, // boolean climbUnversionedParents
@@ -919,9 +950,9 @@
boolean result = vcs.isUpToDate(file);
Assert.assertFalse(result);
-
+
}
-
+
/**
* Test of isUpToDate method, of class VCSSVN.
* @throws VCSException
@@ -929,27 +960,98 @@
* @throws SVNException
*/
@Test
- public void testIsUpToDate3() throws VCSException, IOException, SVNException {
-
+ public void testIsUpToDate3() throws VCSException, IOException,
+ SVNException {
+
// log
- if(log.isInfoEnabled()) {
+ if (log.isInfoEnabled()) {
log.info("testIsUpToDate3()");
}
// chechout
vcs.checkout(null, false);
-
+
// now, make a modification, on REMOTE repo
- SVNURL svnURL = SVNURL.parseURIDecoded("file://" + remoteRepo.getAbsolutePath());
+ SVNURL svnURL = SVNURL.parseURIDecoded("file://"
+ + remoteRepo.getAbsolutePath());
SVNURL svnURLNewDir = svnURL.appendPath("isis-fish-data", false)
- .appendPath("trunk", false)
- .appendPath("test", false);
+ .appendPath("trunk", false).appendPath("test", false);
SVNClientManager svnManager = SVNClientManager.newInstance();
- svnManager.getCommitClient().doMkDir(new SVNURL[]{svnURLNewDir}, "add test dir");
+ svnManager.getCommitClient().doMkDir(new SVNURL[] { svnURLNewDir },
+ "add test dir");
File file = new File(vcs.getLocalRepository() + File.separator + "test");
boolean result = vcs.isUpToDate(file);
Assert.assertFalse(result);
+
+ }
+
+ /**
+ * Test an update with a local locked file.
+ *
+ * - Checkout
+ * - commit modification
+ * - update at revision -1
+ * - lock one file
+ * - update at head
+ *
+ * @throws VCSException
+ * @throws SVNException
+ * @throws IOException
+ */
+ @Test
+ public void testUpdateWithLock() throws VCSException, SVNException,
+ IOException {
+
+ // log
+ if (log.isInfoEnabled()) {
+ log.info("testUpdateWithLock()");
+ }
+
+ // chechout
+ vcs.checkout(null, false);
+
+ // modif on remote repo
+ File file = new File(vcs.getLocalRepository(), "scripts"
+ + File.separator + "version.txt");
+ FileUtil.writeString(file, "aaaaaz");
+ SVNClientManager svnManager = SVNClientManager.newInstance();
+ SVNCommitInfo rev = svnManager.getCommitClient().doCommit(
+ new File[] { file },// File[] paths,
+ false, //boolean keepLocks,
+ "modify version", //String commitMessage,
+ null, //SVNProperties revisionProperties,
+ null,// String[] changelists,
+ false, //boolean keepChangelist,
+ false, //boolean force,
+ SVNDepth.INFINITY); //SVNDepth depth);
+
+ // display : At revision 4
+ log.debug("Commited, new revision is " + rev.getNewRevision());
+
+ // do a new checkout at revision n-1
+ SVNRevision revision = SVNRevision.create(rev.getNewRevision() - 1);
+ SVNClientManager svnManagerLocal = vcs.getSVNManager();
+ SVNUpdateClient updateClient = svnManagerLocal.getUpdateClient();
+ long newRevision = updateClient.doUpdate(vcs.getLocalRepository(), // File file
+ revision, // SVNRevision revision
+ SVNDepth.INFINITY, // SVNDepth depth
+ false, // boolean allowUnversionedObstructions
+ false); // boolean depthIsSticky
+ log.debug("Updated at revision " + newRevision);
+
+ // lock that file
+ /*File[] filesLocal = { new File(vcs.getLocalRepository(), "scripts"
+ + File.separator + "version.txt") };
+ SVNWCClient wcClient = svnManagerLocal.getWCClient();
+ wcClient.doLock(filesLocal, true, "add lock");*/
+
+ Map<File, SVNStatus> files = vcs.getRemoteStatus(null, true);
+ log.info("Will update file = " + files.keySet());
+ Assert.assertTrue("Must be one file updated", files.size() == 1);
+ // try to update...
+ List<File> filesInConflict = vcs.update(null, true);
+ Assert.assertTrue("No file should be in conflit", filesInConflict.isEmpty());
}
}
\ No newline at end of file
1
0
r1786 - isis-fish/trunk/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 04 Feb '09
by chatellier@users.labs.libre-entreprise.org 04 Feb '09
04 Feb '09
Author: chatellier
Date: 2009-02-04 10:31:59 +0000 (Wed, 04 Feb 2009)
New Revision: 1786
Modified:
isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
Log:
Ajout des cl?\195?\169s de configuration (qsub, remote tmp dir)
Doc
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-02-04 10:31:47 UTC (rev 1785)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-en_GB.properties 2009-02-04 10:31:59 UTC (rev 1786)
@@ -159,10 +159,14 @@
isisfish.config.main.regionMap.description=
isisfish.config.main.remoteCaparmor.description=
isisfish.config.main.resultExport.description=
+isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description=
+isisfish.config.main.simulation.ssh.control.check.interval.description=
isisfish.config.main.simulation.ssh.datapath.description=
+isisfish.config.main.simulation.ssh.isis.home.description=
isisfish.config.main.simulation.ssh.jarpath.description=
isisfish.config.main.simulation.ssh.login.description=
isisfish.config.main.simulation.ssh.server.description=
+isisfish.config.main.simulation.ssh.tmppath.description=
isisfish.config.main.simulationServer.description=
isisfish.config.main.simulationShowOnlyError.description=
isisfish.config.main.simulationShowOnlyQueue.description=
Modified: isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties
===================================================================
--- isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-02-04 10:31:47 UTC (rev 1785)
+++ isis-fish/trunk/src/main/resources/i18n/isis-fish-fr_FR.properties 2009-02-04 10:31:59 UTC (rev 1786)
@@ -159,10 +159,14 @@
isisfish.config.main.regionMap.description=le nom du r\u00E9pertoire contenant les maps d'une r\u00E9gion
isisfish.config.main.remoteCaparmor.description=lance les simulations sur un serveur distant
isisfish.config.main.resultExport.description=TODO
+isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description=
+isisfish.config.main.simulation.ssh.control.check.interval.description=
isisfish.config.main.simulation.ssh.datapath.description=
+isisfish.config.main.simulation.ssh.isis.home.description=
isisfish.config.main.simulation.ssh.jarpath.description=
isisfish.config.main.simulation.ssh.login.description=
isisfish.config.main.simulation.ssh.server.description=
+isisfish.config.main.simulation.ssh.tmppath.description=
isisfish.config.main.simulationServer.description=l'url du serveur de simulations distant
isisfish.config.main.simulationShowOnlyError.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles avec erreur
isisfish.config.main.simulationShowOnlyQueue.description=pour indiquer si l'on doit conserver dans l'UI des simulations termin\u00E9es uniquement celles effectu\u00E9es localement
1
0
r1785 - in isis-fish/trunk: . doc src/main/java/fr/ifremer/isisfish src/main/java/fr/ifremer/isisfish/simulator/launcher src/main/resources/ssh src/test/java/fr/ifremer/isisfish/simulator/launcher
by chatellier@users.labs.libre-entreprise.org 04 Feb '09
by chatellier@users.labs.libre-entreprise.org 04 Feb '09
04 Feb '09
Author: chatellier
Date: 2009-02-04 10:31:47 +0000 (Wed, 04 Feb 2009)
New Revision: 1785
Added:
isis-fish/trunk/doc/SimulationSSH.rst
isis-fish/trunk/src/main/resources/ssh/launch-isis-cron.seq
isis-fish/trunk/src/main/resources/ssh/launch-isis-qsub.seq
Removed:
isis-fish/trunk/src/main/resources/ssh/launch-isis.seq
Modified:
isis-fish/trunk/pom.xml
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java
Log:
Ajout des cl?\195?\169s de configuration (qsub, remote tmp dir)
Doc
Added: isis-fish/trunk/doc/SimulationSSH.rst
===================================================================
--- isis-fish/trunk/doc/SimulationSSH.rst (rev 0)
+++ isis-fish/trunk/doc/SimulationSSH.rst 2009-02-04 10:31:47 UTC (rev 1785)
@@ -0,0 +1,25 @@
+Configuration d'Isis
+====================
+
+Dans le fichier $HOME/.isis-config-3
+
+Il faut configurer les paramètres :
+
+ ssh.key.file=/home/username/.ssh/id_rsa
+ simulation.ssh.server=caparmor.ifremer.fr\:22
+ simulation.ssh.username=username
+ simulation.ssh.datapath=/home/username/isis-database-3
+ simulation.ssh.addscripttoqueuecommand=/usr/pbs/bin/qsub
+ simulation.ssh.isis.home=/home/chatellier/isis-fish-3.2.0.3
+ simulation.ssh.tmppath=/tmp
+ simulation.ssh.control.check.interval=5
+
+Le script qsub
+==============
+
+Le script qsub est dans src/main/resources/ssh
+(template freemarker).
+
+Il est uploadé et ajouté à qsub.
+
+(ie : qsub script)
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-02-04 10:03:57 UTC (rev 1784)
+++ isis-fish/trunk/pom.xml 2009-02-04 10:31:47 UTC (rev 1785)
@@ -302,7 +302,7 @@
<dependency>
<groupId>org.tmatesoft</groupId>
<artifactId>svnkit</artifactId>
- <version>1.2.1.5297</version>
+ <version>1.2.2.5405</version>
<scope>compile</scope>
</dependency>
<!-- fin svnkit pour communication subversion -->
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-02-04 10:03:57 UTC (rev 1784)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/IsisConfig.java 2009-02-04 10:31:47 UTC (rev 1785)
@@ -271,27 +271,61 @@
}
/**
- * Retourne le chemin complet du jar.
+ * Retourne le chemin relatif ou abs du repertoire
+ * root des données d'isis.
*
- * @return simulator jar path
+ * @return simulator data path
*/
- public String getSimulatorSshJarPath() {
- String result = getOption(Option.SIMULATOR_SSH_JARPATH.key);
+ public String getSimulatorSshDataPath() {
+ String result = getOption(Option.SIMULATOR_SSH_DATAPATH.key);
return result;
}
/**
- * Retourne le chemin relatif ou abs du repertoire
- * root des données d'isis.
+ * Retourne le chemin distant ou est installé isis.
*
- * @return simulator data path
+ * @return remote isis home
*/
- public String getSimulatorSshDataPath() {
- String result = getOption(Option.SIMULATOR_SSH_DATAPATH.key);
+ public String getSimulatorSshIsisHome() {
+ String result = getOption(Option.SIMULATOR_SSH_ISIS_HOME.key);
return result;
}
/**
+ * Retourne l'emplacement du dossier temporaire distant.
+ *
+ * Ce dossier doit être ABSOLUT.
+ *
+ * @return tmp dir
+ */
+ public String getSimulatorSshTmpPath() {
+ String result = getOption(Option.SIMULATOR_SSH_TMPPATH.key);
+ return result;
+ }
+
+ /**
+ * Retourne la commande a utiliser pour ajouter
+ * le script à la queue des simulation.
+ *
+ * @return add to queue command
+ */
+ public String getSimulatorSshAddToQueueCommand() {
+ String result = getOption(Option.SIMULATOR_SSH_ADDSCRIPTTOQUEUECOMMAND.key);
+ return result;
+ }
+
+ /**
+ * Retourne l'interval de temps a utiliser
+ * pour recuperer le fichier de control.
+ *
+ * @return time (in seconds)
+ */
+ public long getSimulatorSshControlCheckInterval() {
+ int result = getOptionAsInt(Option.SIMULATOR_SSH_CONTROLCHECKINTERVAL.key);
+ return result;
+ }
+
+ /**
* Retourne la clé privée de l'utilisteur courant.
*
* @return private ssh key path
@@ -646,8 +680,14 @@
SIMULATOR_SSH_USER_NAME("simulation.ssh.username", _("isisfish.config.main.simulation.ssh.login.description"), "isisfish"),
/** Serveur accessible par ssh : remote data path */
SIMULATOR_SSH_DATAPATH("simulation.ssh.datapath", _("isisfish.config.main.simulation.ssh.datapath.description"), "/home/" + SIMULATOR_SSH_USER_NAME.defaultValue + "/isis-database-3"),
- /** Serveur accessible par SSH : chemin complet du jar depuis le /home une fois connecté */
- SIMULATOR_SSH_JARPATH("simulation.ssh.jarpath", _("isisfish.config.main.simulation.ssh.jarpath.description"), "./isis-fish-" + getVersion() + "/isis-fish-" + getVersion() + ".jar"),
+ /** Serveur accessible par ssh : remote isis home install */
+ SIMULATOR_SSH_ISIS_HOME("simulation.ssh.isis.home", _("isisfish.config.main.simulation.ssh.isis.home.description"), "/home/" + SIMULATOR_SSH_USER_NAME.defaultValue + "/isis-fish"),
+ /** Serveur accessible par ssh : remote tmp path */
+ SIMULATOR_SSH_TMPPATH("simulation.ssh.tmppath", _("isisfish.config.main.simulation.ssh.tmppath.description"), "/tmp"),
+ /** Serveur accessible par SSH : chemin pour executer le script d'ajout des script dans la queue */
+ SIMULATOR_SSH_ADDSCRIPTTOQUEUECOMMAND("simulation.ssh.addscripttoqueuecommand", _("isisfish.config.main.simulation.ssh.addscripttoqueuecommand.description"), "/usr/pbs/bin/qsub"),
+ /** Serveur accessible par SSH : interval de check du fichier de control */
+ SIMULATOR_SSH_CONTROLCHECKINTERVAL("simulation.ssh.control.check.interval", _("isisfish.config.main.simulation.ssh.control.check.interval.description"), "5"),
LOCALE("locale", _("isisfish.config.main.locale.description"), "fr_FR"),
// REGION_MAP("regionMap", _("isisfish.config.main.regionMap.description"), "maps"),
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-02-04 10:03:57 UTC (rev 1784)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/simulator/launcher/SSHSimulatorLauncher.java 2009-02-04 10:31:47 UTC (rev 1785)
@@ -368,14 +368,23 @@
String localPath = simulationFile.getAbsolutePath();
- // Copy simulation file in same arch as local arch
- // on windows, it's a bad idee :)))
- // copy it always on caparmor remote temp dir ?
- // /tmp ?
- // TODO check it
+ // first check that remote directory exists
+ String remotePath = IsisFish.config.getSimulatorSshTmpPath();
+ String command = "if [ ! -d \"" + remotePath +"\" ] ; then mkdir \"" + remotePath + "\"; fi";
+ if(log.isInfoEnabled()) {
+ log.info("Creating remote temp directory (if not exists) " + remotePath);
+ if(log.isDebugEnabled()) {
+ log.debug("Executing command : " + command);
+ }
+ }
+ int exit = SSHUtils.exec(session, command);
+
+ if(exit != 0) {
+ throw new SSHException(_("Command '%s' fail to execute", command));
+ }
+
+ // upload directory in that dir
- String remotePath = "/tmp/";
-
if (localPath.lastIndexOf("/") > 0) {
remotePath += localPath.substring(localPath.lastIndexOf("/") + 1);
} else if (localPath.lastIndexOf("\\") > 0) { // windows
@@ -429,14 +438,10 @@
String localPath = simulationScript.getAbsolutePath();
- // Copy simulation file in same arch as local arch
- // on windows, it's a bad idee :)))
- // copy it always on caparmor remote temp dir ?
- // /tmp ?
- // TODO check it
+ String remotePath = IsisFish.config.getSimulatorSshTmpPath();
+ // remote temp directory should have been created
+ // by #downloadResults(Session, String)
- String remotePath = "/tmp/";
-
if (localPath.lastIndexOf("/") > 0) {
remotePath += localPath.substring(localPath.lastIndexOf("/") + 1);
} else if (localPath.lastIndexOf("\\") > 0) { // windows
@@ -468,7 +473,7 @@
File tempScript = File.createTempFile("launch-isis", ".seq");
tempScript.deleteOnExit(); // auto delete
- String fileContent = getSimulationScriptLaunchContent("ssh/launch-isis.seq", simuationId, simulationZip);
+ String fileContent = getSimulationScriptLaunchContent("ssh/launch-isis-qsub.seq", simuationId, simulationZip);
FileUtil.writeString(tempScript, fileContent);
return tempScript;
@@ -498,6 +503,7 @@
// context values
Map<String, Object> root = new HashMap<String, Object>();
+ root.put("isishome", IsisFish.config.getSimulatorSshIsisHome());
root.put("simulationid", simuationId);
root.put("simulationzip", simulationZip);
@@ -530,7 +536,7 @@
// command to :
// - add script in qsub queue
- String command = "qsub \"" + scriptRemotePath + "\"";
+ String command = IsisFish.config.getSimulatorSshAddToQueueCommand() + " \"" + scriptRemotePath + "\"";
int exit = SSHUtils.exec(session, command);
@@ -566,9 +572,6 @@
*/
protected class RemoteSSHControlThread implements Runnable {
- /** Sleep 1s */
- protected static final int SLEEPTIME = 1000;
-
/** Opened ssh session */
protected Session sshSession;
@@ -593,12 +596,14 @@
@Override
public void run() {
+ long sleepTime = IsisFish.config.getSimulatorSshControlCheckInterval() * 1000;
+
boolean running = true;
while (running) {
// wait
try {
- Thread.sleep(SLEEPTIME);
+ Thread.sleep(sleepTime);
// log (to check if thread is still alive)
if (log.isDebugEnabled()) {
Added: isis-fish/trunk/src/main/resources/ssh/launch-isis-cron.seq
===================================================================
--- isis-fish/trunk/src/main/resources/ssh/launch-isis-cron.seq (rev 0)
+++ isis-fish/trunk/src/main/resources/ssh/launch-isis-cron.seq 2009-02-04 10:31:47 UTC (rev 1785)
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+cd "${isishome}"
+#source /usr/share/modules/init/csh
+#module load java/1.6.0
+
+java -jar isis-fish-3.2.0.3.jar --option launch.ui false --simulateWithSimulation "${simulationid}" "${simulationzip}"
Copied: isis-fish/trunk/src/main/resources/ssh/launch-isis-qsub.seq (from rev 1773, isis-fish/trunk/src/main/resources/ssh/launch-isis.seq)
===================================================================
--- isis-fish/trunk/src/main/resources/ssh/launch-isis-qsub.seq (rev 0)
+++ isis-fish/trunk/src/main/resources/ssh/launch-isis-qsub.seq 2009-02-04 10:31:47 UTC (rev 1785)
@@ -0,0 +1,9 @@
+#!/bin/csh
+
+#PBS -l mem=1000mb
+
+cd "${isishome}"
+source /usr/share/modules/init/csh
+module load java/1.6.0
+
+java -jar isis-fish.jar --option launch.ui false --simulateWithSimulation "${simulationid}" "${simulationzip}"
Property changes on: isis-fish/trunk/src/main/resources/ssh/launch-isis-qsub.seq
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: isis-fish/trunk/src/main/resources/ssh/launch-isis.seq
===================================================================
--- isis-fish/trunk/src/main/resources/ssh/launch-isis.seq 2009-02-04 10:03:57 UTC (rev 1784)
+++ isis-fish/trunk/src/main/resources/ssh/launch-isis.seq 2009-02-04 10:31:47 UTC (rev 1785)
@@ -1,9 +0,0 @@
-#!/bin/csh
-
-#PBS -l mem=1000mb
-
-cd /export/home3/smahevas/isis-fish
-source /usr/share/modules/init/csh
-module load java/1.6.0
-
-java -jar isis-fish-3.2.0.3/isis-fish.jar --option launch.ui false --simulateWithSimulation "${simulationid}" "${simulationzip}"
Modified: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java 2009-02-04 10:03:57 UTC (rev 1784)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/simulator/launcher/SshSimulatorLauncherTest.java 2009-02-04 10:31:47 UTC (rev 1785)
@@ -24,6 +24,7 @@
import org.junit.Test;
+import fr.ifremer.isisfish.IsisFish;
import freemarker.template.TemplateException;
/**
@@ -50,17 +51,22 @@
@Test
public void testFreemarkerTemplate() throws IOException, TemplateException {
- final String TEMPLATE = "ssh/launch-isis.seq";
+ final String TEMPLATE = "ssh/launch-isis-qsub.seq";
final String SIMULATIONID = "testid";
final String SIMULATIONZIP = "test.zip";
-
+ final String ISISHOME = IsisFish.config.getSimulatorSshIsisHome();
+
SSHSimulatorLauncher launcher = new SSHSimulatorLauncher();
String content = launcher.getSimulationScriptLaunchContent(TEMPLATE, SIMULATIONID, SIMULATIONZIP);
+ // simulation parameters
Assert.assertTrue("String \"" + SIMULATIONID + "\" not found in template",
content.indexOf(SIMULATIONID) > 0);
-
Assert.assertTrue("String \"" + SIMULATIONZIP + "\" not found in template",
content.indexOf(SIMULATIONZIP) > 0);
+
+ // isis location
+ Assert.assertTrue("String \"" + ISISHOME + "\" not found in template",
+ content.indexOf(ISISHOME) > 0);
}
}
\ No newline at end of file
1
0
r1784 - isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore
by chatellier@users.labs.libre-entreprise.org 04 Feb '09
by chatellier@users.labs.libre-entreprise.org 04 Feb '09
04 Feb '09
Author: chatellier
Date: 2009-02-04 10:03:57 +0000 (Wed, 04 Feb 2009)
New Revision: 1784
Modified:
isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
Log:
Re ajout d'une methode d?\195?\169pr?\195?\169ci?\195?\169e qui est en fait toujours utilis?\195?\169e dans les scripts
Modified: isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java
===================================================================
--- isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2009-02-04 00:32:33 UTC (rev 1783)
+++ isis-fish/trunk/src/main/java/fr/ifremer/isisfish/datastore/SimulationStorage.java 2009-02-04 10:03:57 UTC (rev 1784)
@@ -499,7 +499,7 @@
* Retourne la {@link FisheryRegion} associee a cette simulation
* @param context
* @return
- * @throws fr.ifremer.isisfish.datastore.StorageException
+ * @throws StorageException
*/
static public FisheryRegion getFisheryRegion(TopiaContext context)
throws StorageException {
@@ -521,6 +521,29 @@
}
/**
+ * Retourne la {@link FisheryRegion} associee a cette simulation.
+ *
+ * Attention, toujours utilisée dans les scripts !!!
+ *
+ * @return la {@link FisheryRegion}
+ * @throws StorageException
+ * @deprecated ne plus utiliser car le context n'est jamais ferme, plutot
+ * utiliser {@link #getFisheryRegion(TopiaContext)}
+ */
+ public FisheryRegion getFisheryRegion() throws StorageException {
+ // FIXME voir si la methode est vraiment utilisée car le context n'est
+ // jamais fermé, ce qui est dérangeant
+ try {
+ TopiaContext tx = getStorage().beginTransaction();
+ FisheryRegion result = getFisheryRegion(tx);
+ tx.commitTransaction();
+ return result;
+ } catch (TopiaException eee) {
+ throw new StorageException(_("isisfish.error.get.fisheryRegion"), eee);
+ }
+ }
+
+ /**
* Checkout not existing Simulation localy from server
*
* @param name name of simulation to retrieve
1
0
Author: tchemit
Date: 2009-02-04 00:32:33 +0000 (Wed, 04 Feb 2009)
New Revision: 1783
Modified:
isis-fish/trunk/pom.xml
Log:
- nettoayge pom
- utilisation nouveau patch pour le plugin webstart (on peut tester localement le jnlp via la variable jnlpCodebase). (par contre probleme de chargement de region, le fameux NPE dans la migration : encore un probleme de lutinutil Resource je pense...)
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-02-03 22:29:34 UTC (rev 1782)
+++ isis-fish/trunk/pom.xml 2009-02-04 00:32:33 UTC (rev 1783)
@@ -349,7 +349,7 @@
<topia.version>2.1.3-SNAPSHOT</topia.version>
<lutinmatrix.version>1.2-SNAPSHOT</lutinmatrix.version>
<lutinutil.version>1.0.3-SNAPSHOT</lutinutil.version>
- <lutinwidget.version>0.12</lutinwidget.version>
+ <lutinwidget.version>0.12</lutinwidget.version>
<generator.version>0.64-SNAPSHOT</generator.version>
<openmap.version>4.6.4</openmap.version>
@@ -361,6 +361,10 @@
<keystorealias>CodeLutin</keystorealias>
<keystorepass>codelutin</keystorepass>
<jnlp.build.directory>${project.build.directory}/jnlp</jnlp.build.directory>
+
+ <!--jnlpCodebase>${project.url}</jnlpCodebase-->
+ <!-- to test jnlp file locally -->
+ <jnlpCodebase>file://${jnlp.build.directory}</jnlpCodebase>
</properties>
<build>
@@ -433,33 +437,6 @@
</configuration>
</execution>
</executions>
- <!--dependencies>
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinwidget</artifactId>
- <version>${lutinwidget.version}</version>
- </dependency>
- <dependency>
- <groupId>org.codelutin.topia</groupId>
- <artifactId>topia-persistence</artifactId>
- <version>${topia.version}</version>
- </dependency>
- <dependency>
- <groupId>jfreechart</groupId>
- <artifactId>jfreechart</artifactId>
- <version>0.9.3</version>
- </dependency>
- <dependency>
- <groupId>org.codelutin</groupId>
- <artifactId>lutinmatrix</artifactId>
- <version>${lutinmatrix.version}</version>
- </dependency>
- <dependency>
- <groupId>openmap</groupId>
- <artifactId>openmap</artifactId>
- <version>${openmap.version}</version>
- </dependency>
- </dependencies-->
</plugin>
<plugin>
@@ -524,7 +501,6 @@
<executions>
<execution>
<id>copy-dependencies</id>
- <!--phase>package</phase-->
</execution>
</executions>
<configuration>
@@ -538,7 +514,6 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
- <!--mainClass>${maven.jar.main.class}</mainClass-->
<classpathPrefix>./lib/</classpathPrefix>
</manifest>
</archive>
@@ -546,16 +521,7 @@
</plugin>
</plugins>
- <!--pluginManagement>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkMode>once</forkMode>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement-->
+
</build>
<!-- ************************************************************* -->
@@ -615,7 +581,7 @@
<filter token="lib-javahelp" value="javahelp-2.0.02.jar"/>
<filter token="lib-activation" value="activation-1.1.jar"/>
<filter token="lib-mail" value="mail-1.4.jar"/>
- <filter token="url" value="${project.url}"/>
+ <filter token="url" value="${jnlpCodebase}"/>
</filterset>
</copy>
<copy file="${project.basedir}/src/main/jnlp/jxlayer.jnlp"
@@ -623,7 +589,7 @@
todir="${jnlp.build.directory}" failonerror="false">
<filterset>
<filter token="lib" value="jxlayer-3.0.1.jar"/>
- <filter token="url" value="${project.url}"/>
+ <filter token="url" value="${jnlpCodebase}"/>
</filterset>
</copy>
@@ -649,13 +615,13 @@
<phase>pre-site</phase>
<configuration>
<tasks>
- <mkdir dir="${maven.site.gen.dir}/resources"/>
+ <mkdir dir="${maven.site.gen.dir}/resources"/>
<copy todir="${maven.site.gen.dir}/resources" verbose="true"
failonerror="false" overwrite="false">
<fileset dir="${jnlp.build.directory}">
<include name="**"/>
</fileset>
- <!-- should be better to use the deployed jnlp in lutinbuilder ? -->
+ <!-- should be better to use the deployed assembly in lutinbuilder ? -->
<fileset dir="target">
<include name="${project.build.finalName}-bin.zip"/>
</fileset>
@@ -672,7 +638,7 @@
<plugin>
<groupId>org.codehaus.mojo.webstart</groupId>
<artifactId>webstart-maven-plugin</artifactId>
- <version>1.0-alpha-2-cl_20081018</version>
+ <version>1.0-alpha-2-cl_20090204</version>
<executions>
<execution>
<phase>verify</phase>
@@ -728,49 +694,6 @@
</configuration>
</plugin>
-
- <!--plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions-->
- <!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
- <!--execution>
- <id>JnlpSun</id>
- <phase>package</phase>
- <configuration>
- <tasks>
- <copy file="${project.basedir}/src/main/resources/jnlp/sun.jnlp"
- todir="${project.basedir}/target/resources/jnlp/">
- <filterset>
- <filter token="mail" value="mail-1.4.jar"/>
- <filter token="activation" value="activation-1.1.jar"/>
- </filterset>
- </copy>
- <copy file="${project.build.directory}/lib/mail-1.4.jar"
- todir="${project.basedir}/target/resources/jnlp/"/>
- <copy file="${project.build.directory}/lib/activation-1.1.jar"
- todir="${project.basedir}/target/resources/jnlp/"/>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution-->
- <!--execution>
- <id>MakeManualScreenShots</id>
- <phase>package</phase>
- <configuration>
- <tasks>
- <exec executable="${project.basedir}/doc/manual/prepareManual.sh"
- dir="${project.basedir}/doc/manual/"/>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin-->
-
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-3</version>
@@ -789,62 +712,6 @@
</executions>
</plugin>
- <!-- Java Web Start -->
- <!-- Creation du fichier principal jnlp sans les libs signees par Sun -->
- <!--plugin>
- <groupId>org.codehaus.mojo.webstart</groupId>
- <artifactId>webstart-maven-plugin</artifactId>
- <version>1.0-alpha-2-cl_20081018</version>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>jnlp-inline</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <dependencies>
- <excludes>
- <exclude>javax.mail:mail</exclude>
- <exclude>javax.activation:activation</exclude>
- </excludes>
- </dependencies>
- <jnlp-->
- <!--<resources>${project.basedir}/src/jnlp</resources>-->
- <!--outputFile>isis-fish-v3.jnlp</outputFile>
- <mainClass>${maven.jar.main.class}</mainClass>
- </jnlp>
-
- <sign>
- <keystore>${keystorepath}</keystore>
- <keypass/>
- <storepass>${keystorepass}</storepass>
- <storetype/>
- <alias>${keystorealias}</alias>
- <validity/>
-
- <dnameCn/>
- <dnameOu/>
- <dnameO/>
- <dnameL/>
- <dnameSt/>
- <dnameC/>
-
- <verify>true</verify>
- </sign>
-
- <keystore>
- <delete>false</delete>
- <gen>false</gen>
- </keystore>
-
- <pack200>false</pack200>
- <gzip>true</gzip>
- <verbose>false</verbose>
- </configuration>
- </plugin-->
-
</plugins>
</build>
</profile>
1
0
r1782 - in isis-fish/trunk: . src/main src/main/jnlp src/main/resources/jnlp
by tchemit@users.labs.libre-entreprise.org 03 Feb '09
by tchemit@users.labs.libre-entreprise.org 03 Feb '09
03 Feb '09
Author: tchemit
Date: 2009-02-03 22:29:34 +0000 (Tue, 03 Feb 2009)
New Revision: 1782
Added:
isis-fish/trunk/src/main/jnlp/
isis-fish/trunk/src/main/jnlp/jxlayer.jnlp
isis-fish/trunk/src/main/jnlp/sun.jnlp
Removed:
isis-fish/trunk/src/main/resources/jnlp/sun.jnlp
Modified:
isis-fish/trunk/pom.xml
Log:
preparation release lutinproject 3.4
reusinage de webstart
Modified: isis-fish/trunk/pom.xml
===================================================================
--- isis-fish/trunk/pom.xml 2009-02-03 16:44:23 UTC (rev 1781)
+++ isis-fish/trunk/pom.xml 2009-02-03 22:29:34 UTC (rev 1782)
@@ -11,7 +11,7 @@
<parent>
<groupId>org.codelutin</groupId>
<artifactId>lutinproject</artifactId>
- <version>3.3</version>
+ <version>3.4-SNAPSHOT</version>
</parent>
<groupId>ifremer</groupId>
@@ -26,7 +26,7 @@
<dependency>
<groupId>org.codelutin</groupId>
<artifactId>lutinutil</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>${lutinutil.version}</version>
<scope>compile</scope>
</dependency>
@@ -152,7 +152,7 @@
<version>3.1</version>
<scope>compile</scope>
</dependency>
-
+
<dependency>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-server</artifactId>
@@ -166,7 +166,7 @@
<version>3.1</version>
<scope>runtime</scope>
</dependency>
-
+
<!-- encore utilise pour les pre-scripts -->
<dependency>
<groupId>org.beanshell</groupId>
@@ -341,21 +341,26 @@
<!-- nom du projet du labs -->
<labs.project>isis-fish</labs.project>
+ <maven.test.forkMode>once</maven.test.forkMode>
+
<!-- Custom version -->
<jaxx.version>1.1-SNAPSHOT</jaxx.version>
<generator.version>0.63</generator.version>
- <topia.version>2.1.1</topia.version>
- <lutinwidget.version>0.12</lutinwidget.version>
+ <topia.version>2.1.3-SNAPSHOT</topia.version>
<lutinmatrix.version>1.2-SNAPSHOT</lutinmatrix.version>
+ <lutinutil.version>1.0.3-SNAPSHOT</lutinutil.version>
+ <lutinwidget.version>0.12</lutinwidget.version>
+ <generator.version>0.64-SNAPSHOT</generator.version>
<openmap.version>4.6.4</openmap.version>
<!--Main class in JAR -->
<maven.jar.main.class>fr.ifremer.isisfish.IsisFish</maven.jar.main.class>
<!-- jnlp -->
- <keystorepath>../../../CodeLutinKeystore</keystorepath>
+ <keystorepath>${codelutin.keystorepath}</keystorepath>
<keystorealias>CodeLutin</keystorealias>
<keystorepass>codelutin</keystorepass>
+ <jnlp.build.directory>${project.build.directory}/jnlp</jnlp.build.directory>
</properties>
<build>
@@ -363,11 +368,11 @@
<!-- Sans le forkMode one, les classpath sont mauvais -->
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkMode>once</forkMode>
- </configuration>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>once</forkMode>
+ </configuration>
</plugin>
<plugin>
@@ -460,7 +465,17 @@
<plugin>
<groupId>org.codelutin</groupId>
<artifactId>maven-i18n-plugin</artifactId>
+ <version>${i18n.version}</version>
<configuration>
+ <bundles>
+ <param>fr_FR</param>
+ <param>en_GB</param>
+ </bundles>
+ <encoding>${maven.compile.encoding}</encoding>
+ <src>${maven.src.dir}/main/resources/i18n</src>
+ <defaultBasedir>${maven.src.dir}/main/java</defaultBasedir>
+ <keysModifier>false</keysModifier>
+ <keepBackup>false</keepBackup>
<entries>
<entry>
<basedir>${maven.gen.dir}/java/</basedir>
@@ -482,11 +497,34 @@
</executions>
</plugin>
+ <!-- Always process jrst files, but only called on pre-site phase -->
<plugin>
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-jrst-plugin</artifactId>
+ <version>${jrst.version}</version>
+ <configuration>
+ <directoryIn>${maven.src.dir}/site</directoryIn>
+ <directoryOut>${maven.site.gen.dir}</directoryOut>
+ <defaultLocale>fr</defaultLocale>
+ <inputEncoding>${maven.compile.encoding}</inputEncoding>
+ <outputEncoding>${maven.compile.encoding}</outputEncoding>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>jrst</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
- <phase>package</phase>
+ <id>copy-dependencies</id>
+ <!--phase>package</phase-->
</execution>
</executions>
<configuration>
@@ -500,7 +538,7 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
- <mainClass>${maven.jar.main.class}</mainClass>
+ <!--mainClass>${maven.jar.main.class}</mainClass-->
<classpathPrefix>./lib/</classpathPrefix>
</manifest>
</archive>
@@ -508,6 +546,16 @@
</plugin>
</plugins>
+ <!--pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>once</forkMode>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement-->
</build>
<!-- ************************************************************* -->
@@ -531,34 +579,183 @@
<build>
<plugins>
+ <!-- always add license and third-party files to classpath -->
<plugin>
- <!-- todo utiliser ce qui a ete refait dans observe ou jaxx par exemple -->
+ <groupId>org.codelutin</groupId>
+ <artifactId>maven-license-switcher-plugin</artifactId>
+ <version>${license-switcher.version}</version>
+ <configuration>
+ <licenseName>${license-switcher.licenseName}</licenseName>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-licenses</id>
+ <goals>
+ <goal>license</goal>
+ <goal>third-party</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
<execution>
<id>JnlpSun</id>
- <phase>package</phase>
+ <phase>verify</phase>
<configuration>
<tasks>
- <copy file="${project.basedir}/src/main/resources/jnlp/sun.jnlp"
- todir="${project.basedir}/target/resources/jnlp/">
+ <mkdir dir="${jnlp.build.directory}"/>
+ <copy file="${project.basedir}/src/main/jnlp/sun.jnlp"
+ verbose="${maven.verbose}"
+ todir="${jnlp.build.directory}" failonerror="false">
<filterset>
- <filter token="mail" value="mail-1.4.jar"/>
- <filter token="activation" value="activation-1.1.jar"/>
+ <filter token="lib-javahelp" value="javahelp-2.0.02.jar"/>
+ <filter token="lib-activation" value="activation-1.1.jar"/>
+ <filter token="lib-mail" value="mail-1.4.jar"/>
+ <filter token="url" value="${project.url}"/>
</filterset>
</copy>
- <copy file="${project.build.directory}/lib/mail-1.4.jar"
- todir="${project.basedir}/target/resources/jnlp/"/>
- <copy file="${project.build.directory}/lib/activation-1.1.jar"
- todir="${project.basedir}/target/resources/jnlp/"/>
+ <copy file="${project.basedir}/src/main/jnlp/jxlayer.jnlp"
+ verbose="${maven.verbose}"
+ todir="${jnlp.build.directory}" failonerror="false">
+ <filterset>
+ <filter token="lib" value="jxlayer-3.0.1.jar"/>
+ <filter token="url" value="${project.url}"/>
+ </filterset>
+ </copy>
+
+ <copy verbose="${maven.verbose}"
+ todir="${jnlp.build.directory}/lib"
+ failonerror="false">
+ <fileset dir="${project.build.directory}/lib">
+ <include name="javahelp-2.0.02.jar"/>
+ <include name="activation-1.1.jar"/>
+ <include name="mail-1.4.jar"/>
+ <include name="jxlayer-3.0.1.jar"/>
+ </fileset>
+ </copy>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
- <!--execution>
+
+ <execution>
+ <id>JnlpToSite</id>
+ <phase>pre-site</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${maven.site.gen.dir}/resources"/>
+ <copy todir="${maven.site.gen.dir}/resources" verbose="true"
+ failonerror="false" overwrite="false">
+ <fileset dir="${jnlp.build.directory}">
+ <include name="**"/>
+ </fileset>
+ <!-- should be better to use the deployed jnlp in lutinbuilder ? -->
+ <fileset dir="target">
+ <include name="${project.build.finalName}-bin.zip"/>
+ </fileset>
+
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo.webstart</groupId>
+ <artifactId>webstart-maven-plugin</artifactId>
+ <version>1.0-alpha-2-cl_20081018</version>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>jnlp-inline</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <force>false</force>
+ <dependencies>
+ <excludes>
+ <exclude>javax.help:javahelp</exclude>
+ <exclude>javax.mail:mail</exclude>
+ <exclude>javax.activation:activation</exclude>
+ <exclude>org.swinglabs:jxlayer</exclude>
+ </excludes>
+ </dependencies>
+ <libPath>lib</libPath>
+ <extensions>
+ <sun>sun.jnlp</sun>
+ <jxlayer>jxlayer.jnlp</jxlayer>
+ </extensions>
+ <jnlp>
+ <outputFile>isis-fish-v3.jnlp</outputFile>
+ <mainClass>${maven.jar.main.class}</mainClass>
+ <allPermissions>true</allPermissions>
+ <offlineAllowed>true</offlineAllowed>
+ </jnlp>
+
+ <sign>
+ <keystore>${keystorepath}</keystore>
+ <keypass/>
+ <storepass>${keystorepass}</storepass>
+ <storetype/>
+ <alias>${keystorealias}</alias>
+ <validity/>
+ <dnameCn/>
+ <dnameOu/>
+ <dnameO/>
+ <dnameL/>
+ <dnameSt/>
+ <dnameC/>
+ <verify>true</verify>
+ <keystoreConfig>
+ <delete>false</delete>
+ <gen>false</gen>
+ </keystoreConfig>
+ </sign>
+ <pack200>false</pack200>
+ <gzip>true</gzip>
+ <verbose>false</verbose>
+ </configuration>
+ </plugin>
+
+
+ <!--plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions-->
+ <!-- Ajout des libs signe par Sun dans un fichier jnlp separe -->
+ <!--execution>
+ <id>JnlpSun</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <copy file="${project.basedir}/src/main/resources/jnlp/sun.jnlp"
+ todir="${project.basedir}/target/resources/jnlp/">
+ <filterset>
+ <filter token="mail" value="mail-1.4.jar"/>
+ <filter token="activation" value="activation-1.1.jar"/>
+ </filterset>
+ </copy>
+ <copy file="${project.build.directory}/lib/mail-1.4.jar"
+ todir="${project.basedir}/target/resources/jnlp/"/>
+ <copy file="${project.build.directory}/lib/activation-1.1.jar"
+ todir="${project.basedir}/target/resources/jnlp/"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution-->
+ <!--execution>
<id>MakeManualScreenShots</id>
<phase>package</phase>
<configuration>
@@ -570,9 +767,9 @@
<goals>
<goal>run</goal>
</goals>
- </execution-->
+ </execution>
</executions>
- </plugin>
+ </plugin-->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
@@ -594,7 +791,7 @@
<!-- Java Web Start -->
<!-- Creation du fichier principal jnlp sans les libs signees par Sun -->
- <plugin>
+ <!--plugin>
<groupId>org.codehaus.mojo.webstart</groupId>
<artifactId>webstart-maven-plugin</artifactId>
<version>1.0-alpha-2-cl_20081018</version>
@@ -613,9 +810,9 @@
<exclude>javax.activation:activation</exclude>
</excludes>
</dependencies>
- <jnlp>
- <!--<resources>${project.basedir}/src/jnlp</resources>-->
- <outputFile>isis-fish-v3.jnlp</outputFile>
+ <jnlp-->
+ <!--<resources>${project.basedir}/src/jnlp</resources>-->
+ <!--outputFile>isis-fish-v3.jnlp</outputFile>
<mainClass>${maven.jar.main.class}</mainClass>
</jnlp>
@@ -646,7 +843,7 @@
<gzip>true</gzip>
<verbose>false</verbose>
</configuration>
- </plugin>
+ </plugin-->
</plugins>
</build>
Added: isis-fish/trunk/src/main/jnlp/jxlayer.jnlp
===================================================================
--- isis-fish/trunk/src/main/jnlp/jxlayer.jnlp (rev 0)
+++ isis-fish/trunk/src/main/jnlp/jxlayer.jnlp 2009-02-03 22:29:34 UTC (rev 1782)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0+" codebase="@url@" href="jxlayer.jnlp">
+ <information>
+ <title>Sun MicroSystems</title>
+ <vendor>Sun MicroSystems, Inc.</vendor>
+ <offline-allowed/>
+ </information>
+ <resources>
+ <jar href="lib/@lib@"/>
+ </resources>
+ <component-desc/>
+</jnlp>
\ No newline at end of file
Copied: isis-fish/trunk/src/main/jnlp/sun.jnlp (from rev 1781, isis-fish/trunk/src/main/resources/jnlp/sun.jnlp)
===================================================================
--- isis-fish/trunk/src/main/jnlp/sun.jnlp (rev 0)
+++ isis-fish/trunk/src/main/jnlp/sun.jnlp 2009-02-03 22:29:34 UTC (rev 1782)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jnlp spec="1.0+" codebase="@url@" href="sun.jnlp">
+ <information>
+ <title>Sun MicroSystems</title>
+ <vendor>Sun MicroSystems, Inc.</vendor>
+ <offline-allowed/>
+ </information>
+ <resources>
+ <jar href="lib/@lib-mail@"/>
+ <jar href="lib/@lib-activation@"/>
+ <jar href="lib/@lib-javahelp@"/>
+ </resources>
+ <component-desc/>
+</jnlp>
\ No newline at end of file
Property changes on: isis-fish/trunk/src/main/jnlp/sun.jnlp
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: isis-fish/trunk/src/main/resources/jnlp/sun.jnlp
===================================================================
--- isis-fish/trunk/src/main/resources/jnlp/sun.jnlp 2009-02-03 16:44:23 UTC (rev 1781)
+++ isis-fish/trunk/src/main/resources/jnlp/sun.jnlp 2009-02-03 22:29:34 UTC (rev 1782)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<jnlp spec="1.0+" codebase="http://isis-fish.labs.libre-entreprise.org/jnlp" href="sun.jnlp">
- <information>
- <title>Sun MicroSystems</title>
- <vendor>Sun MicroSystems, Inc.</vendor>
- <offline-allowed />
- </information>
- <resources>
-
-<jar href="@mail@"/>
-<jar href="@activation@"/>
-
- </resources>
- <component-desc/>
-</jnlp>
\ No newline at end of file
1
0
r1781 - isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity
by chatellier@users.labs.libre-entreprise.org 03 Feb '09
by chatellier@users.labs.libre-entreprise.org 03 Feb '09
03 Feb '09
Author: chatellier
Date: 2009-02-03 16:44:23 +0000 (Tue, 03 Feb 2009)
New Revision: 1781
Modified:
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity/PopulationSeasonInfoTest.java
Log:
Cette fois c'est la bonne ;)
Modified: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity/PopulationSeasonInfoTest.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity/PopulationSeasonInfoTest.java 2009-02-03 16:38:30 UTC (rev 1780)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity/PopulationSeasonInfoTest.java 2009-02-03 16:44:23 UTC (rev 1781)
@@ -103,37 +103,38 @@
final MatrixPanelEditor panel = new MatrixPanelEditor(false, 800, 300);
panel.setMatrix(mat);
- final JDialog dialog = new JDialog();
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- try {
- JOptionPane.showMessageDialog(dialog, panel,_("Spacialized visualisation"), JOptionPane.INFORMATION_MESSAGE);
- } catch (HeadlessException he) {
- if(log.isErrorEnabled()) {
- log.error("No X11 display available", he);
+ try {
+ final JDialog dialog = new JDialog();
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+
+ JOptionPane.showMessageDialog(dialog, panel,_("Spacialized visualisation"), JOptionPane.INFORMATION_MESSAGE);
+
+ }
+ });
+
+ Thread t = new Thread(new Runnable() {
+ public void run() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ // do nothing
}
+ dialog.dispose();
}
+ });
+ t.start();
+
+ // it would really be nice to wait the thread, otherwise the test
+ // means nothing!!!
+ t.join();
+ } catch (HeadlessException he) {
+ if(log.isErrorEnabled()) {
+ log.error("No X11 display available", he);
}
- });
- Thread t = new Thread(new Runnable() {
- public void run() {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- // do nothing
- }
- dialog.dispose();
- }
- });
- t.start();
+ }
- // it would really be nice to wait the thread, otherwise the test
- // means nothing!!!
- t.join();
-
-
-
System.out.println("end");
}
@@ -180,35 +181,37 @@
box.add(panel);
box.add(bigpanel);
- final JDialog dialog = new JDialog();
- SwingUtilities.invokeLater(new Runnable() {
- @Override
- public void run() {
- try {
- JOptionPane.showMessageDialog(dialog, box, _("Spacialized visualisation"), JOptionPane.INFORMATION_MESSAGE);
- } catch (HeadlessException he) {
- if(log.isErrorEnabled()) {
- log.error("No X11 display available", he);
+ try {
+ final JDialog dialog = new JDialog();
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+
+ JOptionPane.showMessageDialog(dialog, box, _("Spacialized visualisation"), JOptionPane.INFORMATION_MESSAGE);
+
+ }
+ });
+
+ Thread t = new Thread(new Runnable() {
+ public void run() {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ // do nothing
}
+ dialog.dispose();
}
+ });
+ t.start();
+
+ // it would really be nice to wait the thread, otherwise the test
+ // means nothing!!!
+ t.join();
+ } catch (HeadlessException he) {
+ if(log.isErrorEnabled()) {
+ log.error("No X11 display available", he);
}
- });
-
- Thread t = new Thread(new Runnable() {
- public void run() {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- // do nothing
- }
- dialog.dispose();
- }
- });
- t.start();
-
- // it would really be nice to wait the thread, otherwise the test
- // means nothing!!!
- t.join();
+ }
System.out.println("end");
}
1
0
r1780 - isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity
by chatellier@users.labs.libre-entreprise.org 03 Feb '09
by chatellier@users.labs.libre-entreprise.org 03 Feb '09
03 Feb '09
Author: chatellier
Date: 2009-02-03 16:38:30 +0000 (Tue, 03 Feb 2009)
New Revision: 1780
Modified:
isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity/PopulationSeasonInfoTest.java
Log:
Ajout d'un catch sur HeadlessException dans le cas ou les test ne passent pas s'il n'y a pas de X11
Modified: isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity/PopulationSeasonInfoTest.java
===================================================================
--- isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity/PopulationSeasonInfoTest.java 2009-02-03 16:14:50 UTC (rev 1779)
+++ isis-fish/trunk/src/test/java/fr/ifremer/isisfish/entity/PopulationSeasonInfoTest.java 2009-02-03 16:38:30 UTC (rev 1780)
@@ -17,46 +17,47 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*##%*/
-/* *
- * PopulationSeasonInfoTest.java
- *
- * Created: 29 juin 2006 20:19:32
- *
- * @author poussin
- * @version $Revision$
- *
- * Last update: $Date$
- * by : $Author$
- */
+
package fr.ifremer.isisfish.entity;
import static org.codelutin.i18n.I18n._;
+import java.awt.HeadlessException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.awt.event.WindowEvent;
import javax.swing.Box;
+import javax.swing.JDialog;
import javax.swing.JOptionPane;
-import javax.swing.JDialog;
import javax.swing.SwingUtilities;
-import junit.framework.TestCase;
-
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.codelutin.math.matrix.MatrixFactory;
import org.codelutin.math.matrix.MatrixIterator;
import org.codelutin.math.matrix.MatrixND;
import org.codelutin.math.matrix.gui.MatrixPanelEditor;
+import org.junit.Test;
-
/**
+ * PopulationSeasonInfoTest.
+ *
+ * Created: 29 juin 2006 20:19:32
+ *
* @author poussin
+ * @version $Revision$
*
+ * Last update: $Date$
+ * by : $Author$
*/
-
-public class PopulationSeasonInfoTest extends TestCase {
+public class PopulationSeasonInfoTest{
+
+ /** Logger for this class */
+ private static final Log log = LogFactory.getLog(PopulationSeasonInfoTest.class);
+
+ @Test
public void testToString() {
String [] s = new String[]{"toto", "titi", "tutu"};
System.out.println(Arrays.toString(s));
@@ -65,6 +66,7 @@
/*
* Test method for 'fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl.getGroupChangeMatrix(Month)'
*/
+ @Test
public void testGetGroupChangeMatrix() throws InterruptedException {
System.out.println("begin");
int nbrAge = 3;
@@ -105,8 +107,13 @@
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- JOptionPane.showMessageDialog(dialog, panel,_("Spacialized visualisation"), JOptionPane.INFORMATION_MESSAGE);
-
+ try {
+ JOptionPane.showMessageDialog(dialog, panel,_("Spacialized visualisation"), JOptionPane.INFORMATION_MESSAGE);
+ } catch (HeadlessException he) {
+ if(log.isErrorEnabled()) {
+ log.error("No X11 display available", he);
+ }
+ }
}
});
Thread t = new Thread(new Runnable() {
@@ -133,6 +140,7 @@
/**
* Converte no spacialized matrix to spacialized matrix
*/
+ @Test
public void testSpacializeLengthChangeMatrix() throws InterruptedException {
@@ -176,7 +184,13 @@
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- JOptionPane.showMessageDialog(dialog, box, _("Spacialized visualisation"), JOptionPane.INFORMATION_MESSAGE);
+ try {
+ JOptionPane.showMessageDialog(dialog, box, _("Spacialized visualisation"), JOptionPane.INFORMATION_MESSAGE);
+ } catch (HeadlessException he) {
+ if(log.isErrorEnabled()) {
+ log.error("No X11 display available", he);
+ }
+ }
}
});
1
0