Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
frascati
frascati
Commits
20e772fa
Commit
20e772fa
authored
May 22, 2012
by
Gwenael Cattez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Light mock module for "La maison au doigt et à l'oeil"
parent
c5d220ec
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
252 additions
and
0 deletions
+252
-0
demo/common/common-homeautomation/common-homeautomation-light-mock/pom.xml
...n-homeautomation/common-homeautomation-light-mock/pom.xml
+50
-0
demo/common/common-homeautomation/common-homeautomation-light-mock/src/main/java/org/ow2/frascati/demo/common/homeautomation/light/LightMock.java
.../frascati/demo/common/homeautomation/light/LightMock.java
+98
-0
demo/common/common-homeautomation/common-homeautomation-light-mock/src/main/resources/images/light_off.png
...mation-light-mock/src/main/resources/images/light_off.png
+0
-0
demo/common/common-homeautomation/common-homeautomation-light-mock/src/main/resources/images/light_on.png
...omation-light-mock/src/main/resources/images/light_on.png
+0
-0
demo/common/common-homeautomation/common-homeautomation-light-mock/src/main/resources/light-mock.composite
...mation-light-mock/src/main/resources/light-mock.composite
+46
-0
demo/common/common-homeautomation/common-homeautomation-light-mock/src/test/java/org/ow2/frascati/demo/common/homeautomation/light/LightMockTest.java
...scati/demo/common/homeautomation/light/LightMockTest.java
+57
-0
demo/common/common-homeautomation/pom.xml
demo/common/common-homeautomation/pom.xml
+1
-0
No files found.
demo/common/common-homeautomation/common-homeautomation-light-mock/pom.xml
0 → 100644
View file @
20e772fa
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<artifactId>
common-homeautomation
</artifactId>
<groupId>
org.ow2.frascati.demo
</groupId>
<version>
0.0.1-SNAPSHOT
</version>
<relativePath>
..
</relativePath>
</parent>
<artifactId>
common-homeautomation-light-mock
</artifactId>
<name>
Common Mock Ligth component
</name>
<properties>
<composite.file.local>
light-mock
</composite.file.local>
<composite.file.deploy>
light-mock
</composite.file.deploy>
</properties>
<dependencies>
<dependency>
<groupId>
org.ow2.frascati.demo
</groupId>
<artifactId>
common-onoffdevice
</artifactId>
</dependency>
<dependency>
<groupId>
org.ow2.frascati.demo
</groupId>
<artifactId>
common-homeautomation-interface
</artifactId>
</dependency>
<dependency>
<groupId>
org.ow2.frascati
</groupId>
<artifactId>
frascati-binding-ws
</artifactId>
</dependency>
<dependency>
<groupId>
org.ow2.frascati.examples.test
</groupId>
<artifactId>
frascati-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.ow2.frascati
</groupId>
<artifactId>
frascati-runtime-factory
</artifactId>
<version>
${frascati.version}
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
demo/common/common-homeautomation/common-homeautomation-light-mock/src/main/java/org/ow2/frascati/demo/common/homeautomation/light/LightMock.java
0 → 100644
View file @
20e772fa
/**
* OW2 FraSCAti Assembly Factory
* Copyright (C) 2008-2012 Inria, University of Lille
*
* 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: Gwénaël Cattez
*
* Contributor(s):
*
*/
package
org.ow2.frascati.demo.common.homeautomation.light
;
import
java.util.logging.Logger
;
import
org.osoa.sca.annotations.EagerInit
;
import
org.osoa.sca.annotations.Scope
;
import
org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator
;
import
org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice
;
/**
* Implementation of an on,off,dim light communicated with a zibase
*/
@EagerInit
@Scope
(
"COMPOSITE"
)
public
class
LightMock
extends
SwOnOffDevice
implements
OnOffDimActuator
{
private
static
final
long
serialVersionUID
=
7739837659903828745L
;
private
static
final
Logger
logger
=
Logger
.
getLogger
(
LightMock
.
class
.
getName
());
/**
* Constructor for {@link SwOnOffDevice} class, set the title of the Swing Panel
*/
public
LightMock
()
{
super
(
"Mocked Ligth"
);
}
/**
* @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#onAction()
*/
@Override
public
Boolean
onAction
()
{
acturatorOn
();
return
null
;
}
/**
* @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#offAction()
*/
@Override
public
Boolean
offAction
()
{
acturatorOff
();
return
null
;
}
/**
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator#acturatorOn()
*/
public
void
acturatorOn
()
{
logger
.
info
(
"[LightMock] invoke method on"
);
}
/**
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator#acturatorOff()
*/
public
void
acturatorOff
()
{
logger
.
info
(
"[LightMock] invoke method off"
);
}
/**
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator#actuatorDim(int)
*/
public
void
actuatorDim
(
int
dimValue
)
{
logger
.
info
(
"[LightMock] invoke method dim with value "
+
dimValue
);
}
}
demo/common/common-homeautomation/common-homeautomation-light-mock/src/main/resources/images/light_off.png
0 → 100644
View file @
20e772fa
5.84 KB
demo/common/common-homeautomation/common-homeautomation-light-mock/src/main/resources/images/light_on.png
0 → 100644
View file @
20e772fa
7.05 KB
demo/common/common-homeautomation/common-homeautomation-light-mock/src/main/resources/light-mock.composite
0 → 100644
View file @
20e772fa
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2008-2012 Inria, University of Lille -->
<!-- -->
<!-- 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: Gwenael CATTEZ -->
<!-- -->
<!-- Contributors : -->
<composite
xmlns=
"http://www.osoa.org/xmlns/sca/1.0"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:wsdli=
"http://www.w3.org/2004/08/wsdl-instance"
name=
"light-mock"
>
<component
name=
"light-mock"
>
<property
name=
"onText"
>
turn on
</property>
<property
name=
"offText"
>
turn off
</property>
<property
name=
"onIconPath"
>
images/light_on.png
</property>
<property
name=
"offIconPath"
>
images/light_off.png
</property>
<service
name=
"onoffdim-actuator"
>
<interface.java
interface=
"org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator"
/>
</service>
<implementation.java
class=
"org.ow2.frascati.demo.common.homeautomation.light.LightMock"
/>
</component>
<service
name=
"onoffdim-actuator"
promote=
"light-mock/onoffdim-actuator"
>
<binding.ws
uri=
"http://localhost:9123/light/mock"
/>
</service>
</composite>
\ No newline at end of file
demo/common/common-homeautomation/common-homeautomation-light-mock/src/test/java/org/ow2/frascati/demo/common/homeautomation/light/LightMockTest.java
0 → 100644
View file @
20e772fa
/**
* OW2 FraSCAti Assembly Factory
* Copyright (C) 2008-2012 Inria, University of Lille
*
* 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: Gwénaël Cattez
*
* Contributor(s):
*
*/
package
org.ow2.frascati.demo.common.homeautomation.light
;
import
org.junit.Test
;
import
org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator
;
import
org.ow2.frascati.examples.test.FraSCAtiTestCase
;
/**
*
*/
public
class
LightMockTest
extends
FraSCAtiTestCase
{
/* (non-Javadoc)
* @see org.ow2.frascati.examples.test.FraSCAtiTestCase#getComposite()
*/
@Override
public
String
getComposite
()
{
return
"light-mock"
;
}
@Test
public
final
void
testInvoke
()
{
OnOffDimActuator
lightMock
=
getService
(
OnOffDimActuator
.
class
,
"onoffdim-actuator"
);
lightMock
.
acturatorOn
();
lightMock
.
actuatorDim
(
50
);
lightMock
.
acturatorOff
();
}
}
\ No newline at end of file
demo/common/common-homeautomation/pom.xml
View file @
20e772fa
...
...
@@ -41,6 +41,7 @@
<module>
common-homeautomation-switch
</module>
<module>
common-homeautomation-switch-mock
</module>
<module>
common-homeautomation-light
</module>
<module>
common-homeautomation-light-mock
</module>
<module>
common-homeautomation-videoscreen-mock
</module>
</modules>
...
...
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