|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.filechooser.FileSystemView
public abstract class FileSystemView
FileSystemView is JFileChooser's gateway to the file system. Since the JDK1.1 File API doesn't allow access to such information as root partitions, file type information, or hidden file bits, this class is designed to intuit as much OS-specific file system information as possible.
Java Licensees may want to provide a different implementation of FileSystemView to better handle a given operating system.
| Constructor Summary | |
|---|---|
FileSystemView()
|
| Method Summary | |
|---|---|
File |
createFileObject(File dir,
String filename)
Returns a File object constructed in dir from the given filename. |
File |
createFileObject(String path)
Returns a File object constructed from the given path string. |
protected File |
createFileSystemRoot(File f)
Creates a new File object for f with correct
behavior for a file system root directory. |
abstract File |
createNewFolder(File containingDir)
Creates a new folder with a default folder name. |
File |
getChild(File parent,
String fileName)
|
File |
getDefaultDirectory()
Return the user's default starting directory for the file chooser. |
File[] |
getFiles(File dir,
boolean useFileHiding)
Gets the list of shown (i.e. |
static FileSystemView |
getFileSystemView()
|
File |
getHomeDirectory()
|
File |
getParentDirectory(File dir)
Returns the parent directory of dir . |
File[] |
getRoots()
Returns all root partitions on this system. |
String |
getSystemDisplayName(File f)
Name of a file, directory, or folder as it would be displayed in a system file browser. |
Icon |
getSystemIcon(File f)
Icon for a file, directory, or folder as it would be displayed in a system file browser. |
String |
getSystemTypeDescription(File f)
Type description for a file, directory, or folder as it would be displayed in a system file browser. |
boolean |
isComputerNode(File dir)
Used by UI classes to decide whether to display a special icon for a computer node, e.g. |
boolean |
isDrive(File dir)
Used by UI classes to decide whether to display a special icon for drives or partitions, e.g. |
boolean |
isFileSystem(File f)
Checks if f represents a real directory or file as opposed to a
special folder such as "Desktop" . |
boolean |
isFileSystemRoot(File dir)
Is dir the root of a tree in the file system, such as a drive or partition. |
boolean |
isFloppyDrive(File dir)
Used by UI classes to decide whether to display a special icon for a floppy disk. |
boolean |
isHiddenFile(File f)
Returns whether a file is hidden or not. |
boolean |
isParent(File folder,
File file)
On Windows, a file can appear in multiple folders, other than its parent directory in the filesystem. |
boolean |
isRoot(File f)
Determines if the given file is a root in the navigatable tree(s). |
Boolean |
isTraversable(File f)
Returns true if the file (directory) can be visited. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileSystemView()
| Method Detail |
|---|
public static FileSystemView getFileSystemView()
public boolean isRoot(File f)
C:\
, D:\
, etc. Unix has one root,
the "/"
directory.
The default implementation gets information from the ShellFolder
class.
f
- a File
object representing a directory
true
if f
is a root in the navigatable tree.isFileSystemRoot(java.io.File)
public Boolean isTraversable(File f)
f
- the File
true
if the file/directory can be traversed, otherwise false
JFileChooser.isTraversable(java.io.File)
,
FileView.isTraversable(java.io.File)
public String getSystemDisplayName(File f)
f
- a File
object
JFileChooser.getName(java.io.File)
public String getSystemTypeDescription(File f)
f
- a File
object
JFileChooser.getTypeDescription(java.io.File)
public Icon getSystemIcon(File f)
f
- a File
object
JFileChooser.getIcon(java.io.File)
public boolean isParent(File folder, File file)
folder
- a File
object repesenting a directory or special folderfile
- a File
object
true
if folder
is a directory or special folder and contains file
.public File getChild(File parent, String fileName)
parent
- a File
object repesenting a directory or special folderfileName
- a name of a file or folder which exists in parent
new
File(parent, fileName)
except when parent and child are both
special folders, in which case the File
is a wrapper containing
a ShellFolder
object.public boolean isFileSystem(File f)
f
represents a real directory or file as opposed to a
special folder such as "Desktop"
. Used by UI classes to decide if
a folder is selectable when doing directory choosing.
f
- a File
object
true
if f
is a real file or directory.public abstract File createNewFolder(File containingDir) throws IOException
IOException
public boolean isHiddenFile(File f)
public boolean isFileSystemRoot(File dir)
f
- a File
object representing a directory
true
if f
is a root of a filesystemisRoot(java.io.File)
public boolean isDrive(File dir)
dir
- a directory
false
alwayspublic boolean isFloppyDrive(File dir)
dir
- a directory
false
alwayspublic boolean isComputerNode(File dir)
dir
- a directory
false
alwayspublic File[] getRoots()
public File getHomeDirectory()
public File getDefaultDirectory()
File
object representing the default
starting folderpublic File createFileObject(File dir, String filename)
public File createFileObject(String path)
public File[] getFiles(File dir, boolean useFileHiding)
public File getParentDirectory(File dir)
dir
.
dir
- the File
being queried
dir
, or
null
if dir
is null
protected File createFileSystemRoot(File f)
File
object for f
with correct
behavior for a file system root directory.
f
- a File
object representing a file system root
directory, for example "/" on Unix or "C:\" on Windows.
File
object
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


Welcome
Who wants to be a milionare?
EcmaScript? What is that?
JAVA or not?
Give me a five :) => Ecmascript 5
JavaScript is everywhere
Good Parts
Object Oriented -even if some of them are possible via prototyping
Anonymous Functions
Functions as First-class Objects
Closure Function
Immediately-Invoked Function Expression (IIFE)
What have we here?
A javascript playground
Let's check it
JavaScript Statement can consist of:
Values
Operators
Expressions
Keywords
Comments
What is very very important when you enter new statement?
The end of it :) What is all about ";"?
Example #1
How to define variable
Variable naming:
The first character must be a letter, an underscore (_), or a dollar sign ($)
Names are case sensiteve!
Strong typing,Static typing... Do we really needs this ?
Example #2 (declariation, double declariation)
Intorduction to Hoisting
All variable in javascript can be used before they have been declared.
Interpreter,compilter goes two times over the code
JavaScript only hoists declarations, not initializations.
Example #3 (simple and with loop)
JavaScript Literals
Numbers
Strings
JavaScript Operators
+,-,*,/, ++, --, ==, ===, !== , !=
Example #4 Adding string and numbers
Good practice === (preferd) and ==
Example #5 == vs ===
Data Types
Dynamics types
numbers, strings, arrays, objects, functions...
Numbers
JavaScript numbers are always stored as double precision floating point numbers, following the international IEEE 754 standard.
Example #6
Nan, MAX_VALUE, MIN_VALUE, NEGATIVE_INFINITY, POSITIVE_INFINITY
String
Is there any difference between '' and ""
special characters like in java
length,charAt, etc..
Date
Zero time is 01 January 1970 00:00:00 UTC.
new Date (.....)
Example #7 Compare the dates
Arrays
How to construc new array?
Can contains different objects.
Array is an object!!!
Example #8 with lenght
Introduction to objects
How to create a new one? new operator,Object.create, {}
Example #9 new object (x3), getting values.
JSON stands for JavaScript Object Notation
JSON names require double quotes. JavaScript names don't.
Example #10 JSON.parse
Null,Undefined. What is a different?
NULL is an object.
What about undefined?
When they are used?
Example #11 comparation
Conditional/Loop statements
if... else
Loops:
for - loops through a block of code a number of times
for/in - loops through the properties of an object
Example #12 (on array and object)
while, do...while- loops through a block of code while a specified condition is true
Books, Pages,Tools
Javascript Ninja
http://developer.mozilla.org
http://jsfiddle.net


{{questionTitle}}
asked {{creation_date}}
{{#image_url}}
{{/image_url}}
{{askerName}}
A new answer from
{{answererName}}
has been posted:
{{answerBody}}...


| 1 | package fr.sii.ogham.helper.email; | |
| 2 | ||
| 3 | import java.io.IOException; | |
| 4 | import java.io.InputStream; | |
| 5 | import java.nio.charset.Charset; | |
| 6 | import java.util.ArrayList; | |
| 7 | import java.util.List; | |
| 8 | import java.util.regex.Pattern; | |
| 9 | ||
| 10 | import javax.mail.Address; | |
| 11 | import javax.mail.BodyPart; | |
| 12 | import javax.mail.Message; | |
| 13 | import javax.mail.Message.RecipientType; | |
| 14 | import javax.mail.MessagingException; | |
| 15 | import javax.mail.Multipart; | |
| 16 | import javax.mail.Part; | |
| 17 | ||
| 18 | import org.apache.commons.io.IOUtils; | |
| 19 | import org.junit.Assert; | |
| 20 | import org.junit.ComparisonFailure; | |
| 21 | ||
| 22 | import fr.sii.ogham.helper.html.AssertHtml; | |
| 23 | ||
| 24 | /** | |
| 25 | * Utility class for checking if the received email content is as expected. | |
| 26 | * | |
| 27 | * @author Aurélien Baudet | |
| 28 | * | |
| 29 | */ | |
| 30 | public class AssertEmail { | |
| 31 | private static final Pattern HTML_PATTERN = Pattern.compile("<html", Pattern.CASE_INSENSITIVE); | |
| 32 | private static final Pattern TEXT_OR_HTML_MIMETYPES = Pattern.compile("^((text/)|(application/x?html)).*", Pattern.CASE_INSENSITIVE); | |
| 33 | ||
| 34 | /** | |
| 35 | * Assert that the fields of the received email are equal to the expected | |
| 36 | * values. The expected email contains several parts (several contents). The | |
| 37 | * received email should also have the equivalent parts. It will check that: | |
| 38 | *
 | |
| 39 | *
The received headers are respected (see | |
| 40 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 41 | *
The received message is a {@link Multipart} email
 | |
| 42 | *
The number of parts are equal
 | |
| 43 | *
Each received part body equals the expected one (order is important). | |
| 44 | * See {@link #assertBody(String, String, boolean)}
 | |
| 45 | *
Each received part Mime Type equals the expected one (order is | |
| 46 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 47 | *
 | |
| 48 | *
 | |
| 49 | * The checking of the body is done strictly (totally equal). | |
| 50 | *
 | |
| 51 | * | |
| 52 | * @param expectedEmail | |
| 53 | * all the fields with their expected values | |
| 54 | * @param actualEmail | |
| 55 | * the received email | |
| 56 | * @throws MessagingException | |
| 57 | * when accessing the received email fails | |
| 58 | * @throws IOException | |
| 59 | * when reading the content of the email fails | |
| 60 | */ | |
| 61 | public static void assertEquals(ExpectedMultiPartEmail expectedEmail, Message actualEmail) throws MessagingException, IOException { | |
| 62 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertEquals(expectedEmail, actualEmail, true); |
| 63 | } | |
| 64 | ||
| 65 | /** | |
| 66 | *
 | |
| 67 | * Shortcut to simplify unit testing with GreenMail. See | |
| 68 | * {@link #assertEquals(ExpectedMultiPartEmail[], Message[])}. | |
| 69 | *
 | |
| 70 | * Assert that the fields of the received email are equal to the expected | |
| 71 | * values. The expected email contains several parts (several contents). The | |
| 72 | * received email should also have the equivalent parts. It will check that: | |
| 73 | *
 | |
| 74 | *
The received headers are respected (see | |
| 75 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 76 | *
The received message is a {@link Multipart} email
 | |
| 77 | *
The number of parts are equal
 | |
| 78 | *
Each received part body equals the expected one (order is important). | |
| 79 | * See {@link #assertBody(String, String, boolean)}
 | |
| 80 | *
Each received part Mime Type equals the expected one (order is | |
| 81 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 82 | *
 | |
| 83 | *
 | |
| 84 | * The checking of the body is done strictly (totally equal). | |
| 85 | *
 | |
| 86 | * | |
| 87 | * @param expectedEmail | |
| 88 | * all the fields with their expected values | |
| 89 | * @param actualEmails | |
| 90 | * the received email | |
| 91 | * @throws MessagingException | |
| 92 | * when accessing the received email fails | |
| 93 | * @throws IOException | |
| 94 | * when reading the content of the email fails | |
| 95 | */ | |
| 96 | public static void assertEquals(ExpectedMultiPartEmail expectedEmail, Message[] actualEmails) throws MessagingException, IOException { | |
| 97 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertEquals(new ExpectedMultiPartEmail[] { expectedEmail }, actualEmails); |
| 98 | } | |
| 99 | ||
| 100 | /** | |
| 101 | * Assert that each received email content respects the expected one. It | |
| 102 | * ensures that the number of received emails equals to the expected number. | |
| 103 | * Then for each email it calls | |
| 104 | * {@link #assertEquals(ExpectedMultiPartEmail, Message)} . | |
| 105 | * | |
| 106 | * @param expectedEmails | |
| 107 | * the list of expected emails | |
| 108 | * @param actualEmails | |
| 109 | * the received emails | |
| 110 | * @throws MessagingException | |
| 111 | * when accessing the received email fails | |
| 112 | * @throws IOException | |
| 113 | * when reading the content of the email fails | |
| 114 | */ | |
| 115 | public static void assertEquals(ExpectedMultiPartEmail[] expectedEmails, Message[] actualEmails) throws MessagingException, IOException { | |
| 116 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("should have " + expectedEmails.length + " email", expectedEmails.length, actualEmails.length); |
| 117 | for (int i = 0; i < expectedEmails.length; i++) { | |
| 118 | assertEquals(expectedEmails[i], actualEmails[i]); | |
| 119 | } | |
| 120 | } | |
| 121 | ||
| 122 | /** | |
| 123 | *
 | |
| 124 | * Shortcut to simplify unit testing with GreenMail. See | |
| 125 | * {@link #assertEquals(ExpectedEmail[], Message[])}. | |
| 126 | *
 | |
| 127 | * Assert that the fields of the received email are equal to the expected | |
| 128 | * values. The expected email contains only one part (only one content). It | |
| 129 | * will check that: | |
| 130 | *
 | |
| 131 | *
The received headers are respected (see | |
| 132 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 133 | *
The body equals the expected one (order is important). See | |
| 134 | * {@link #assertBody(String, String, boolean)}
 | |
| 135 | *
The Mime Type equals the expected one (order is important). See | |
| 136 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 137 | *
 | |
| 138 | *
 | |
| 139 | * The checking of the body is done strictly (totally equal). | |
| 140 | *
 | |
| 141 | * | |
| 142 | * | |
| 143 | * @param expectedEmail | |
| 144 | * all the fields with their expected values | |
| 145 | * @param actualEmails | |
| 146 | * the received emails | |
| 147 | * @throws MessagingException | |
| 148 | * when accessing the received email fails | |
| 149 | */ | |
| 150 | public static void assertEquals(ExpectedEmail expectedEmail, Message[] actualEmails) throws MessagingException { | |
| 151 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertEquals(new ExpectedEmail[] { expectedEmail }, actualEmails); |
| 152 | } | |
| 153 | ||
| 154 | /** | |
| 155 | * Assert that each received email content respects the expected one. It | |
| 156 | * ensures that the number of received emails equals to the expected number. | |
| 157 | * Then for each email it calls | |
| 158 | * {@link #assertEquals(ExpectedEmail, Message)} . | |
| 159 | * | |
| 160 | * @param expectedEmail | |
| 161 | * the expected email | |
| 162 | * @param actualEmails | |
| 163 | * the received emails | |
| 164 | * @throws MessagingException | |
| 165 | * when accessing the received email fails | |
| 166 | */ | |
| 167 | public static void assertEquals(ExpectedEmail[] expectedEmail, Message[] actualEmails) throws MessagingException { | |
| 168 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("should have " + expectedEmail.length + " email", expectedEmail.length, actualEmails.length); |
| 169 | for (int i = 0; i < expectedEmail.length; i++) { | |
| 170 | assertEquals(expectedEmail[i], actualEmails[i]); | |
| 171 | } | |
| 172 | } | |
| 173 | ||
| 174 | /** | |
| 175 | * Assert that the fields of the received email are equal to the expected | |
| 176 | * values. The expected email contains only one part (only one content). It | |
| 177 | * will check that: | |
| 178 | *
 | |
| 179 | *
The received headers are respected (see | |
| 180 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 181 | *
The body equals the expected one (order is important). See | |
| 182 | * {@link #assertBody(String, String, boolean)}
 | |
| 183 | *
The Mime Type equals the expected one (order is important). See | |
| 184 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 185 | *
 | |
| 186 | *
 | |
| 187 | * The checking of the body is done strictly (totally equal). | |
| 188 | *
 | |
| 189 | * | |
| 190 | * @param expectedEmail | |
| 191 | * all the fields with their expected values | |
| 192 | * @param actualEmail | |
| 193 | * the received email | |
| 194 | * @throws MessagingException | |
| 195 | * when accessing the received email fails | |
| 196 | */ | |
| 197 | public static void assertEquals(ExpectedEmail expectedEmail, Message actualEmail) throws MessagingException { | |
| 198 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertEquals(expectedEmail, actualEmail, true); |
| 199 | } | |
| 200 | ||
| 201 | /** | |
| 202 | * Assert that the fields of the received email are equal to the expected | |
| 203 | * values. The expected email contains several parts (several contents). The | |
| 204 | * received email should also have the equivalent parts. It will check that: | |
| 205 | *
 | |
| 206 | *
The received headers are respected (see | |
| 207 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 208 | *
The received message is a {@link Multipart} email
 | |
| 209 | *
The number of parts are equal
 | |
| 210 | *
Each received part body equals the expected one (order is important). | |
| 211 | * See {@link #assertBody(String, String, boolean)}
 | |
| 212 | *
Each received part Mime Type equals the expected one (order is | |
| 213 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 214 | *
 | |
| 215 | *
 | |
| 216 | * The checking of the body ignores the new line characters. | |
| 217 | *
 | |
| 218 | * | |
| 219 | * @param expectedEmail | |
| 220 | * all the fields with their expected values | |
| 221 | * @param actualEmail | |
| 222 | * the received email | |
| 223 | * @throws MessagingException | |
| 224 | * when accessing the received email fails | |
| 225 | * @throws IOException | |
| 226 | * when reading the content of the email fails | |
| 227 | */ | |
| 228 | public static void assertSimilar(ExpectedMultiPartEmail expectedEmail, Message actualEmail) throws MessagingException, IOException { | |
| 229 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
assertEquals(expectedEmail, actualEmail, false); |
| 230 | } | |
| 231 | ||
| 232 | /** | |
| 233 | *
 | |
| 234 | * Shortcut to simplify unit testing with GreenMail. See | |
| 235 | * {@link #assertSimilar(ExpectedMultiPartEmail[], Message[])}. | |
| 236 | *
 | |
| 237 | * Assert that the fields of the received email are equal to the expected | |
| 238 | * values. The expected email contains several parts (several contents). The | |
| 239 | * received email should also have the equivalent parts. It will check that: | |
| 240 | *
 | |
| 241 | *
The received headers are respected (see | |
| 242 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 243 | *
The received message is a {@link Multipart} email
 | |
| 244 | *
The number of parts are equal
 | |
| 245 | *
Each received part body equals the expected one (order is important). | |
| 246 | * See {@link #assertBody(String, String, boolean)}
 | |
| 247 | *
Each received part Mime Type equals the expected one (order is | |
| 248 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 249 | *
 | |
| 250 | *
 | |
| 251 | * The checking of the body ignores the new line characters. | |
| 252 | *
 | |
| 253 | * | |
| 254 | * @param expectedEmail | |
| 255 | * all the fields with their expected values | |
| 256 | * @param actualEmails | |
| 257 | * the received email | |
| 258 | * @throws MessagingException | |
| 259 | * when accessing the received email fails | |
| 260 | * @throws IOException | |
| 261 | * when reading the content of the email fails | |
| 262 | */ | |
| 263 | public static void assertSimilar(ExpectedMultiPartEmail expectedEmail, Message[] actualEmails) throws MessagingException, IOException { | |
| 264 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
assertSimilar(new ExpectedMultiPartEmail[] { expectedEmail }, actualEmails); |
| 265 | } | |
| 266 | ||
| 267 | /** | |
| 268 | * Assert that each received email content respects the expected one. It | |
| 269 | * ensures that the number of received emails equals to the expected number. | |
| 270 | * Then for each email it calls | |
| 271 | * {@link #assertSimilar(ExpectedMultiPartEmail, Message)} . | |
| 272 | * | |
| 273 | * @param expectedEmails | |
| 274 | * the list of expected emails | |
| 275 | * @param actualEmails | |
| 276 | * the received emails | |
| 277 | * @throws MessagingException | |
| 278 | * when accessing the received email fails | |
| 279 | * @throws IOException | |
| 280 | * when reading the content of the email fails | |
| 281 | */ | |
| 282 | public static void assertSimilar(ExpectedMultiPartEmail[] expectedEmails, Message[] actualEmails) throws MessagingException, IOException { | |
| 283 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("should have " + expectedEmails.length + " email", expectedEmails.length, actualEmails.length); |
| 284 | for (int i = 0; i < expectedEmails.length; i++) { | |
| 285 | assertSimilar(expectedEmails[i], actualEmails[i]); | |
| 286 | } | |
| 287 | } | |
| 288 | ||
| 289 | /** | |
| 290 | *
 | |
| 291 | * Shortcut to simplify unit testing with GreenMail. See | |
| 292 | * {@link #assertSimilar(ExpectedEmail[], Message[])}. | |
| 293 | *
 | |
| 294 | * Assert that the fields of the received email are equal to the expected | |
| 295 | * values. The expected email contains only one part (only one content). It | |
| 296 | * will check that: | |
| 297 | *
 | |
| 298 | *
The received headers are respected (see | |
| 299 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 300 | *
The body equals the expected one (order is important). See | |
| 301 | * {@link #assertBody(String, String, boolean)}
 | |
| 302 | *
The Mime Type equals the expected one (order is important). See | |
| 303 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 304 | *
 | |
| 305 | *
 | |
| 306 | * The checking of the body ignores the new line characters. | |
| 307 | *
 | |
| 308 | * | |
| 309 | * | |
| 310 | * @param expectedEmail | |
| 311 | * all the fields with their expected values | |
| 312 | * @param actualEmails | |
| 313 | * the received emails | |
| 314 | * @throws MessagingException | |
| 315 | * when accessing the received email fails | |
| 316 | */ | |
| 317 | public static void assertSimilar(ExpectedEmail expectedEmail, Message[] actualEmails) throws MessagingException { | |
| 318 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
assertSimilar(new ExpectedEmail[] { expectedEmail }, actualEmails); |
| 319 | } | |
| 320 | ||
| 321 | /** | |
| 322 | * Assert that each received email content respects the expected one. It | |
| 323 | * ensures that the number of received emails equals to the expected number. | |
| 324 | * Then for each email it calls | |
| 325 | * {@link #assertSimilar(ExpectedEmail, Message)} . | |
| 326 | * | |
| 327 | * @param expectedEmail | |
| 328 | * the expected email | |
| 329 | * @param actualEmails | |
| 330 | * the received emails | |
| 331 | * @throws MessagingException | |
| 332 | * when accessing the received email fails | |
| 333 | */ | |
| 334 | public static void assertSimilar(ExpectedEmail[] expectedEmail, Message[] actualEmails) throws MessagingException { | |
| 335 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("should have " + expectedEmail.length + " email", expectedEmail.length, actualEmails.length); |
| 336 | for (int i = 0; i < expectedEmail.length; i++) { | |
| 337 | assertSimilar(expectedEmail[i], actualEmails[i]); | |
| 338 | } | |
| 339 | } | |
| 340 | ||
| 341 | /** | |
| 342 | * Assert that the fields of the received email are equal to the expected | |
| 343 | * values. The expected email contains only one part (only one content). It | |
| 344 | * will check that: | |
| 345 | *
 | |
| 346 | *
The received headers are respected (see | |
| 347 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 348 | *
The body equals the expected one (order is important). See | |
| 349 | * {@link #assertBody(String, String, boolean)}
 | |
| 350 | *
The Mime Type equals the expected one (order is important). See | |
| 351 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 352 | *
 | |
| 353 | *
 | |
| 354 | * The checking of the body ignores the new line characters. | |
| 355 | *
 | |
| 356 | * | |
| 357 | * @param expectedEmail | |
| 358 | * all the fields with their expected values | |
| 359 | * @param actualEmail | |
| 360 | * the received email | |
| 361 | * @throws MessagingException | |
| 362 | * when accessing the received email fails | |
| 363 | */ | |
| 364 | public static void assertSimilar(ExpectedEmail expectedEmail, Message actualEmail) throws MessagingException { | |
| 365 |
1
1. assertSimilar : All method instructions removed → NO_COVERAGE |
assertEquals(expectedEmail, actualEmail, false); |
| 366 | } | |
| 367 | ||
| 368 | /** | |
| 369 | * Assert that the fields of the received email are equal to the expected | |
| 370 | * values. The expected email contains several parts (several contents). The | |
| 371 | * received email should also have the equivalent parts. It will check that: | |
| 372 | *
 | |
| 373 | *
The received headers are respected (see | |
| 374 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 375 | *
The received message is a {@link Multipart} email
 | |
| 376 | *
The number of parts are equal
 | |
| 377 | *
Each received part body equals the expected one (order is important). | |
| 378 | * See {@link #assertBody(String, String, boolean)}
 | |
| 379 | *
Each received part Mime Type equals the expected one (order is | |
| 380 | * important). See {@link #assertMimetype(ExpectedContent, String)}
 | |
| 381 | *
 | |
| 382 | *
 | |
| 383 | * The checking of the body may be done either strictly (totally equal) or | |
| 384 | * not (new line characters are ignored). | |
| 385 | *
 | |
| 386 | * | |
| 387 | * @param expectedEmail | |
| 388 | * all the fields with their expected values | |
| 389 | * @param actualEmail | |
| 390 | * the received email | |
| 391 | * @param strict | |
| 392 | * true for strict checking (totally equals) or false to ignore | |
| 393 | * new line characters in body contents | |
| 394 | * @throws MessagingException | |
| 395 | * when accessing the received email fails | |
| 396 | * @throws IOException | |
| 397 | * when reading the content of the email fails | |
| 398 | */ | |
| 399 | public static void assertEquals(ExpectedMultiPartEmail expectedEmail, Message actualEmail, boolean strict) throws MessagingException, IOException { | |
| 400 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertHeaders(expectedEmail, actualEmail); |
| 401 | Object content = actualEmail.getContent(); | |
| 402 | Assert.assertTrue("should be multipart message", content instanceof Multipart); | |
| 403 | List<Part> bodyParts = getBodyParts(actualEmail); | |
| 404 | Assert.assertEquals("should have " + expectedEmail.getExpectedContents().length + " parts", expectedEmail.getExpectedContents().length, bodyParts.size()); | |
| 405 | for (int i = 0; i < expectedEmail.getExpectedContents().length; i++) { | |
| 406 | assertBody(expectedEmail.getExpectedContents()[i].getBody(), bodyParts.get(i).getContent().toString(), strict); | |
| 407 | assertMimetype(expectedEmail.getExpectedContents()[i], bodyParts.get(i).getContentType()); | |
| 408 | } | |
| 409 | } | |
| 410 | ||
| 411 | /** | |
| 412 | * Assert that the fields of the received email are equal to the expected | |
| 413 | * values. The expected email contains only one part (only one content). It | |
| 414 | * will check that: | |
| 415 | *
 | |
| 416 | *
The received headers are respected (see | |
| 417 | * {@link #assertHeaders(ExpectedEmailHeader, Message)})
 | |
| 418 | *
The body equals the expected one (order is important). See | |
| 419 | * {@link #assertBody(String, String, boolean)}
 | |
| 420 | *
The Mime Type equals the expected one (order is important). See | |
| 421 | * {@link #assertMimetype(ExpectedContent, String)}
 | |
| 422 | *
 | |
| 423 | *
 | |
| 424 | * The checking of the body may be done either strictly (totally equal) or | |
| 425 | * not (new line characters are ignored). | |
| 426 | *
 | |
| 427 | * | |
| 428 | * @param expectedEmail | |
| 429 | * all the fields with their expected values | |
| 430 | * @param actualEmail | |
| 431 | * the received email | |
| 432 | * @param strict | |
| 433 | * true for strict checking (totally equals) or false to ignore | |
| 434 | * new line characters in body contents | |
| 435 | * @throws MessagingException | |
| 436 | * when accessing the received email fails | |
| 437 | */ | |
| 438 | public static void assertEquals(ExpectedEmail expectedEmail, Message actualEmail, boolean strict) throws MessagingException { | |
| 439 |
1
1. assertEquals : All method instructions removed → NO_COVERAGE |
assertHeaders(expectedEmail, actualEmail); |
| 440 | assertBody(expectedEmail.getExpectedContent().getBody(), getBody(actualEmail), strict); | |
| 441 | assertMimetype(expectedEmail.getExpectedContent(), getBodyMimetype(actualEmail)); | |
| 442 | } | |
| 443 | ||
| 444 | /** | |
| 445 | * Checks that the received Mime Type for the message is like the expected | |
| 446 | * Mime Type. The expected Mime Type is a regular expression. | |
| 447 | * | |
| 448 | * @param expectedContent | |
| 449 | * the expected email content that contains the expected Mime | |
| 450 | * Type as regular expression | |
| 451 | * @param actualEmail | |
| 452 | * the received email to check | |
| 453 | * @throws MessagingException | |
| 454 | * when accessing the received email fails | |
| 455 | */ | |
| 456 | public static void assertMimetype(ExpectedContent expectedContent, Message actualEmail) throws MessagingException { | |
| 457 |
1
1. assertMimetype : All method instructions removed → NO_COVERAGE |
assertMimetype(expectedContent, actualEmail.getContentType()); |
| 458 | } | |
| 459 | ||
| 460 | /** | |
| 461 | * Checks that the received Mime Type for the message is like the expected | |
| 462 | * Mime Type. The expected Mime Type is a regular expression. | |
| 463 | * | |
| 464 | * @param expectedContent | |
| 465 | * the expected email content that contains the expected Mime | |
| 466 | * Type as regular expression | |
| 467 | * @param contentType | |
| 468 | * the received email Mime Type | |
| 469 | * @throws MessagingException | |
| 470 | * when accessing the received email fails | |
| 471 | */ | |
| 472 | private static void assertMimetype(ExpectedContent expectedContent, String contentType) throws MessagingException { | |
| 473 |
1
1. assertMimetype : All method instructions removed → NO_COVERAGE |
Assert.assertTrue("mimetype should be " + expectedContent.getMimetype() + " instead of " + contentType, expectedContent.getMimetype().matcher(contentType).matches()); |
| 474 | } | |
| 475 | ||
| 476 | /** | |
| 477 | * Checks if the received body equals the expected body. It handles HTML | |
| 478 | * content and pure text content. | |
| 479 | *
 | |
| 480 | * For text, the check can be done either strictly (totally equal) or not | |
| 481 | * (ignore new lines). | |
| 482 | *
 | |
| 483 | *
 | |
| 484 | * For HTML, the string content is parsed and DOM trees are compared. The | |
| 485 | * comparison can be done either strictly (DOM trees are totally equals, | |
| 486 | * attributes are in the same order) or not (attributes can be in any | |
| 487 | * order). | |
| 488 | *
 | |
| 489 | * | |
| 490 | * @param expectedBody | |
| 491 | * the expected content as string | |
| 492 | * @param actualBody | |
| 493 | * the received content as string | |
| 494 | * @param strict | |
| 495 | * true for strict checking (totally equals) or false to ignore | |
| 496 | * new line characters | |
| 497 | */ | |
| 498 | private static void assertBody(String expectedBody, String actualBody, boolean strict) { | |
| 499 |
1
1. assertBody : All method instructions removed → NO_COVERAGE |
if (isHtml(expectedBody)) { |
| 500 | if (strict) { | |
| 501 | AssertHtml.assertIdentical(expectedBody, actualBody); | |
| 502 | } else { | |
| 503 | AssertHtml.assertSimilar(expectedBody, actualBody); | |
| 504 | } | |
| 505 | } else { | |
| 506 | if(strict ? !expectedBody.equals(actualBody) : !sanitize(expectedBody).equals(sanitize(actualBody))) { | |
| 507 | throw new ComparisonFailure("body should be '" + expectedBody + "'", expectedBody, actualBody); | |
| 508 | } | |
| 509 | } | |
| 510 | } | |
| 511 | ||
| 512 | /** | |
| 513 | * Checks if the received headers corresponds to the expected header values. | |
| 514 | * It checks if: | |
| 515 | *
 | |
| 516 | *
The received subject equals the expected subject
 | |
| 517 | *
The email sender address equals the expected sender address
 | |
| 518 | *
The total number of recipients equals the total number of expected | |
| 519 | * recipients
 | |
| 520 | *
The number of "to" recipients equals the number of expected "to" | |
| 521 | * recipients
 | |
| 522 | *
The number of "cc" recipients equals the number of expected "cc" | |
| 523 | * recipients
 | |
| 524 | *
The number of "bcc" recipients equals the number of expected "bcc" | |
| 525 | * recipients
 | |
| 526 | *
Each "to" recipient equals the expected "to" recipient value
 | |
| 527 | *
Each "cc" recipient equals the expected "cc" recipient value
 | |
| 528 | *
Each "bcc" recipient equals the expected "bcc" recipient value
 | |
| 529 | *
 | |
| 530 | * | |
| 531 | * @param expectedEmail | |
| 532 | * the expected header values | |
| 533 | * @param actualEmail | |
| 534 | * the received header values | |
| 535 | * @throws MessagingException | |
| 536 | * when accessing the received email fails | |
| 537 | */ | |
| 538 | private static void assertHeaders(ExpectedEmailHeader expectedEmail, Message actualEmail) throws MessagingException { | |
| 539 |
1
1. assertHeaders : All method instructions removed → NO_COVERAGE |
Assert.assertEquals("subject should be '" + expectedEmail.getSubject() + "'", expectedEmail.getSubject(), actualEmail.getSubject()); |
| 540 | Assert.assertEquals("should have only one from", 1, actualEmail.getFrom().length); | |
| 541 | Assert.assertEquals("from should be '" + expectedEmail.getFrom() + "'", expectedEmail.getFrom(), actualEmail.getFrom()[0].toString()); | |
| 542 | int recipients = expectedEmail.getTo().size() + expectedEmail.getBcc().size() + expectedEmail.getCc().size(); | |
| 543 | Assert.assertEquals("should have only " + recipients + " recipients", recipients, actualEmail.getAllRecipients().length); | |
| 544 | assertRecipients(expectedEmail.getTo(), actualEmail, RecipientType.TO); | |
| 545 | assertRecipients(expectedEmail.getCc(), actualEmail, RecipientType.CC); | |
| 546 | assertRecipients(expectedEmail.getBcc(), actualEmail, RecipientType.BCC); | |
| 547 | } | |
| 548 | ||
| 549 | /** | |
| 550 | * Checks if the received headers corresponds to the expected header values. | |
| 551 | * It checks if: | |
| 552 | *
 | |
| 553 | *
The number of recipients of the provided type equals the number of | |
| 554 | * expected recipients of the provided type
 | |
| 555 | *
Each recipient of the provided type equals the expected recipient | |
| 556 | * value of the provided type
 | |
| 557 | *
 | |
| 558 | * | |
| 559 | * @param expectedRecipients | |
| 560 | * the list of recipient string values | |
| 561 | * @param actualEmail | |
| 562 | * the received header values | |
| 563 | * @param recipientType | |
| 564 | * the type of the recipient to compare | |
| 565 | * @throws MessagingException | |
| 566 | * when accessing the received email fails | |
| 567 | */ | |
| 568 | private static void assertRecipients(List<String> expectedRecipients, Message actualEmail, RecipientType recipientType) throws MessagingException { | |
| 569 |
1
1. assertRecipients : All method instructions removed → NO_COVERAGE |
Address[] actualRecipients = actualEmail.getRecipients(recipientType); |
| 570 | if (expectedRecipients.isEmpty()) { | |
| 571 | Assert.assertTrue("should have no recipients " + recipientType, actualRecipients == null || actualRecipients.length == 0); | |
| 572 | } else { | |
| 573 | Assert.assertEquals("should have only " + expectedRecipients.size() + " " + recipientType, expectedRecipients.size(), actualRecipients.length); | |
| 574 | for (int i = 0; i < expectedRecipients.size(); i++) { | |
| 575 | Assert.assertEquals(recipientType + "[" + i + "] should be '" + expectedRecipients.get(i) + "'", expectedRecipients.get(i), actualRecipients[i].toString()); | |
| 576 | } | |
| 577 | } | |
| 578 | } | |
| 579 | ||
| 580 | /** | |
| 581 | * Remove new lines from the string. | |
| 582 | * | |
| 583 | * @param str | |
| 584 | * the string to sanitize | |
| 585 | * @return the sanitized string | |
| 586 | */ | |
| 587 | private static String sanitize(String str) { | |
| 588 |
3
1. sanitize : All method body replaced by: return "" → NO_COVERAGE 2. sanitize : All method body replaced by: return "A" → NO_COVERAGE 3. sanitize : All methods instructions replaced by: return null; → NO_COVERAGE |
return str.replaceAll("\r|\n", ""); |
| 589 | } | |
| 590 | ||
| 591 | public static Part getBodyPart(Part actualEmail) throws MessagingException { | |
| 592 |
1
1. getBodyPart : All methods instructions replaced by: return null; → NO_COVERAGE |
List<Part> bodyParts = getBodyParts(actualEmail); |
| 593 | if(bodyParts.isEmpty()) { | |
| 594 | throw new IllegalStateException("Expected at least one body part but none found"); | |
| 595 | } | |
| 596 | return bodyParts.get(0); | |
| 597 | } | |
| 598 | ||
| 599 | public static List<Part> getBodyParts(Part actualEmail) throws MessagingException { | |
| 600 |
1
1. getBodyParts : All methods instructions replaced by: return null; → NO_COVERAGE |
List<Part> founds = new ArrayList<>(); |
| 601 | getBodyParts(actualEmail, founds); | |
| 602 | return founds; | |
| 603 | } | |
| 604 | | |
| 605 | public static void getBodyParts(Part actualEmail, List<Part> founds) throws MessagingException { | |
| 606 | try { | |
| 607 |
1
1. getBodyParts : All method instructions removed → NO_COVERAGE |
Object content = actualEmail.getContent(); |
| 608 | if (content instanceof Multipart) { | |
| 609 | Multipart mp = (Multipart) content; | |
| 610 | for(int i=0 ; i<mp.getCount() ; i++) { | |
| 611 | BodyPart part = mp.getBodyPart(i); | |
| 612 | if(part.getContentType().startsWith("multipart/")) { | |
| 613 | getBodyParts(part, founds); | |
| 614 | } else if(TEXT_OR_HTML_MIMETYPES.matcher(part.getContentType()).matches()){ | |
| 615 | founds.add(part); | |
| 616 | } | |
| 617 | } | |
| 618 | } | |
| 619 | } catch (IOException e) { | |
| 620 | throw new MessagingException("Failed to access content of the mail", e); | |
| 621 | } | |
| 622 | } | |
| 623 | ||
| 624 | public static String getBody(Part actualEmail) throws MessagingException { | |
| 625 | try { | |
| 626 |
3
1. getBody : All method body replaced by: return "" → NO_COVERAGE 2. getBody : All method body replaced by: return "A" → NO_COVERAGE 3. getBody : All methods instructions replaced by: return null; → NO_COVERAGE |
Object content = getBodyPart(actualEmail).getContent(); |
| 627 | if(content instanceof String) { | |
| 628 | return (String) content; | |
| 629 | } else if(content instanceof InputStream) { | |
| 630 | return IOUtils.toString((InputStream) content, Charset.defaultCharset()); | |
| 631 | } else { | |
| 632 | return content.toString(); | |
| 633 | } | |
| 634 | } catch (IOException e) { | |
| 635 | throw new MessagingException("Failed to access content of the mail", e); | |
| 636 | } | |
| 637 | } | |
| 638 | ||
| 639 | public static String getBodyMimetype(Part actualEmail) throws MessagingException { | |
| 640 |
3
1. getBodyMimetype : All method body replaced by: return "" → NO_COVERAGE 2. getBodyMimetype : All method body replaced by: return "A" → NO_COVERAGE 3. getBodyMimetype : All methods instructions replaced by: return null; → NO_COVERAGE |
return getBodyPart(actualEmail).getContentType(); |
| 641 | } | |
| 642 | | |
| 643 | private static boolean isHtml(String expectedBody) { | |
| 644 |
2
1. isHtml : All method body replaced by: return false → NO_COVERAGE 2. isHtml : All method body replaced by: return true → NO_COVERAGE |
return HTML_PATTERN.matcher(expectedBody).find(); |
| 645 | } | |
| 646 | | |
| 647 | private AssertEmail() { | |
| 648 | super(); | |
| 649 | } | |
| 650 | } | |
Mutations | ||
| 62 |
1.1 |
|
| 97 |
1.1 |
|
| 116 |
1.1 |
|
| 151 |
1.1 |
|
| 168 |
1.1 |
|
| 198 |
1.1 |
|
| 229 |
1.1 |
|
| 264 |
1.1 |
|
| 283 |
1.1 |
|
| 318 |
1.1 |
|
| 335 |
1.1 |
|
| 365 |
1.1 |
|
| 400 |
1.1 |
|
| 439 |
1.1 |
|
| 457 |
1.1 |
|
| 473 |
1.1 |
|
| 499 |
1.1 |
|
| 539 |
1.1 |
|
| 569 |
1.1 |
|
| 588 |
1.1 2.2 3.3 |
|
| 592 |
1.1 |
|
| 600 |
1.1 |
|
| 607 |
1.1 |
|
| 626 |
1.1 2.2 3.3 |
|
| 640 |
1.1 2.2 3.3 |
|
| 644 |
1.1 2.2 |


lwIP code documentationpap.hGo to the documentation of this file.00001 /***************************************************************************** 00002 * pap.h - PPP Password Authentication Protocol header file. 00003 * 00004 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 00005 * portions Copyright (c) 1997 Global Election Systems Inc. 00006 * 00007 * The authors hereby grant permission to use, copy, modify, distribute, 00008 * and license this software and its documentation for any purpose, provided 00009 * that existing copyright notices are retained in all copies and that this 00010 * notice and the following disclaimer are included verbatim in any 00011 * distributions. No written agreement, license, or royalty fee is required 00012 * for any of the authorized uses. 00013 * 00014 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 00015 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00016 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00017 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00018 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00019 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00020 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00021 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00022 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00023 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 * 00025 ****************************************************************************** 00026 * REVISION HISTORY 00027 * 00028 * 03-01-01 Marc Boucher<EMAIL_ADDRESS>00029 * Ported to lwIP. 00030 * 97-12-04 Guy Lancaster<EMAIL_ADDRESS>Global Election Systems Inc. 00031 * Original derived from BSD codes. 00032 *****************************************************************************/ 00033 /* 00034 * upap.h - User/Password Authentication Protocol definitions. 00035 * 00036 * Copyright (c) 1989 Carnegie Mellon University. 00037 * All rights reserved. 00038 * 00039 * Redistribution and use in source and binary forms are permitted 00040 * provided that the above copyright notice and this paragraph are 00041 * duplicated in all such forms and that any documentation, 00042 * advertising materials, and other materials related to such 00043 * distribution and use acknowledge that the software was developed 00044 * by Carnegie Mellon University. The name of the 00045 * University may not be used to endorse or promote products derived 00046 * from this software without specific prior written permission. 00047 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 00048 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 00049 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00050 */ 00051 00052 00053 #ifndef PAP_H 00054 #define PAP_H 00055 00056 /************************* 00057 *** PUBLIC DEFINITIONS *** 00058 *************************/ 00059 /* 00060 * Packet header = Code, id, length. 00061 */ 00062 #define UPAP_HEADERLEN (sizeof (u_char) + sizeof (u_char) + sizeof (u_short)) 00063 00064 00065 /* 00066 * UPAP codes. 00067 */ 00068 #define UPAP_AUTHREQ 1 /* Authenticate-Request */ 00069 #define UPAP_AUTHACK 2 /* Authenticate-Ack */ 00070 #define UPAP_AUTHNAK 3 /* Authenticate-Nak */ 00071 00072 /* 00073 * Client states. 00074 */ 00075 #define UPAPCS_INITIAL 0 /* Connection down */ 00076 #define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ 00077 #define UPAPCS_PENDING 2 /* Connection down, have requested auth */ 00078 #define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ 00079 #define UPAPCS_OPEN 4 /* We've received an Ack */ 00080 #define UPAPCS_BADAUTH 5 /* We've received a Nak */ 00081 00082 /* 00083 * Server states. 00084 */ 00085 #define UPAPSS_INITIAL 0 /* Connection down */ 00086 #define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ 00087 #define UPAPSS_PENDING 2 /* Connection down, have requested auth */ 00088 #define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ 00089 #define UPAPSS_OPEN 4 /* We've sent an Ack */ 00090 #define UPAPSS_BADAUTH 5 /* We've sent a Nak */ 00091 00092 00093 /************************ 00094 *** PUBLIC DATA TYPES *** 00095 ************************/ 00096 00097 /* 00098 * Each interface is described by upap structure. 00099 */ 00100 typedef struct upap_state { 00101 int us_unit; /* Interface unit number */ 00102 const char *us_user; /* User */ 00103 int us_userlen; /* User length */ 00104 const char *us_passwd; /* Password */ 00105 int us_passwdlen; /* Password length */ 00106 int us_clientstate; /* Client state */ 00107 int us_serverstate; /* Server state */ 00108 u_char us_id; /* Current id */ 00109 int us_timeouttime; /* Timeout (seconds) for auth-req retrans. */ 00110 int us_transmits; /* Number of auth-reqs sent */ 00111 int us_maxtransmits; /* Maximum number of auth-reqs to send */ 00112 int us_reqtimeout; /* Time to wait for auth-req from peer */ 00113 } upap_state; 00114 00115 00116 /*********************** 00117 *** PUBLIC FUNCTIONS *** 00118 ***********************/ 00119 00120 extern upap_state upap[]; 00121 00122 void upap_setloginpasswd(int unit, const char *luser, const char *lpassword); 00123 void upap_authwithpeer (int, char *, char *); 00124 void upap_authpeer (int); 00125 00126 extern struct protent pap_protent; 00127 00128 #endif /* PAP_H */ 00129 |


Class: ActiveSupport::TestCase
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
ActionController::TestCase, ActionDispatch::IntegrationTest, ActionDispatch::SystemTestCase, ActionMailer::TestCase, ActionView::TestCase, ActiveJob::TestCase, Rails::Generators::TestCase
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Testing::Declarative ,
Minitest::Test
|
|
|
Instance Chain:
self,
::ActiveRecord::TestFixtures ,
Testing::FileFixtures ,
Testing::TimeHelpers ,
Testing::Assertions ,
Testing::SetupAndTeardown ,
Minitest::Test
|
|
| Inherits: |
Minitest::Test
|
| Defined in: | activesupport/lib/active_support/test_case.rb, railties/lib/rails/test_help.rb |
Constant Summary
::ActiveRecord::TestFixtures
- Attributes & Methods
- .config rw
- #config rw
- .config? ⇒ Boolean rw
- #config? ⇒ Boolean rw
- .fixture_class_names rw
- #fixture_class_names rw
- .fixture_class_names? ⇒ Boolean rw
- #fixture_class_names? ⇒ Boolean rw
- .fixture_path rw
- #fixture_path readonly
- .fixture_path? ⇒ Boolean rw
- #fixture_path? ⇒ Boolean readonly
- .fixture_table_names rw
- #fixture_table_names rw
- .fixture_table_names? ⇒ Boolean rw
- #fixture_table_names? ⇒ Boolean rw
- .pre_loaded_fixtures rw
- #pre_loaded_fixtures rw
- .pre_loaded_fixtures? ⇒ Boolean rw
- #pre_loaded_fixtures? ⇒ Boolean rw
- .use_instantiated_fixtures rw
- #use_instantiated_fixtures rw
- .use_instantiated_fixtures? ⇒ Boolean rw
- #use_instantiated_fixtures? ⇒ Boolean rw
- .use_transactional_tests rw
- #use_transactional_tests rw
- .use_transactional_tests? ⇒ Boolean rw
- #use_transactional_tests? ⇒ Boolean rw
Testing::FileFixtures
- Attributes & Methods
- .file_fixture_path rw
- #file_fixture_path readonly
- .file_fixture_path? ⇒ Boolean rw
- #file_fixture_path? ⇒ Boolean readonly
Class Attribute Summary
-
.test_order
rw
Returns the order in which test cases are run.
-
.test_order=(new_order)
rw
Sets the order in which test cases are run.
Class Method Summary
Testing::Declarative
- Extended
Instance Attribute Summary
::ActiveRecord::TestFixtures
- Included
Instance Method Summary
- #assert_no_match
- #assert_not_empty
- #assert_not_equal
- #assert_not_in_delta
- #assert_not_in_epsilon
- #assert_not_includes
- #assert_not_instance_of
- #assert_not_kind_of
- #assert_not_nil
- #assert_not_operator
- #assert_not_predicate
- #assert_not_respond_to
- #assert_not_same
-
#assert_raise
test/unit backwards compatibility methods.
- #method_name
::ActiveRecord::TestFixtures
- Included
Testing::FileFixtures
- Included
| #file_fixture | Returns a |
Testing::TimeHelpers
- Included
| #after_teardown, | |
| #freeze_time | Calls |
| #travel | Changes current time to the time in the future or in the past by a given time difference by stubbing |
| #travel_back | Returns the current time back to its original state, by removing the stubs added by |
| #travel_to | Changes current time to the given time by stubbing |
Testing::Assertions
- Included
| #assert_changes | Assertion that the result of evaluating an expression is changed before and after invoking the passed in block. |
| #assert_difference | Test numeric difference between the return value of an expression as a result of what is evaluated in the yielded block. |
| #assert_no_changes | Assertion that the result of evaluating an expression is not changed before and after invoking the passed in block. |
| #assert_no_difference | Assertion that the numeric result of evaluating an expression is not changed before and after invoking the passed in block. |
| #assert_not | Asserts that an expression is not truthy. |
| #assert_nothing_raised | Assertion that the block should not raise an exception. |
Class Attribute Details
.config (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 876
class_attribute :config, default: ActiveRecord::Base
.config? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 876
class_attribute :config, default: ActiveRecord::Base
.file_fixture_path (rw)
[ GitHub ]# File 'activesupport/lib/active_support/testing/file_fixtures.rb', line 18
class_attribute :file_fixture_path, instance_writer: false
.file_fixture_path? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activesupport/lib/active_support/testing/file_fixtures.rb', line 18
class_attribute :file_fixture_path, instance_writer: false
.fixture_class_names (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 872
class_attribute :fixture_class_names, default: {}
.fixture_class_names? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 872
class_attribute :fixture_class_names, default: {}
.fixture_path (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 870
class_attribute :fixture_path, instance_writer: false
.fixture_path? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 870
class_attribute :fixture_path, instance_writer: false
.fixture_table_names (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 871
class_attribute :fixture_table_names, default: []
.fixture_table_names? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 871
class_attribute :fixture_table_names, default: []
.pre_loaded_fixtures (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 875
class_attribute :pre_loaded_fixtures, default: false
.pre_loaded_fixtures? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 875
class_attribute :pre_loaded_fixtures, default: false
.test_order (rw)
Returns the order in which test cases are run.
ActiveSupport::TestCase.test_order # => :random
Possible values are :random
, :parallel
, :alpha
, :sorted
. Defaults to :random
.
# File 'activesupport/lib/active_support/test_case.rb', line 39
def test_order ActiveSupport.test_order ||= :random end
.test_order=(new_order) (rw)
Sets the order in which test cases are run.
ActiveSupport::TestCase.test_order = :random # => :random
Valid values are:
-
:random
(to run tests in random order) -
:parallel
(to run tests in parallel) -
:sorted
(to run tests alphabetically by method name) -
:alpha
(equivalent to:sorted
)
# File 'activesupport/lib/active_support/test_case.rb', line 29
def test_order=(new_order) ActiveSupport.test_order = new_order end
.use_instantiated_fixtures (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 874
class_attribute :use_instantiated_fixtures, default: false # true, false, or :no_instances
.use_instantiated_fixtures? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 874
class_attribute :use_instantiated_fixtures, default: false # true, false, or :no_instances
.use_transactional_tests (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 873
class_attribute :use_transactional_tests, default: true
.use_transactional_tests? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 873
class_attribute :use_transactional_tests, default: true
Instance Attribute Details
#config (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 876
class_attribute :config, default: ActiveRecord::Base
#config? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 876
class_attribute :config, default: ActiveRecord::Base
#file_fixture_path (readonly)
[ GitHub ]# File 'activesupport/lib/active_support/testing/file_fixtures.rb', line 18
class_attribute :file_fixture_path, instance_writer: false
#file_fixture_path? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activesupport/lib/active_support/testing/file_fixtures.rb', line 18
class_attribute :file_fixture_path, instance_writer: false
#fixture_class_names (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 872
class_attribute :fixture_class_names, default: {}
#fixture_class_names? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 872
class_attribute :fixture_class_names, default: {}
#fixture_path (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 870
class_attribute :fixture_path, instance_writer: false
#fixture_path? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 870
class_attribute :fixture_path, instance_writer: false
#fixture_table_names (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 871
class_attribute :fixture_table_names, default: []
#fixture_table_names? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 871
class_attribute :fixture_table_names, default: []
#pre_loaded_fixtures (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 875
class_attribute :pre_loaded_fixtures, default: false
#pre_loaded_fixtures? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 875
class_attribute :pre_loaded_fixtures, default: false
#use_instantiated_fixtures (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 874
class_attribute :use_instantiated_fixtures, default: false # true, false, or :no_instances
#use_instantiated_fixtures? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 874
class_attribute :use_instantiated_fixtures, default: false # true, false, or :no_instances
#use_transactional_tests (rw)
[ GitHub ]# File 'activerecord/lib/active_record/fixtures.rb', line 873
class_attribute :use_transactional_tests, default: true
#use_transactional_tests? ⇒ Boolean
(rw)
[ GitHub ]
# File 'activerecord/lib/active_record/fixtures.rb', line 873
class_attribute :use_transactional_tests, default: true
Instance Method Details
#assert_no_match
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 63
alias :assert_no_match :refute_match
#assert_not_empty
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 56
alias :assert_not_empty :refute_empty
#assert_not_equal
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 57
alias :assert_not_equal :refute_equal
#assert_not_in_delta
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 58
alias :assert_not_in_delta :refute_in_delta
#assert_not_in_epsilon
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 59
alias :assert_not_in_epsilon :refute_in_epsilon
#assert_not_includes
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 60
alias :assert_not_includes :refute_includes
#assert_not_instance_of
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 61
alias :assert_not_instance_of :refute_instance_of
#assert_not_kind_of
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 62
alias :assert_not_kind_of :refute_kind_of
#assert_not_nil
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 64
alias :assert_not_nil :refute_nil
#assert_not_operator
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 65
alias :assert_not_operator :refute_operator
#assert_not_predicate
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 66
alias :assert_not_predicate :refute_predicate
#assert_not_respond_to
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 67
alias :assert_not_respond_to :refute_respond_to
#assert_not_same
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 68
alias :assert_not_same :refute_same
#assert_raise
test/unit backwards compatibility methods
# File 'activesupport/lib/active_support/test_case.rb', line 55
alias :assert_raise :assert_raises
#method_name
[ GitHub ]# File 'activesupport/lib/active_support/test_case.rb', line 44
alias_method :method_name, :name


Motor is the next generation of Rules Engine. Motor is your functions service provider. Manage your standalone functions online. Manage workflows for package them. Share your functions with other users. Integration with external services. Transparency step by step. Thousands of libraries ready to use.
Write complex funtions to solve mathematical problems.
Import data to be analized, generate result tables with ranges and prepare them to be in a graph.
Solve comon problems with predefined functions for gravity, velocity, acceleration and dynamics.
Calculate the revenue and monthly payments to your employees.
Analize what your devices are telling you with data. Be proactive and receive alerts.
This is an alpha version. Each one of their components can be replaced or modified without. Software is provide as is with any guarantee.
In case you found a bug or issue please reported the using the github issue tracking here


Date: {{rating.ratingDate}} - User: {{rating.user_name}} - Rating: {{rating.rating}} Comment: {{rating.review}}


Thermostat and LED control (Web Bluetooth demo)
Temperature is
N/A
° Celsius
(not updated yet)
[[item.value]]
Clear
[[buttonTitle]]


In the Search pane, find your contact's phone number and click Call. This app will be brought to the foreground. The phone number to call will be displayed in the output field.


Description: Check to see if a DOM node is within an XML document (or is an XML document).
node: Element The DOM node that will be checked to see if it's in an XML document.
jQuery.isXMLDoc(document) // false
jQuery.isXMLDoc(document.body) // false


Across: 1,23dn. Key senator set to revolt (7 5) 5. Die biased - no ones for the corrupt! (7) 9. Proposition from problem male (5) 10. Man in Co-op strangely familiar (9) 11. Basic old outdoor training, cowering at mean parade leaders? (8) 12. Notice escape of arrival (6) 14. First lit gas chamber (4) 15. Sons' lights-smashers? (10) 18. Mess up cameo clip? Town leader outraged! (10) 19. Dust settles on poker game (4) 22. In religious group, fly perhaps? (6) 24. Aria rang out about the land (8) 26. Likely to see savings dip - or vent rage (9) 27. "Let It Be" reworked as "Let It Go" perhaps? (5) 28. Scraped the bottom for pennies - full of such 5ac. greed! (7) 29. Wipe toes dry carefully (7) Down: 1. Change his brand? All beer is brewed! (7) 2. Talk-fest in US is Pommy scheme (9) 3. Dream of changing head of Euro nation (6) 4. 10ac. cameo clip? City leader outraged! (10) 5. 27ac. produced poorly (4) 6. Changed his brand to be menacingly present (8) 7. Chamber of delicious sounds (5) 8. Perhaps reduces the score for signals (7) 13. Started at it, signed out (10) 16. Not fashionable, but more likely to survive, he'll keep you covered (9) 17. Bold leader fixing what the Senate is capable of (8) 18. Senator Don had even Democrat leaders slightly damaged (7) 20. As the cities are populated, severe needs meet superficial luxury (7) 21. Stations allow baggage - about time! (6) 23. see 1ac. 25. Look out for time to finish (4)


--- layout: default title: Puppr Airdrop to Goose Holders path: goose-airdrop ---
Welcome Goose Holders.
You heard the call! We will be dropping PUPPR to many of you Gooses. Follow us on Twitter and supply your BSC address below.
If hold 50 or more $egg in your wallet you will recieve the Airdrop.
250 PUPPR each.
Add PUPPR to your BSC wallet: 0x845b705996f4235e7e0b792d57d4bc452ba6f748


--- layout: post title: Happiness date: 2013-11-24 19:00:58.000000000 -08:00 type: post parent_id: '0' published: true password: '' status: publish categories: [] tags: [] meta: _publicize_pending: '1' _edit_last: '1965023' author: login: paradoxofmatrix email<EMAIL_ADDRESS>display_name: paradoxofmatrix first_name: '' last_name: '' ---
Happiness eludes us all. At times we feel its unduly overrated, while at other times we agree that its carelessly ignored. Either way we seldom lose a craving for it. We often force ourselves into believing that happiness can be attained or derived. But to our surprise it remains ever so fleeting. No relationship, no success, no prize seems abundant enough to ensure a perennial supply of happiness. Invariably it fades, inevitably it reappears. For a time it might seem that there exists a direct correlation with affluence, but very soon along the curve the relationship gets fuzzy and sometimes even inverse. Uneasy lies the head that wears the crown! nor is it the case, that getting rid of it, makes the former bearer particularly happy.
No matter how unpoetic it sounds but happiness is more like an adoption. A choice with not necessarily a real or compelling cause but a significant and worthwhile intent and purpose. Simplicity of this view of happiness suddenly puts it within reach and immediately attainable. At any moment in time, at any point in space there are enough reasons to be happy. Power of belief has never had a better use or more direct application.
Feeling good need not always be an effect. In its own right it can just as easily be a benign but effective cause. An initiator of sorts. To demystify happiness is important towards its attainment, to treat it distant in time and/or space doesn't help. Simply circumventing our own relentless pursuit of unhappiness (for whatever reason) wouldn't of course make us ecstatic (and thankfully so) but would suffice for reasonable perpetual happiness. It's here, it's now!


--- date: "2005-12-07T00:00:00Z" meta: _edit_last: "2" published: true status: publish categories: - Programming tags: - .NET title: A First Impression of MSBuild type: post ---
Lately I've been playing with MSBuild, the new build tool that ships with Visual Studio 2005. Before, I've always used Nant for my automated builds. I've been using nant since 2002 or so, and found it to be a pretty useful, stable tool to take the drudgery out of deploying builds. Figured I would give MSBuild a try, just for comparison sake.
I must say, MSBuild isn't bad. One thing that I've found interesting about is that it has been ridiculously easy to port tasks from nant and nantcontrib to MSBuild. So far I've written tasks to apply a label to VSS, and to help me create a zip file holding the deployables of the build.


Neighborhoods Renton West Seattle Capitol Hill We are easy to contact. We are listed in the phone book!


Float left on all viewport sizes
Float right on all viewport sizes
clickme
Don't float on all viewport sizes


HOME
ABOUT
PRODUCTS
▼
▲
Flip flops
Umbrellas
Caps
Shoes
Other
VISION
▼
▲
Foundation
Projects
Future
CONTACT US
HOME
ABOUT
PRODUCTS
▼
▲
Flip flops
Umbrellas
Caps
Shoes
Other
VISION
▼
▲
Foundation
Projects
Future
CONTACT US


Unsubscribe SOCS Email List
If you would rather subscribe by hand just send an email to<EMAIL_ADDRESS>with nothing in the subject and "unsubscribe iusocs_members" in the body.
This page was lasted edited on February 10, 2000.
Please address questions and comments to: iusocs@indiana.edu.


--- title: autotimeseries keywords: fastai sidebar: home_sidebar summary: "Nixtla SDK. Time Series Forecasting pipeline at scale." description: "Nixtla SDK. Time Series Forecasting pipeline at scale." nb_path: "nbs/index.ipynb" ---
autotimeseries is a python SDK to consume the APIs developed in https://github.com/Nixtla/nixtla.
import os
from autotimeseries.core import AutoTS
autotimeseries = AutoTS(bucket_name=os.environ['BUCKET_NAME'],
api_id=os.environ['API_ID'],
api_key=os.environ['API_KEY'],
aws_access_key_id=os.environ['AWS_ACCESS_KEY_ID'],
aws_secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY'])
train_dir = '../data/m5/parquet/train'
# File with target variables
filename_target = autotimeseries.upload_to_s3(f'{train_dir}/target.parquet')
# File with static variables
filename_static = autotimeseries.upload_to_s3(f'{train_dir}/static.parquet')
# File with temporal variables
filename_temporal = autotimeseries.upload_to_s3(f'{train_dir}/temporal.parquet')
Each time series of the uploaded datasets is defined by the column item_id
. Meanwhile the time column is defined by timestamp
and the target column by demand
. We need to pass this arguments to each call.
columns = dict(unique_id_column='item_id',
ds_column='timestamp',
y_column='demand')


Almost all MEME Suite programs make use of alphabets to understand the meaning of sequences or motifs. The MEME Suite programs support three standard alphabets: the DNA, RNA and protein alphabets. The MEME Suite also allows you to define a custom alphabet to allow you to explore motifs containing, for example modified nucleotides (e.g., methylcytosines) or modified amino acids (e.g., phosphorylated serines and tyrosines).
This document describes how you can specify an alphabet of your own design for use with the MEME Suite programs that support custom alphabets. When you specify a custom alphabet, you can define the symbols that represent each nucleotide or amino acid, their names, their colors and their complements (in the case of alphabets like DNA that have complementary residues). You also can also define "ambiguous" symbols that represent more than one symbol in your custom alphabet (e.g., "R" to represent purines in a DNA-based alphabet.) You then provide your custom alphabet definition as a text file to the MEME Suite programs to inform them that sequences you provide use this non-standard alphabet.
You can look at some examples of alphabet definitions to get a quick idea of how they look. The first two examples define the standard DNA and protein alphabets supported by the MEME Suite. Note that everything after the "#" character anywhere on the line is treated as a comment (ignored) by the MEME Suite.
The alphabet definition contains the following sections:
The header line signals that the file is an alphabet definition, gives the name of the alphabet and specifies if it is like a standard alphabet.
The "name" is optional and gives the name that is used to refer to the alphabet in outputs. It follows all the rules of quoted text. If the name is not given, then the alphabet will be referred to by the list of its core symbols.
The standard-LIKE is also optional and can be used to specify a reference alphabet that this alphabet might be sensibly compared to under most circumstances. Adding this optional flag will require that the alphabet you are defining has the uppercase form of all the reference alphabet's core symbols as well as their complements. The possible values for standard include DNA, RNA and PROTEIN.
For example if you were creating an alphabet that extended the DNA alphabet you might use a header like:
This would require that the alphabet you were defining contained A, C, G and T and that A was the complement of T and C was the complement of G.
The core symbols of an alphabet can either be defined on their own or two per line with a '~' between them to show them as complements.
For example you can define the symbol 'A' and the symbol 'T' to be complements of each other as follows:
However if 'A' and 'T' do not have complements then you would define them on separate lines:
Listing a letter like 'A' or 'T' is the simplest way to define a symbol but you can also specify a name and color for each symbol.
The ambiguous symbols of an alphabet are listed after all the core symbols have been defined. An ambiguous symbol will have the symbol definition on the left, followed by an equals '=' and a list of core symbols on the right.
For example you can defined the symbol 'N' to represent 'A', 'C', 'G' or 'T' as follows:
If there is a single core symbol on the right of an ambiguous symbol definition, the symbol is considered to be an alias for the core symbol on the left.
For example you can defined the symbol 'U' to be an alias for 'T' as follows:
As with the core symbols you can also specify a name and color for each ambiguous and alias symbol.
How ambiguous symbols and aliases are handled differs for each of the programs in the MEME Suite. See the specific documentation for each program for how they treat ambiguous symbols.
Each symbol is a single letter, number or one of the characters '.', '-', '*' or '?'. Letters may be either upper- or lowercase (see Letter Case below on the interpretation of case by MEME Suite programs). The '?' is a special wildcard character, and if you use it you must define it to match all core symbols (see Wildcard Symbol, below).
If all the letters you define as symbols are in a single case, (al upper case or all lower case), the programs in the MEME Suite will ignore case when reading sequences. However, if you include both upper- and lowercase letters in your alphabet definition, then upper- and lowercase letters will be treated as distinct symbols.
MEME Suite programs internally order core symbols so that the uppercase letters A-Z come first, followed by the lowercase letters a-z, then by the numbers 0-9 and finally by the symbols '*', '-' and '.' in that order. (Note that '?' is not included in this list because it is never allowed to be a core symbol.) This ordering is used to determine the order of the columns in motifs output by MEME Suite motif discovery programs. Note: The order in which you specify symbols within the core symbol section of your alphabet file does not matter.
A wildcard is an ambiguous symbol that matches any core symbol. To define a wildcard symbol, list all the core symbols after the equals sign. Since many programs in the MEME Suite require that alphabets have a wildcard symbol in order for them to work correctly, if you do not define one the MEME Suite program will automatically define the symbol '?' to be the wildcard. It is strongly recommended that all custom alphabets you define include a wildcard symbol.
If you wish, you may manually define the wildcard as '?'.
Each symbol definition can have up to three fields as follows:
The symbol "character" is a single character chosen from the list of allowed symbol characters. The symbol character is required and is always the first field.
The symbol "name" is optional but it will make any outputs generated using this alphabet easier to understand by providing a reference on the meaning of the symbols used. If present, the symbol name must be the second field.
The "name" follows the rules of quoted text.
The symbol color is optional and represented by a 6 digit hexadecimal number with digits 1 & 2 defining the red component, digits 3 & 4 defining the green component and digits 5 & 6 defining the blue component.
Here are some example colors: CC0000, 008000, 0000CC, FFB300, FF00FF, FFCCCC, FFFF00 and 33E6CC.
Find the numerical codes for colors by clicking here: = 000000.
If you do not specify the color of one or more symbols, the MEME Suite will choose evenly spaced colors for them using its own algorithm.
Quoted text is used to describe things like the name of a symbol or the name of the alphabet and will be displayed in outputs. They make the alphabet definition self documenting, and while they aren't, required they are highly recommended.
There are a few restrictions on quoted text:


WITNESS LIST Ways & Means Committee June 30, 2000-9:00A Review of Tax Exemptions & Credit On: LaBas, James (Office of the Comptroller of Public Accounts) Tax Structure Changes On: Goodisman, Adrian (Ziff Energy Group) Hubert, Martin A. (Texas Department of Agricultre) Murray, Susan (EOG Resources) O'brien, Obie (Apache Corp.) Plank, Roger (Apache Corp. and TIPRO) Sebree, Ben (Texas Oil and Gas Association) Segner, Ed (EOG Resources) Stevens, Bill (West Centeral Texas Oil and Gas Assoc.)


Note: Users do not normally need to directly use these classes. It is better to use the higher level interface exposed by {@link com.sptci.prevayler.PrevalentManager}.
Transactions defined for the prevalent system. Attempts to provide the most common transactions likely to be required of a database engine. All provided transactions are sub-classes of the general purpose {@link com.sptci.prevayler.annotation.Transaction} class that may be used to execute any transactional method defined in {@link com.sptci.prevayler.PrevalentSystem} or is sub-classes.
The following shows sample use of a transaction:
import com.sptci.prevayler.PrevalentObject; import com.sptci.prevayler.PrevalentSystemFactory; import com.sptci.prevayler.transaction.Save; final Prevayler prevayler = PrevalentSystemFactory.getPrevayler(); ... ... public class MyObject extends PrevalentObject { ... } final MyObject obj = new MyObject(); obj.setXXX(...)... final MyObject newobj = prevayler.execut( new Save<MyObject>( obj ) );
Please note that even though the transactions in this package are genericised, you have to cast the returned values to the appropriate types. This is mandated due to the fact that Prevayler is not genericised.


Willie Mullins hopeful over Kemboy clearance following Supreme Racing controversy
by Press AssociationWillie Mullins believes he will finally be able to make entries for Punchestown Gold Cup winner Kemboy this week.
The Closutton trainer revealed negotiations over settling the issues that have prevented him from making plans for the Magners Cheltenham Gold Cup hopeful will be resolved "in the next day or so".
Kemboy and several other horses owned by the Supreme Horse Racing Club have effectively been barred from running since last month by a suspension initially placed on the ownership syndicate by Horse Racing Ireland.
That escalated earlier this month when HRI announced all registrations of horses under the ownership of Supreme Horse Racing Club were voided following a persistent failure to provide requested information.
The syndicate is no longer allowed to own or part-own horses registered under rules in Ireland.
"I know there's a lot of behind the scenes work going on," said Mullins.
"From what I can gather, that could all be sorted in the next day or so. It is very close to being resolved."
The suspension of horses under the Supreme banner meant Kemboy could not make his intended seasonal debut in the Ladbrokes Champion Chase at Down Royal on November 2.
However, Mullins is optimistic the matter will be sorted in time for him to give Kemboy an entry in the Savills Chase at Leopardstown on December 28.
Entries for the Grade One over three miles close on Wednesday.
"We are all trying to make that deadline and at the moment I would say that looks good," he said.


Internal server error. As this is a demo application, you should check for a stack trace in the console log.


header_rows
parameter no allows you to prevent column headers from moving to the RTF document header by setting header_rows
to 0.ht[1:5]
. The new syntax is ht[1:5, ]
.add_columns
argument now changed from a default of TRUE
instead of FALSE
.If you’ve worked in the pharmaceutical industry as a SAS© programmer doing data analysis for clinical trials, there’s a fair chance that you’ve spent a good amount of time creating RTF outputs. While there are more modern document file formats supported by SAS© and other data analysis languages, RTF remains prolific. Though antiquated, RTF files still remain useful. They support the rich-text format necessary to create documents containing different fonts, colors, and text attributes. Furthermore, RTF documents make it easy for medical writers to insert outputs into different reports and publications as needed. Regardless, outputting data displays to RTF documents is a process embedded in many companies still to this day.
There are many different table packages available in R. For example, stargazer allows you to easily summarize data and create statistical tables in different output formats, such as LaTeX, HTML, ASCII. kableExtra lets you build common complex tables and manipulate table styles in HTML outputs. RStudio has been developing gt which aims to make table creation simple by breaking it into a cohesive set of parts. While there are many more options, few of these support RTF output.
Note: gt plans to support RTF in the future, but this functionality is not yet mature.
One library, huxtable, does support RTF extensively - with a wide array of styling and formatting options. But there are a few important components missing:
It’s understandable that these gaps exist. R has strong usage in academia, and often these tables are created to be printed in text within a paper, for instance rendered using RMarkdown. The tables we create for a clinical trial are typically positioned within their own section of a CSR independently.
pharmaRTF was developed to plug this gap without reinventing the wheel. Huxtable offers a powerful table package that can do virtually any styling necessary for the tables we need to create. pharmaRTF consumes a huxtable table and fills in the missing pieces by offering:
Note: we also plan to support GT tables when the RTF support matures
Some of the syntax we use throughout this document uses the %>%
pipe operator. This is to display support for a tidyverse style of coding. You can find the %>%
operator in the magittr package.
Before you start worrying about creating an RTF document, you first need to create and style your table. For that, use huxtable:
dat <- iris %>% select(Species, everything()) ht <- huxtable::as_hux(dat, add_colnames=TRUE) %>% huxtable::set_bold(1, 1:ncol(dat), TRUE) %>% huxtable::set_bottom_border(1, 1:ncol(dat), 1) %>% huxtable::set_width(1.5) ht[1:10,]
| Species | Sepal.Length | Sepal.Width | Petal.Length | Petal.Width |
|---|---|---|---|---|
| setosa | 5.1 | 3.5 | 1.4 | 0.2 |
| setosa | 4.9 | 3 | 1.4 | 0.2 |
| setosa | 4.7 | 3.2 | 1.3 | 0.2 |
| setosa | 4.6 | 3.1 | 1.5 | 0.2 |
| setosa | 5 | 3.6 | 1.4 | 0.2 |
| setosa | 5.4 | 3.9 | 1.7 | 0.4 |
| setosa | 4.6 | 3.4 | 1.4 | 0.3 |
| setosa | 5 | 3.4 | 1.5 | 0.2 |
| setosa | 4.4 | 2.9 | 1.4 | 0.2 |
Now you can create your RTF document. pharmaRTF consists of two different objects:
rtf_doc
: the encapsulating objecthf_line
: the object used to create titles and footnotesrtf_doc
contains document wide attributes, including:
hf_line
is used to create titles and footnotes, and contains attributes for each line, including:
There are multiple methods for piecing together an rtf_doc
object. Within this vignette, we will cover the basics. Let’s assume that you want to keep the default document attributes, and you’d like to create a single, bold title of “The Iris Dataset”. You could use the following:
doc <- rtf_doc(ht, titles=list(hf_line("The Iris Dataset", bold=TRUE))) write_rtf(doc, file="table1.rtf")
The resulting file looks like:
The document opens and presents properly as an RTF document within Microsoft Word. Furthermore, the document paging works properly, with titles and column headers repeating pages to page. Note that the column headers repeat from page to page - this is because pharmaRTF pulls the column headers out of the huxtable table and into the document header
(Note: You can prevent this by setting the header_rows = 0
in rtf_doc
or by using the property function set_header_rows
).
In the above example, note that we didn’t edit any document settings. By default, pharmaRTF will output RTF files with:
All of these attributes can be changed using property functions. For example:
doc <- rtf_doc(ht, titles=list(hf_line("The Iris Dataset", bold=TRUE))) %>% set_pagesize(c(height=5, width=5)) %>% set_font('Times New Roman') %>% set_margins(c(top=2, bottom=2, left=2, right=2)) %>% set_font_size(7) write_rtf(doc, file="table2.rtf")
While this display is impractical, it’s possible! And customization to all these attributes may be necessary depending on individual circumstances.
pharmaRTF also offers different interface options depending on your preference. For example, if you don’t like piping using %>%
, other versions of property functions are available. Additionally, titles and footnotes can be attached using the add_titles()
and add_footnotes()
functions.
doc <- rtf_doc(ht) font(doc) <- 'Times New Roman' font_size(doc) <- 10 doc <- add_titles(doc, hf_line("The Iris Dataset", bold=TRUE)) doc <- add_footnotes(doc, hf_line("Note: This is a footnote!", italic=TRUE, align='left')) write_rtf(doc, file="table3.rtf")
This completes a basic introduction to using pharmaRTF, but there’s still more to learn!
vignette("huxtable_tips")
vignette("advanced_usage")
vignette("tf_from_file")


Vatican returns relic from Jesus' manger to Holy Land
by Associated PressJERUSALEM -- Christians are celebrating the return to the Holy Land of a tiny wooden relic they believe was part of Jesus' manger nearly 1,400 years after it was sent to Rome as a gift to the pope.
The thumb-sized relic was unveiled to worshippers Friday at the Notre Dame church in Jerusalem for a day of celebrations and prayer.
On Saturday, it will be sent to its permanent home at the Franciscan Church of St. Catherine, next to the Church of the Nativity in Bethlehem, the West Bank holy site where tradition says Jesus was born. Its arrival will coincide with Advent, a four-week period leading up to Christmas.
The Vatican says Pope Francis returned the relic to the custodian of Catholic religious sites in the Holy Land as a gift.


public class MidtransCoreApiImpl extends java.lang.Object implements MidtransCoreApi
MidtransCoreApi
| Constructor and Description |
|---|
MidtransCoreApiImpl(Config config)
CoreAPI constructor
|
| Modifier and Type | Method and Description |
|---|---|
Config |
apiConfig()
Do re-set config Class like clientKey, serverKey, isProduction
|
org.json.JSONObject |
approveTransaction(java.lang.String param)
Do `/{orderId}/approve` API request to Core API
|
org.json.JSONObject |
cancelTransaction(java.lang.String param)
Do `/{orderId}/cancel` API request to Core API
|
org.json.JSONObject |
captureTransaction(java.util.Map<java.lang.String,java.lang.String> params)
Do `/capture API` request to Core API
|
org.json.JSONObject |
cardPointInquiry(java.lang.String tokenId)
Do `/point_inquiry/{tokenId}` API request to Core API
|
org.json.JSONObject |
cardToken(java.util.Map<java.lang.String,java.lang.String> params)
Do `/token` API request to Core API
|
org.json.JSONObject |
chargeTransaction(java.util.Map<java.lang.String,java.lang.Object> body)
Do /charge API request to Core API
|
org.json.JSONObject |
checkTransaction(java.lang.String param)
Do /{orderId}/status API request to Core API
|
org.json.JSONObject |
createSubscription(java.util.Map<java.lang.String,java.lang.Object> subscriptionReq)
Do `v1/subscriptions` API request to Core API for Create subscription.
|
org.json.JSONObject |
denyTransaction(java.lang.String param)
Do `/{orderId}/deny` API request to Core API
|
org.json.JSONObject |
directRefundTransaction(java.lang.String param,
java.util.Map<java.lang.String,java.lang.String> requestBody)
Do `/{orderId}/status/b2b` API request to Core API
|
org.json.JSONObject |
disableSubscription(java.lang.String subscriptionId)
Do `v1/subscriptions/{subscription_id}/disable` Make the subscription inactive (the subscription will not create transaction anymore)s.
|
org.json.JSONObject |
enableSubscription(java.lang.String subscriptionId)
Do `v1/subscriptions/{subscription_id}/enable` Make the subscription active (the subscription will create periodic transaction) (more detail refer to: http://api-docs.midtrans.com/#enable-subscription)
|
org.json.JSONObject |
expireTransaction(java.lang.String param)
Do `/{orderId}/expire` API request to Core API
|
org.json.JSONObject |
getBIN(java.lang.String binNumber)
Do `v1/bins/{bin}` API request to Core API
|
org.json.JSONObject |
getPaymentAccount(java.lang.String accountId)
Do `v2/pay/account/{account_id}` find account by id to see the customer account details (more detail refer to: http://api-docs.midtrans.com/#get-pay-account)
|
org.json.JSONObject |
getSubscription(java.lang.String subscriptionId)
Do `v1/subscriptions/{subscription_id}` Find subscription by id to see the subscription details.
|
org.json.JSONObject |
getTransactionStatusB2B(java.lang.String param)
Do `/point_inquiry/{tokenId}` API request to Core API
|
org.json.JSONObject |
linkPaymentAccount(java.util.Map<java.lang.String,java.lang.Object> accountRequest)
Do `/v2/pay/account` to link customer account to be used for specific payment channels (more detail refer to: http://api-docs.midtrans.com/#create-pay-account)
|
org.json.JSONObject |
refundTransaction(java.lang.String param,
java.util.Map<java.lang.String,java.lang.String> body)
Do `/{orderId}/refund` API request to Core API
|
org.json.JSONObject |
registerCard(java.util.Map<java.lang.String,java.lang.String> params)
Do `/card/register` API request to Core API
|
org.json.JSONObject |
unlinkPaymentAccount(java.lang.String accountId)
Do `v2/pay/account/{account_id}/unbind` to unbind a linked customer account (more detail refer to: http://api-docs.midtrans.com/#unbind-pay-account)
|
org.json.JSONObject |
updateSubscription(java.lang.String subscriptionId,
java.util.Map<java.lang.String,java.lang.Object> subscriptionReq)
Do `v1/subscriptions/{subscription_id}` Update existing subscription details.
|
public MidtransCoreApiImpl(Config config)
config
- Midtrans configuration
public Config apiConfig()
MidtransCoreApi
apiConfig
in interface MidtransCoreApi
public org.json.JSONObject chargeTransaction(java.util.Map<java.lang.String,java.lang.Object> body) throws MidtransError
MidtransCoreApi
chargeTransaction
in interface MidtransCoreApi
body
- Map Object parameter, object of Core API JSON body as parameter, will be converted to JSON (more params detail refer to: https://api-docs.midtrans.com)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject checkTransaction(java.lang.String param) throws MidtransError
MidtransCoreApi
checkTransaction
in interface MidtransCoreApi
param
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#get-transaction-status)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject approveTransaction(java.lang.String param) throws MidtransError
MidtransCoreApi
approveTransaction
in interface MidtransCoreApi
param
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#approve-transaction)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject cancelTransaction(java.lang.String param) throws MidtransError
MidtransCoreApi
cancelTransaction
in interface MidtransCoreApi
param
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#cancel-transaction)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject expireTransaction(java.lang.String param) throws MidtransError
MidtransCoreApi
expireTransaction
in interface MidtransCoreApi
param
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#expire-transaction)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject refundTransaction(java.lang.String param, java.util.Map<java.lang.String,java.lang.String> body) throws MidtransError
MidtransCoreApi
refundTransaction
in interface MidtransCoreApi
param
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#refund-transaction)body
- {Map Object} object of Core API JSON body as parameter, will be converted to JSONMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject cardToken(java.util.Map<java.lang.String,java.lang.String> params) throws MidtransError
MidtransCoreApi
cardToken
in interface MidtransCoreApi
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more params detail refer to: https://api-docs.midtrans.com/#get-token)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject registerCard(java.util.Map<java.lang.String,java.lang.String> params) throws MidtransError
MidtransCoreApi
registerCard
in interface MidtransCoreApi
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more params detail refer to: https://api-docs.midtrans.com/#register-card)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject cardPointInquiry(java.lang.String tokenId) throws MidtransError
MidtransCoreApi
cardPointInquiry
in interface MidtransCoreApi
tokenId
- {String} of credit card (more detail refer to: https://api-docs.midtrans.com/#point-inquiry)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject captureTransaction(java.util.Map<java.lang.String,java.lang.String> params) throws MidtransError
MidtransCoreApi
captureTransaction
in interface MidtransCoreApi
params
- {Map Object} object of Core API JSON body as parameter, will be converted to JSON (more params detail refer to: https://api-docs.midtrans.com/#capture-transaction)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject getTransactionStatusB2B(java.lang.String param) throws MidtransError
MidtransCoreApi
getTransactionStatusB2B
in interface MidtransCoreApi
param
- {String} of credit card (more detail refer to: https://api-docs.midtrans.com/#get-transaction-status-b2b)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject directRefundTransaction(java.lang.String param, java.util.Map<java.lang.String,java.lang.String> requestBody) throws MidtransError
MidtransCoreApi
directRefundTransaction
in interface MidtransCoreApi
param
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#direct-refund-transaction)requestBody
- {Map Object} object of Core API JSON body as parameter, will be converted to JSONMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject denyTransaction(java.lang.String param) throws MidtransError
MidtransCoreApi
denyTransaction
in interface MidtransCoreApi
param
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#deny-transaction)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject getBIN(java.lang.String binNumber) throws MidtransError
MidtransCoreApi
getBIN
in interface MidtransCoreApi
binNumber
- {String} of the transaction (more detail refer to: https://api-docs.midtrans.com/#bin-api)MidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject createSubscription(java.util.Map<java.lang.String,java.lang.Object> subscriptionReq) throws MidtransError
MidtransCoreApi
createSubscription
in interface MidtransCoreApi
subscriptionReq
- {Map Object} object of Subscription request bodyMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject getSubscription(java.lang.String subscriptionId) throws MidtransError
MidtransCoreApi
getSubscription
in interface MidtransCoreApi
subscriptionId
- {String} Subscription ID given by MidtransMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject disableSubscription(java.lang.String subscriptionId) throws MidtransError
MidtransCoreApi
disableSubscription
in interface MidtransCoreApi
subscriptionId
- {String} Subscription ID given by MidtransMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject enableSubscription(java.lang.String subscriptionId) throws MidtransError
MidtransCoreApi
enableSubscription
in interface MidtransCoreApi
subscriptionId
- {String} Subscription ID given by MidtransMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject updateSubscription(java.lang.String subscriptionId, java.util.Map<java.lang.String,java.lang.Object> subscriptionReq) throws MidtransError
MidtransCoreApi
updateSubscription
in interface MidtransCoreApi
subscriptionId
- {String} Subscription ID given by MidtranssubscriptionReq
- {Map Object} object of Subscription request bodyMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject linkPaymentAccount(java.util.Map<java.lang.String,java.lang.Object> accountRequest) throws MidtransError
MidtransCoreApi
linkPaymentAccount
in interface MidtransCoreApi
accountRequest
- {Map Object} object of create payment account request bodyMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject getPaymentAccount(java.lang.String accountId) throws MidtransError
MidtransCoreApi
getPaymentAccount
in interface MidtransCoreApi
accountId
- {String} Customer account id to be used for paymentMidtransError
- when an exception was occurred during executing the request.public org.json.JSONObject unlinkPaymentAccount(java.lang.String accountId) throws MidtransError
MidtransCoreApi
unlinkPaymentAccount
in interface MidtransCoreApi
accountId
- {String} Customer account id to be used for paymentMidtransError
- when an exception was occurred during executing the request.