Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frascati
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
114
Issues
114
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
frascati
frascati
Commits
59f7b5d1
Commit
59f7b5d1
authored
Feb 16, 2010
by
Christophe Demarey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests and doc.
parent
e1dbe7b6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
246 additions
and
2 deletions
+246
-2
fscript/src/docbkx/fscript.xml
fscript/src/docbkx/fscript.xml
+85
-1
fscript/src/test/java/org/ow2/frascati/fscript/model/HelloWorldBasedTest.java
...a/org/ow2/frascati/fscript/model/HelloWorldBasedTest.java
+2
-1
fscript/src/test/java/org/ow2/frascati/fscript/model/ScadescendantAxisTest.java
...org/ow2/frascati/fscript/model/ScadescendantAxisTest.java
+53
-0
fscript/src/test/java/org/ow2/frascati/fscript/model/ScaparentAxisTest.java
...ava/org/ow2/frascati/fscript/model/ScaparentAxisTest.java
+53
-0
fscript/src/test/java/org/ow2/frascati/fscript/model/ScasiblingAxisTest.java
...va/org/ow2/frascati/fscript/model/ScasiblingAxisTest.java
+53
-0
No files found.
fscript/src/docbkx/fscript.xml
View file @
59f7b5d1
...
...
@@ -286,6 +286,11 @@ Success (took 1 ms).</programlisting>
nodes representing their direct SCA sub-component
</para>
</listitem>
<listitem>
<para>
scaparent labels arcs which connect component nodes to the
nodes representing their direct parents (if any)
</para>
</listitem>
<listitem>
<para>
scaservice labels arcs which connect component nodes to the
nodes representing its SCA services
</para>
...
...
@@ -329,7 +334,12 @@ Success (took 1 ms).</programlisting>
<programlisting>
FScript
>
$c/scachild::*
=
>
a node-set with 2 element(s):
#
<
scacomponent: client
>
#
<
scacomponent: server
>
</programlisting>
#
<
scacomponent: client
>
#
<
scacomponent: server
>
FScript
>
client = $c/scachild::client;
=
>
a node-set with 1 element(s):
#
<
scacomponent: client
>
Success (took 1 ms).
</programlisting>
<para>
The expression $c/scachild::* is our first example of an actual
path expression. It selects all the (direct) children of component
...
...
@@ -342,6 +352,19 @@ Success (took 1 ms).</programlisting>
HelloWorld example.”).
</para>
</section>
<section>
<title>
Parent
</title>
<programlisting>
FScript
>
$client/scaparent::*
=
>
a node-set with 2 element(s):
#
<
scacomponent: helloworld-rmi-standalone
>
</programlisting>
<para>
The expression $c/scaparent::* selects all the (direct) parents
(if any) of component
<varname>
$c
</varname>
lient, and returns them in
a node-set. In this case, the result is a set of one component named
<varname>
helloworld-rmi-standalone
</varname>
.
</para>
</section>
<section>
<title>
Service
</title>
...
...
@@ -458,6 +481,67 @@ FScript> value( $header )
f
<varname>
rascati.debug
</varname>
defined on the
<varname>
s
</varname>
interface (service) of the
<varname>
server
</varname>
component.
</para>
</section>
<section>
<title>
Additional axes
</title>
<para>
In addition to previous axes, there are other derivated
axes:
</para>
<itemizedlist>
<listitem>
<para>
Transitive axes: select nodes recursively by applying the
axis on results
</para>
<itemizedlist>
<listitem>
<para>
scadescendant
</para>
</listitem>
<listitem>
<para>
scaancestor
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
Composed axis: combination of two axes
</para>
<itemizedlist>
<listitem>
<para>
scasibling
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
Reflexive axes: add the source component to selected
node
</para>
<itemizedlist>
<listitem>
<para>
scachild-or-self
</para>
</listitem>
<listitem>
<para>
scaparent-or-self
</para>
</listitem>
<listitem>
<para>
scadescendant-or-self
</para>
</listitem>
<listitem>
<para>
scaancestor-or-self
</para>
</listitem>
<listitem>
<para>
scasibling-or-self
</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</section>
</section>
</section>
</chapter>
fscript/src/test/java/org/ow2/frascati/fscript/model/HelloWorldBasedTest.java
View file @
59f7b5d1
/***
* OW2 FraSCAti fscript
* Copyright (C) 2009 INRIA, USTL
* Copyright (C) 2009
-2010
INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -56,6 +56,7 @@ public abstract class HelloWorldBasedTest {
this
.
engine
=
FScript
.
getFScriptEngine
(
fscript
);
this
.
helloWorldRoot
=
(
ScaComponentNode
)
engine
.
execute
(
"root = sca-new(\"helloworld-rmi-standalone\");"
);
engine
.
execute
(
"client = $root/scachild::client;"
);
}
// TODO: Add a tearDown() method used to unload loaded SCA composite(s)
...
...
fscript/src/test/java/org/ow2/frascati/fscript/model/ScadescendantAxisTest.java
0 → 100644
View file @
59f7b5d1
/***
* OW2 FraSCAti fscript
* Copyright (C) 2009-2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Demarey
*
* Contributor(s):
*/
package
org.ow2.frascati.fscript.model
;
import
static
org
.
junit
.
Assert
.*;
import
java.util.Set
;
import
org.junit.Test
;
import
org.objectweb.fractal.fscript.model.Node
;
/**
* JUnit test case for tha scachild axis.
*
* @author Christophe Demarey.
*/
public
class
ScadescendantAxisTest
extends
HelloWorldBasedTest
{
@Test
public
void
testSelectFromNode
()
throws
Exception
{
Set
<
Node
>
result
=
(
Set
<
Node
>)
engine
.
execute
(
"$root/scadescendant::*;"
);
for
(
Node
node
:
result
)
{
assertTrue
(
node
+
" is not an instance of ScaComponentNode"
,
node
instanceof
ScaComponentNode
);
}
assertTrue
(
"The HelloWorld composite has 2 descendants! (found "
+
result
.
size
()+
")"
,
result
.
size
()
==
2
);
}
}
fscript/src/test/java/org/ow2/frascati/fscript/model/ScaparentAxisTest.java
0 → 100644
View file @
59f7b5d1
/***
* OW2 FraSCAti fscript
* Copyright (C) 2009-2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Demarey
*
* Contributor(s):
*/
package
org.ow2.frascati.fscript.model
;
import
static
org
.
junit
.
Assert
.*;
import
java.util.Set
;
import
org.junit.Test
;
import
org.objectweb.fractal.fscript.model.Node
;
/**
* JUnit test case for tha scachild axis.
*
* @author Christophe Demarey.
*/
public
class
ScaparentAxisTest
extends
HelloWorldBasedTest
{
@Test
public
void
testSelectFromNode
()
throws
Exception
{
Set
<
Node
>
result
=
(
Set
<
Node
>)
engine
.
execute
(
"$client/scaparent::*;"
);
for
(
Node
node
:
result
)
{
assertTrue
(
node
+
" is not an instance of ScaComponentNode"
,
node
instanceof
ScaComponentNode
);
}
assertTrue
(
"The client component has only 1 parent! (found "
+
result
.
size
()+
")"
,
result
.
size
()
==
1
);
}
}
fscript/src/test/java/org/ow2/frascati/fscript/model/ScasiblingAxisTest.java
0 → 100644
View file @
59f7b5d1
/***
* OW2 FraSCAti fscript
* Copyright (C) 2009-2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Demarey
*
* Contributor(s):
*/
package
org.ow2.frascati.fscript.model
;
import
static
org
.
junit
.
Assert
.*;
import
java.util.Set
;
import
org.junit.Test
;
import
org.objectweb.fractal.fscript.model.Node
;
/**
* JUnit test case for tha scachild axis.
*
* @author Christophe Demarey.
*/
public
class
ScasiblingAxisTest
extends
HelloWorldBasedTest
{
@Test
public
void
testSelectFromNode
()
throws
Exception
{
Set
<
Node
>
result
=
(
Set
<
Node
>)
engine
.
execute
(
"$client/scasibling::*;"
);
for
(
Node
node
:
result
)
{
assertTrue
(
node
+
" is not an instance of ScaComponentNode"
,
node
instanceof
ScaComponentNode
);
}
assertTrue
(
"There are 2 components on the same hierarchy level than client! (found "
+
result
.
size
()+
")"
,
result
.
size
()
==
2
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment