public String getName() { return name(); } }
public static NakedObjectActionType getType(final String typeStr) { NakedObjectActionType type = NakedObjectActionType.valueOf(typeStr); if (type == null) { throw new IllegalArgumentException(); } return type; }
private boolean sameActionTypeOrNotSpecified(final NakedObjectActionType type, final NakedObjectAction action) { return type == null || action.getType().equals(type); }
@Ignore("was commented out, don't know details") @Test public void testOnPersistent() throws Exception { // actionPeer.getTarget(); // expectLastCall().andStubReturn(null); NakedObjectsContext.getPersistenceSession().makePersistent(target); mockDistribution.executeServerAction(NakedObjectsContext.getAuthenticationSession(), NakedObjectActionConstants.USER.getName(), identifierString, targetData, parameterData); final ServerActionResultData result = new DummyResultData(new DummyNullValue("type"), new ObjectData[0], new ReferenceData[0], null, new ObjectData[2], new String[0], new String[0]); expectLastCall().andReturn(result); replay(mockNakedObjectActionPeer, mockEncoder, mockDistribution); proxy.invoke(target, parameters); verify(mockNakedObjectActionPeer, mockEncoder, mockDistribution); }
@Ignore("was commented out, don't know details") @Test public void testOnTransientObjectWithRemoteAnnotation() throws Exception { // actionPeer.getTarget(); // expectLastCall().andStubReturn(NakedObjectAction.REMOTE); mockDistribution.executeServerAction(NakedObjectsContext.getAuthenticationSession(), NakedObjectActionConstants.USER.getName(), identifierString, targetData, parameterData); final ServerActionResultData result = new DummyResultData(new DummyNullValue("type"), new ObjectData[0], new ReferenceData[0], null, new ObjectData[2], new String[0], new String[0]); expectLastCall().andReturn(result); mockEncoder.madePersistent(target, null); expectLastCall(); replay(mockNakedObjectActionPeer, mockEncoder, mockDistribution); proxy.invoke(target, parameters); verify(mockNakedObjectActionPeer, mockEncoder, mockDistribution); }
public static NakedObjectActionType getType(final String typeStr) { NakedObjectActionType type = NakedObjectActionType.valueOf(typeStr); if (type == null) { throw new IllegalArgumentException(); } return type; }
public String getName() { return name(); } }
private boolean sameActionTypeOrNotSpecified(final NakedObjectActionType type, final NakedObjectAction action) { return type == null || action.getType().equals(type); }
@Test public void testExecuteOK() { final ServerActionResultData results = null; mockery.checking(new Expectations() { { one(mockEncoder).createServerActionResult( with(equalTo(adapter)), with(equalTo(new ObjectData[0])), with(equalTo(new ReferenceData[0])), with(nullValue(ObjectData.class)), with(equalTo(new ObjectData[0])), with(equalTo(new String[0])), with(equalTo(new String[0]))); will(returnValue(results)); } }); NakedObjectsContext.getTransactionManager().startTransaction(); final ServerActionResultData result = server.executeServerAction( new TestProxySession(), NakedObjectActionConstants.USER.getName(), Movie.class.getName() + "#action()", targetData, parameterData); NakedObjectsContext.getTransactionManager().endTransaction(); assertEquals(results, result); }
public ExecuteServerActionRequest(final DataInputExtended input) throws IOException { super(input); this.actionType = NakedObjectActionType.valueOf(input.readUTF()); this.actionIdentifier = input.readUTF(); this.target = input.readEncodable(IdentityData.class); this.parameters = input.readEncodables(Data.class); initialized(); }
@Override public void encode(DataOutputExtended output) throws IOException { super.encode(output); output.writeUTF(actionType.name()); output.writeUTF(actionIdentifier); output.writeEncodable(target); output.writeEncodables(parameters); }
if (!action.getType().equals(type)) { continue outer;
@Ignore("was commented out, don't know details") @Test public void testObjectsDestroyed() throws Exception { // actionPeer.getTarget(); // expectLastCall().andStubReturn(null); NakedObjectsContext.getPersistenceSession().makePersistent(target); final NakedObject object = system.createPersistentTestObject(); mockDistribution.executeServerAction(NakedObjectsContext.getAuthenticationSession(), NakedObjectActionConstants.USER.getName(), identifierString, targetData, parameterData); final ReferenceData[] disposedReferenceData = new ReferenceData[] { new DummyReferenceData(object.getOid(), object .getSpecification().getFullName(), null) }; final ServerActionResultData result = new DummyResultData(new DummyNullValue("type"), new ObjectData[0], disposedReferenceData, null, new ObjectData[2], new String[0], new String[0]); expectLastCall().andReturn(result); replay(mockNakedObjectActionPeer, mockEncoder, mockDistribution); proxy.invoke(target, parameters); verify(mockNakedObjectActionPeer, mockEncoder, mockDistribution); final List<NakedObject> allDisposedObjects = NakedObjectsContext.getUpdateNotifier().getDisposedObjects(); assertEquals(false, allDisposedObjects.isEmpty()); assertEquals(object, allDisposedObjects.get(0)); assertEquals(true, allDisposedObjects.isEmpty()); } }
public ExecuteServerActionRequest(final DataInputExtended input) throws IOException { super(input); this.actionType = NakedObjectActionType.valueOf(input.readUTF()); this.actionIdentifier = input.readUTF(); this.target = input.readEncodable(IdentityData.class); this.parameters = input.readEncodables(Data.class); initialized(); }
@Override public void encode(DataOutputExtended output) throws IOException { super.encode(output); output.writeUTF(actionType.name()); output.writeUTF(actionIdentifier); output.writeEncodable(target); output.writeEncodables(parameters); }
if (!action.getType().equals(type)) { continue outer;
NakedObjectActionConstants.USER.getName(), Movie.class.getName() + "#action()", targetData,
NakedObjectActionConstants.USER.getName(), Movie.class.getName() + "#action()", targetData,
final ServerActionResultData result = server.executeServerAction( new TestProxySession(), NakedObjectActionConstants.USER.getName(), Movie.class.getName() + "#action()", targetData,