Package i5.las2peer.testing
Class MockAgentFactory
java.lang.Object
i5.las2peer.testing.MockAgentFactory
Simple Factory class to load Agents from the nested XML files.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic UserAgentImpl
getAbel()
Gets Abels agentstatic UserAgentImpl
getAdam()
Gets Adams agentstatic String
getContent
(String resourceName) get the contents of a text resource in the classpathstatic ServiceAgentImpl
static UserAgentImpl
getEve()
Gets Eves agentstatic GroupAgentImpl
get a group agent for group1 (containing Adam, eve and Abel)static GroupAgentImpl
get a group agent for group2 (containing Adam, eve and Abel)static GroupAgentImpl
get a group agent for group3 (containing Adam, eve and Abel)static GroupAgentImpl
get a group agent for groupA (containing only Adam and Abel)static ServiceAgentImpl
get ServiceAgent for i5.las2peer.api.TestService The TestServices are placed in the JUnit source tree.static ServiceAgentImpl
get ServiceAgent for i5.las2peer.api.TestService2 The TestServices are placed in the JUnit source tree.static void
create an agent and print its XML representation to standard out the first command line argument will be used as passphrase
-
Constructor Details
-
MockAgentFactory
public MockAgentFactory()
-
-
Method Details
-
getContent
get the contents of a text resource in the classpath- Parameters:
resourceName
-- Returns:
- contents of a resource as String
- Throws:
IOException
-
getEve
Gets Eves agent- Returns:
- Returns the user agent of Eve
- Throws:
MalformedXMLException
IOException
-
getAdam
Gets Adams agent- Returns:
- Returns the user agent of Adam
- Throws:
MalformedXMLException
IOException
-
getAbel
Gets Abels agent- Returns:
- Returns the user agent of Abel
- Throws:
MalformedXMLException
IOException
-
getTestService
get ServiceAgent for i5.las2peer.api.TestService The TestServices are placed in the JUnit source tree.- Returns:
- the ServiceAgent of the TestService
- Throws:
IOException
MalformedXMLException
-
getCorrectTestService
- Throws:
MalformedXMLException
IOException
-
getGroup1
get a group agent for group1 (containing Adam, eve and Abel)- Returns:
- a group
- Throws:
MalformedXMLException
IOException
-
getGroup2
get a group agent for group2 (containing Adam, eve and Abel)- Returns:
- a group
- Throws:
MalformedXMLException
IOException
-
getGroup3
get a group agent for group3 (containing Adam, eve and Abel)- Returns:
- a group
- Throws:
MalformedXMLException
IOException
-
getGroupA
get a group agent for groupA (containing only Adam and Abel)- Returns:
- a group
- Throws:
MalformedXMLException
IOException
-
getTestService2
get ServiceAgent for i5.las2peer.api.TestService2 The TestServices are placed in the JUnit source tree.- Returns:
- the ServiceAgent for TestService2
- Throws:
IOException
MalformedXMLException
-
main
public static void main(String[] argv) throws NoSuchAlgorithmException, AgentOperationFailedException, CryptoException, IOException create an agent and print its XML representation to standard out the first command line argument will be used as passphrase- Parameters:
argv
-- Throws:
NoSuchAlgorithmException
AgentOperationFailedException
CryptoException
IOException
-