forked from runtimeverification/javamop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
executable file
·242 lines (160 loc) · 8.63 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
JavaMOP 2.3.1 INSTALL
This file contains instructions for installing JavaMOP.
===1. Prerequisites===
=1.1 JDK 6=
We expect java 1.6.x or newer (JDK 6). If you already have an installed JDK
check the version with javac -version. If you already have a correct JDK
installed make sure your environment variables are properly defined as outlined
below.
To install JDK 6, go to the following URL:
http://java.sun.com/javase/downloads/index.jsp
And download "Java SE Development Kit (JDK)"
To download, specify your platform. Install JDK 6 by double clicking the
downloaded installer or executing it on the command line. Installing JDK 6 may
take awhile.
Set the PATH or Path variable to add the JDK 6 directory if it is not already
set. Choose Start, Settings, Control Panel, and double-click System. On
Microsoft Windows NT, select the Environment tab; on Microsoft Windows XP and
2000, select The Advanced tab and then Environment Variables. Look for "Path"
in the User Variables and System Variables. If you're not sure where to add the
path, add it to the left end of the "Path" in the User Variables. For POSIX
based operating systems, set the PATH variable in your .login script or in the
rc file for whatever shell you use. A typical value to add to the Path is:
In Windows,
C:\Program Files\Java\jdk1.6.0_14\bin
In Linux and Mac,
It depends on your distribution.
Add this to the left end of the "Path" followed by ";" (":" in Linux and Mac).
For more information, refer to Section 5 from the following URL:
http://java.sun.com/j2se/1.4.2/install-windows.html
--- To test: run 'javac' from the command line, this should display usage
information for javac.
=1.2 AspectJ=
As JavaMOP generates AspectJ aspects, AspectJ must be installed to make full
use of JavaMOP. If AspectJ is already installed, make sure to set your
environment variables correctly as outlined below.
Download AspectJ from the following URL:
http://www.eclipse.org/aspectj/downloads.php
Download the latest stable release if its version is 1.6.x. If the latest stable
release is later than 1.6.x, then download the most recent 1.6.x version of
AspectJ.
Simply execute the jar file from the download site by either double clicking it
(on OSes that support double clicking jar files) or running the following command:
java -jar aspect1.6.x.jar
At the end of installation, the installer recommends adding some paths to
CLASSPATH and to PATH. JavaMOP requires this step, because it assumes that ajc
(the AspectJ compiler) is usable anywhere. In particular if
<path to aspectj>/lib/aspectjrt.jar is not in CLASSPATH, the testsuite (see
Section 4.1) will not work.
--- To test: run 'ajc' from the command line, this should display usage
information for ajc. (ajc is the AspectJ compiler)
===2. Build JavaMOP from Source===
Building JavaMOP is necessary only if you need to make modifications to JavaMOP.
It is recommended for end users to use the JavaMOP binary installer from the
project website and skip this section.
=2.1 Ant
JavaMOP is built using Apache Ant. If you do not have Ant use the following
instructions to install it.
Download ant from the following URL:
http://ant.apache.org/bindownload.cgi
Download one of the archives in a format you are able to open. At last check
they have archives for .zip, .tar.gz, and .tar.bz2.
Extract the contents of the archive. A directory named apache-ant-xxxx will be
created where xxxx is the version number.
The scripts to run ant are in apache-ant-xxxx/bin. If you wish to execute them
anywhere add this directory to your PATH environment variable.
=2.2 Scala
The PTLTL plugin for JavaMOP is built using Scala. The current build process
requires building the PTLTL plugin. If Ant is already installed make sure to
set your environment variables correctly as outlined below.
Download Scala from the following URL:
http://www.scala-lang.org/downloads
Download the latest IzPack Installer and install it by double clicking it.
Set the SCALA_HOME environment variable if it is not already set. A typical
value for SCALA_HOME is:
In Windows,
C:\Program Files\Scala
In Linux and Mac,
/usr/local/share/scala
Add the 'bin' directory under SCALA_HOME to the PATH environment variable.
--- To test: run 'scalac' from the command line, this should display usage
information.
=2.3 Download the JavaMOP source
As the tool is still under active development, it is recommended that you
download JavaMOP directly from the SVN repository, as follows:
svn checkout http://javamop.googlecode.com/svn/trunk/ javamop
=2.4 Build JavaMOP
From the top level directory of JavaMOP (i.e. the directory this file is in) run
<path to ant>/bin/ant
If you placed ant in your PATH is it possible to simply type
ant
This will build JavaMOP, the logic repository, and the test suite.
===3. JavaMOP Setup===
=3.1 Setting Environment Variables
Set the PATH or Path variable to add the JavaMOP bin directory if it is not
already there. Choose Start, Settings, Control Panel, and double-click System.
On Microsoft Windows NT, select the Environment tab; on Microsoft Windows XP
and 2000, select The Advanced tab and then Environment Variables. Look for
"Path" in the User Variables and System Variables. If you're not sure where to
add the path, add it to the left end of the "Path" in the User Variables. For
POSIX based operating systems, set the PATH variable in your .login script or in
the rc file for whatever shell you use. A typical value for PATH is:
In Windows
C:\javamop2.3\bin
In Linux and Mac,
~/javamop2.3/bin
Add this to the left end of the "Path" followed by ";" (":" in Linux and Mac).
--- To test: run 'javamop' from the command line, this should display usage
information for javamop.
===4. Testing JavaMOP===
=4.1 TestSuite
JavaMOP provides a TestSuite. The TestSuite has two main purposes: First, it
tests JavaMOP itself. JavaMOP is a very actively evolving project. New features
are introduced regularly. We need to make sure that new features do not damage
preexisting functionality. Second, the TestSuite can be used as a tutorial for
how to use JavaMOP to monitor programs. See the directories in the TestSuite
for examples.
To execute the TestSuite with the remote Logic Repository, type
'javamoptestsuite -remote' in Linux and Mac or 'javamoptestsuite.bat -remote' in Windows
To execute the test suite with the local Logic Repository, type
'javamoptestsuite' or 'javamoptestsuite -local' in Linux and Mac
or 'javamoptestsuite.bat' or 'javamoptestsuite.bat -local' in Windows
If you want the verbose mode pass the -v flag to the script of your choice.
The -j command allows multiple threads to be used to speed up the test suite.
The number of threads is specified after -j. The default is two threads
If you want to add a test case, make a sub directory under javamop2.3/examples/
and add a specification and programs in the new directory, with proper output
files for the expected output of the given programs. For details about the
TestSuite directory structure, read the next section.
=4.2 Executing a Test Case Manually
A test case directory consists of specifications and testing program
directories. All specifications will be applied to each testing program. The
TestSuite will automatically generate another directory for each testing
program directory with suffix _MOP, for a monitored testing program. For
example, javamop2.3/examples/ERE/HasNext has a specification HasNext.mop and
three testing program directories HasNext_1, HasNext_2, and HasNext_3. TestSuite
generates HasNextMonitorAspect.aj in the same directory where HasNext.mop is. It
also generates three directories of monitored testing programs, HasNext_1_MOP,
HasNext_2_MOP, and HasNext_3_MOP.
Enter the test case directory you want. For example,
javamop2.3/examples/ERE/HasNext
To compile specifications, type
javamop *.mop
To compile all java files in a testing program directory, type
In Windows,
javac -d <testing program dir> <testing program dir>\*.java
In Linux or Mac,
javac -d <testing program dir> <testing program dir>/*.java
To duplicate a program directory for monitoring, type
cp -rp <testing program dir> <testing program dir>_MOP
To compile aspectj code with a testing program, type
ajc -1.5 -d <testing program dir>_MOP -inpath <testing program dir> *.aj
To execute a monitored testing program, type
In Windows,
java -cp "%CLASSPATH%";<testing program dir>_MOP <testing program class>
In Linux or Mac,
java -cp "$CLASSPATH":<testing program dir>_MOP <testing program class>
5. Contact Information
If you experience any problems installing JavaMOP, please feel free to contact
us by sending emails to mop@cs.uiuc.edu. Bug reports can be submitted
at javamop.googlecode.com.