use of com.dexels.navajo.document.Method in project navajo by Dexels.
the class TestNavajo method testAddMethod.
@Test
public void testAddMethod() {
Method m = NavajoFactory.getInstance().createMethod(testDoc, "mymethod", "Postman");
testDoc.addMethod(m);
Method result = testDoc.getMethod("mymethod");
Assert.assertNotNull(result);
Assert.assertEquals("mymethod", result.getName());
Assert.assertEquals("Postman", result.getServer());
}
use of com.dexels.navajo.document.Method in project navajo by Dexels.
the class TestOperation method testOperation.
@Test
public void testOperation() {
NavajoFactory f = NavajoFactory.getInstance();
Navajo n = f.createNavajo();
Message msg = f.createMessage(n, "__Mongo__");
Operation o = f.createOperation(n, "PUT", "vla/ProcessInsertPerson", null, "Person", null);
n.addOperation(o);
o.setExtraMessage(msg);
Method m = f.createMethod(n, "vla/ProcessUpdatePerson", null);
m.addRequired("Apenoot");
n.addMethod(m);
n.write(System.err);
}
use of com.dexels.navajo.document.Method in project navajo by Dexels.
the class VersionedNavajoMap method main.
public static void main(String[] args) throws Exception {
Navajo n = NavajoFactory.getInstance().createNavajo(new java.io.FileInputStream("/home/arjen/@@.tml"));
n.write(System.err);
List<Method> l = n.getAllMethods();
logger.debug("l = " + l.size());
System.exit(1);
}
use of com.dexels.navajo.document.Method in project navajo by Dexels.
the class BaseMethodsImpl method getAllMethods.
public List<Method> getAllMethods() {
List<Method> al = new ArrayList<Method>();
for (int i = 0; i < myMethods.size(); i++) {
Method m = (Method) myMethods.get(i);
al.add(m);
}
return al;
}
use of com.dexels.navajo.document.Method in project navajo by Dexels.
the class BaseNavajoImpl method copy.
@Override
public Navajo copy() {
Navajo ni = NavajoFactory.getInstance().createNavajo();
BaseNavajoImpl n = (BaseNavajoImpl) ni;
List<Message> al = getAllMessages();
for (int i = 0; i < al.size(); i++) {
Message m = al.get(i);
Message m2 = copyMessage(m, n);
n.addMessage(m2);
}
List<Method> mm = myMethods.getAllMethods();
for (int i = 0; i < mm.size(); i++) {
Method m = mm.get(i);
Method m2 = m.copy(n);
n.addMethod(m2);
}
List<Operation> oo = myOperations.getAllOperations();
for (Operation o : oo) {
Operation o2 = o.copy(n);
n.addOperation(o2);
}
if (getHeader() != null) {
ni.addHeader(getHeader().copy(ni));
}
return n;
}
Aggregations