@Test public final void testInvalidLocationType() { final Location mockedLocRef = mockery.mock(Location.class, "invalidType"); final String id = "locID"; mockery.checking(new Expectations() { { allowing(mockedLocRef).getLocationType(); will(returnValue(LocationType.UNKNOWN)); } }); mockery.checking(new Expectations() { { allowing(mockedLocRef).getID(); will(returnValue(id)); } }); LocationReferenceHolder result = encodeLocation(mockedLocRef); assertFalse(result.isValid()); assertSame(result.getReturnCode().toString(), EncoderReturnCode.INVALID_LOCATION_TYPE.toString()); assertEquals(result.getID(), id); assertNotNull(result.toString()); }
@Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); }
OpenLREncoder implements openlr.OpenLREncoder { @Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); } }
OpenLREncoder implements openlr.OpenLREncoder { @Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); }  }
OpenLREncoder implements openlr.OpenLREncoder { @Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); }  static List<PhysicalEncoder> getPhysicalEncoderServices(); @Override List<LocationReferenceHolder> encodeLocations(
            final OpenLREncoderParameter parameter, final List<Location> loc); @Override LocationReferenceHolder encodeLocation(
            final OpenLREncoderParameter parameter, final Location loc); @Override String getMajorVersion(); @Override String getMinorVersion(); @Override String getPatchVersion(); @Override String getVersion(); }
OpenLREncoder implements openlr.OpenLREncoder { @Override public LocationReferenceHolder encodeLocation( final OpenLREncoderParameter parameter, final Location loc) throws OpenLRProcessingException { return encodeLocation(parameter, new OpenLREncoderProperties(parameter.getConfiguration(), parameter.getPhysicalEncoders()), loc); }  static List<PhysicalEncoder> getPhysicalEncoderServices(); @Override List<LocationReferenceHolder> encodeLocations(
            final OpenLREncoderParameter parameter, final List<Location> loc); @Override LocationReferenceHolder encodeLocation(
            final OpenLREncoderParameter parameter, final Location loc); @Override String getMajorVersion(); @Override String getMinorVersion(); @Override String getPatchVersion(); @Override String getVersion();  }